Dataset Open Access

# From A to Z: Projective coordinates leakage in the wild: research data and tooling

Aldaya, Alejandro Cabrera; Pereida Garcia, Cesar; Brumley, Billy Bob

### Dublin Core Export

<?xml version='1.0' encoding='utf-8'?>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:creator>Aldaya, Alejandro Cabrera</dc:creator>
<dc:creator>Pereida Garcia, Cesar</dc:creator>
<dc:creator>Brumley, Billy Bob</dc:creator>
<dc:date>2020-04-15</dc:date>
<dc:description>Description

This dataset and software tool are for reproducing the research results related to CVE-2020-10932 and CVE-2020-11735, resulting from the article "From A to Z: Projective coordinates leakage in the wild" (to appear at CHES 2020). The data was used to carry out the attack in Section 6 of the article.

Data format

txt files

The [int].txt files contain an encoded page-fault trace prefixed by trace:.

A trace represents the sequence of tracked memory pages that were executed during the generation of an ECDSA signature. The trace is encoded using ASCII characters for better visualization.

The encoding follows this table:

| Functions              | Symbol | Page offset |
| ---------------------- |:------:|:-------:|
| _gcry_ecc_ecdsa_sign   |    T   | 0xa1000 |
| _gcry_mpi_invm         |    .   | 0xcf000 |
| _gcry_mpi_set          |    S   | 0xd5000 |
| _gcry_mpi_add          |    A   | 0xcd000 |
| _gcry_mpih_sub_n       |    -   | 0xd8000 |
| _gcry_mpih_rshift      |    -   | 0xd8000 |

_gcry_ecc_ecdsa_sign is the highest level function tracked in the attack. This allows to differentiate different calls to the _gcry_mpi_invm function which contains an insecure version of a Binary Extended Euclidean Algorithm (BEEA).

Using these pages it is possible to locate the execution of _gcry_mpi_invm corresponding to the computation of Z mod p during projective to affine coordinates conversion (see preprocess_trace function).

It can be seen, that _gcry_mpih_sub_n and _gcry_mpih_rshift shares a page. However, they can be differentiated using mainly the caller memory page. This sharing, instead of being a drawback, allows a straightforward recovery of BEEA execution flow (see extract_Zi and extract_Xi functions in recover_z.py).

dat files

The format of the [int].dat files is as follows.

# X [hex]: Ground truth projective output of scalar multiplication, before affine conversion
# Y [hex]: Ground truth projective output of scalar multiplication, before affine conversion
# Z [hex]: Ground truth projective output of scalar multiplication, before affine conversion
# curve_name [str]: The curve (P256)
# h [hex]: Hash of the message to be signed
# k [hex]: Ground truth ECDSA nonce
# q [hex]: Curve order
# r [hex]: First component of the ECDSA signature
# s [hex]: Second component of the ECDSA signature
# x [hex]: Ground truth ECDSA private key
# y [hex] [hex]: Public key coordinates
# leak_pad [int],[int],[int]: Leakage recovered during backtracking. Example: 0,4,15 =&gt; 0 = k % 2**4 = k &amp; 15

Tooling

The recover_z.py script

Recovers the corresponding Z coordinate from the trace data.
verifies the recovered Z matches the ground truth Z.

Example

Unpack the data:

tar xf traces.tar.gz

Run the tooling on trace index 123:

\$ python2 recover_z.py 123
INFO:recovered Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213
INFO:     real Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213

The output demonstrates the recovered Z coordinate is correct, i.e. matches the ground truth.

Credits

Authors

Alejandro Cabrera Aldaya (Tampere University, Tampere, Finland)
Cesar Pereida García (Tampere University, Tampere, Finland)
Billy Bob Brumley (Tampere University, Tampere, Finland)

Funding

This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 804476).

</dc:description>
<dc:identifier>https://zenodo.org/record/3752635</dc:identifier>
<dc:identifier>10.5281/zenodo.3752635</dc:identifier>
<dc:identifier>oai:zenodo.org:3752635</dc:identifier>
<dc:relation>info:eu-repo/grantAgreement/EC/H2020/804476/</dc:relation>
<dc:relation>doi:10.5281/zenodo.3752634</dc:relation>
<dc:rights>info:eu-repo/semantics/openAccess</dc:rights>
<dc:subject>side-channel analysis</dc:subject>
<dc:subject>ECDSA</dc:subject>
<dc:subject>CVE-2020-11735</dc:subject>
<dc:subject>CVE-2020-10932</dc:subject>
<dc:subject>applied cryptography</dc:subject>
<dc:subject>libgcrypt</dc:subject>
<dc:subject>mbedTLS</dc:subject>
<dc:subject>WolfSSL</dc:subject>
<dc:title>From A to Z: Projective coordinates leakage in the wild: research data and tooling</dc:title>
<dc:type>info:eu-repo/semantics/other</dc:type>
<dc:type>dataset</dc:type>
</oai_dc:dc>

140
47
views