RSA signatures on a digest #
[BS23], Section 13.3.1, signs a message m with the RSA key (n, d) as
σ := H(m) ^ d ∈ ℤ_n and accepts σ on m when σ ^ e = H(m). rsaSignature desc H is this
Signature.Scheme for the key desc and any digest function H : M → ℕ, and
unhashedRSASignature desc is the unhashed RSA system of p. 537, which signs a residue
m : Fin N directly.
The scheme is the scheme of one key: key generation returns desc, where the book's key
generator runs RSAGen(ℓ, e). Every statement about it holds for every key, so it holds for a
key drawn from any law first, as rsaInversionGame draws its key. Signatures are natural numbers,
and verify accepts σ on m when σ < N and σ ^ e % N = H m % N; the book takes σ ∈ ℤ_n
and compares σ ^ e with H(m), whose range it describes as "embedded in ℤ_n".
Main definitions #
Cslib.Crypto.rsaSignature: RSA signatures on the digestH m, for a fixed key.Cslib.Crypto.unhashedRSASignature: RSA signatures on residues moduloN, without a hash.
Main results #
Cslib.Crypto.rsaSignature_correct: every signature verifies.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 13.3.1, pp. 536–537.
RSA signatures on a digest, for the key desc and the digest function H
([BS23], Section 13.3.1): the signature on m is H m ^ d % N, and σ is accepted
on m when σ < N and σ ^ e % N = H m % N. Key generation returns the fixed key.
The unhashed RSA system ([BS23], p. 537): the messages are the residues modulo N
and the signature on m is m ^ d % N.
Every signature of rsaSignature verifies.