In both DSA and ECDSA (the elliptic-curve DSA) procedures, the signature output is a pair (r,s) of integer numbers such that
where α, h, and k are the private key, the hash of the message to be signed, and the ephemeral key 1, respectively. In particular, r is either the output of the exponentiation (DSA case: gk) or the scalar point multiplication (ECDSA case: [k]P) procedure.
The following lattice descriptions are based on the results presented in [4], which is more focused on the practical Side-Channel Analysis. However, for a deep read, I suggest the paper by Gabrielle De Micheli and Nadia Heninger.
Lattice-based cryptanalysis using timing attacks are commonly focused on determining a few bits from the ephemeral key, which can be easily correlated with the private key by using the above equation. For instance, if the exponentiation or scalar point multiplication procedures have been implemented in non-constant-time, then by a simple timing analysis it is possible to find a sample of d signatures (ri, si) with shorter-than-average ephemeral key ki < q / 2ℓi for some positive integer ℓi. Moreover, the dimensional-(d+1) lattice
B = |
[ 2W1 × q [ 0 [ ⋮ [ 0 |
0 2W2 × q ⋱ ⋯ |
⋯ ⋱ ⋱ 0 |
⋯ ⋯ 0 2Wd × q |
0 ] ⋮ ] ⋮ ] 0 ] |
[ 2W1 × t1 | 2W2 × t2 | ⋯ | 2Wd × td | 1 ] |
and the integer vectors u = ( 2W1 × û1 + q, …, 2W1 × û1 + q, 0 ), z = ( λ1, …, λd, α ), and y = ( 2W1 × ν1, …, 2Wd × νd, α ) satisfy zB - u = y with Wi = 2ℓi, λi ∊ { -q, …, q }, and νi ∊ { -(q - 1)/2, …, (q - 1)/2 } the signed modular reduction of ûi + q/(2Wi) mod q.
Let’s focus on scalar point multiplications using wNAF scalar codifications. Assuming a window width equals w, two kwnon consecutive non-zero coefficients κj and κj + ℓ leads to an equation with δ α-correlated bits. Each column of the lattice B (with same shape as given above), is determined by the pair (κj, κj + ℓ) along with the public values h and (r,s).
In particular, the entries of the integer vector t coincide with r × s-1 × 2m - j - ℓ - 1 mod q, W = 2δ where δ is equal to (ℓ - w) and (ℓ - w + 1) for the unsigned and signed approaches 2 3, respectively. In both cases, the integer vector has the same shape like in the timing attack but without the term q, and the entries of u are equal to
In summary, the private key recovery can be reduced to a Closest Vector Problem (CVP) instance of a given lattice. However, any CVP instance with input lattice B and vector u can be mapped into a Shortest Vector Problem (SVP) instance by looking for a short lattice basis vector in the dimensional-(d + 2) lattice B’
[ B | 0 ] |
[ u | q ] |
In both SVP and CVP instances, one proceeds by reducing the lattice with the LLL or BKZ procedures. But in practice, one proceeds by applying the method by Gama et al. [3], which can be summarized as follows:
In some papers, the integer k is named by nonce but in my opinion, I prefer the term ephemeral key. ↩
The unsigned case refers when it is only possible to determine non-zero wNAF-coefficients, and thus the signed case allows to guess the sign of the wNAF-coefficients. ↩
Here, m denotes the bitlength of q. ↩