Security of Merkle signatures #
A forgery against MerkleSignature.scheme S H depth either contains a collision of H k, or it
is a one-time forgery against S at the leaf it names. Two reductions turn this into a bound with
an explicit loss, for every forger A and every security parameter n:
Pr[A forges] ≤ 2 ^ depth n * Pr[oneTimeForger A forges against S] + Pr[collisionFinder A finds a collision of H].
MerkleSignature.collisionFindergenerates all keys itself, answersA's signing queries honestly, and extracts a collision from the forgery. If the forged verification key differs from the one at the named leaf, both open the same position of the tree, andextractMerkleCollisionfinds a collision in the tree. Otherwise, if the leaf already signed another message with the same digest, those two messages collide.MerkleSignature.oneTimeForgerplants its challenge key at a uniform leafi, generates the other keys itself, and answers the query at leafiwith its one-time signing oracle. Because the indexed game never signs twice at one leaf, it makes at most one query, and its simulation of the signing oracle is exact. A forgery at leafithat is not a collision is a one-time forgery on a new digest. The factor2 ^ depth nis exact: the leaf is drawn from exactly2 ^ depth nvalues.
Merkle ([Mer90], Section 6) gives the construction with an informal argument. The bound is the composition, original to this library, of the plug-and-pray argument for indexed signatures from one-time signatures ([BS23], Section 14.6.1, referring to Exercise 13.2), the collision extraction behind [BS23], Theorem 8.8, for the shrunken public key, and the hash-and-sign bound of [BS23], Theorem 13.1, for the digest.
Main definitions #
Cslib.Crypto.MerkleSignature.collisionOf,Cslib.Crypto.MerkleSignature.collisionFinder: the reduction to collision finding.Cslib.Crypto.MerkleSignature.leafIndex,Cslib.Crypto.MerkleSignature.plantKeys,Cslib.Crypto.MerkleSignature.plantedHandler,Cslib.Crypto.MerkleSignature.oneTimeForgerAt,Cslib.Crypto.MerkleSignature.oneTimeForger: the reduction to one-time forgery.
Main results #
Cslib.Crypto.MerkleSignature.succProbability_indexedEufCmaGame_le: the explicit bound.Cslib.Crypto.MerkleSignature.isPPT_collisionFinder,Cslib.Crypto.MerkleSignature.isOraclePPT_oneTimeForger: the reductions are efficient.Cslib.Crypto.MerkleSignature.eval_leafIndex,Cslib.Crypto.MerkleSignature.isPPTOn_leafIndex: the leaf is exactly uniform and sampled efficiently.Cslib.Crypto.SignatureScheme.OneTimeEUFCMA.indexedEUFCMA_merkle: one-time security ofSand collision resistance ofHgive indexed EUF-CMA security.Cslib.Crypto.OneWay.exists_indexedEUFCMA: a one-way function and a collision-resistant hash family give indexed EUF-CMA secure signatures of every polynomial capacity2 ^ depth n.
References #
- R. C. Merkle, A Certified Digital Signature, Section 6.
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Sections 8.9, 13.2 and 14.6.1.
The reduction to collision finding #
The candidate collision of H k in a forgery out = ((u, msg, sig), signed) against the
keys keys: a collision in the tree if the forged verification key is not the one at leaf u,
and otherwise the forged message with a message signed at leaf u with the same digest.
Instances For
The collision finder: given the hash key k, generate the one-time keys, answer the forger's
signing queries honestly, and return collisionOf its forgery.
Instances For
The reduction to one-time forgery #
Sample a hash key and the one-time keys of every leaf except leaf i, where the
verification key vk is planted with an empty secret key.
Instances For
The one-time forger's answer to a signing request: as the indexed signing oracle, except that
leaf i is signed by an external query to the one-time signing oracle, whose reply is truncated
to bound bits.
Instances For
The one-time forger with its challenge planted at leaf i.
Instances For
The one-time forger: plant the challenge at a uniform leaf.
Instances For
Exact simulation by the one-time forger #
The leaf is exactly uniform below 2 ^ depth n, the law of
ProbComp.sampleBinaryNat (depth n) (ProbComp.eval_sampleBinaryNat). leafIndex reads its bits
with BitString.boundedBinaryValue, whose cap 2 ^ depth n never binds, because the reduction
needs the leaf in unary (isPPTOn_leafIndex), and Probability.isPPTOn_sampleBinaryNat outputs
it in binary.
The explicit bound #
Security of Merkle signatures, with an explicit loss. For every forger and every security
parameter n, the forging probability against MerkleSignature.scheme S H depth is at most
2 ^ depth n times the success of oneTimeForger against S in the one-time game, plus the
success of collisionFinder in the collision game of H. The bound bound n must cover the
length of every one-time signature on an n-bit message under a supported key; the one-time
forger truncates replies to it.
Efficiency of the reductions #
The collision finder is uniformly strict PPT for every oracle-PPT forger.
Sampling a uniform leaf is uniformly strict PPT.
The one-time forger is uniformly strict oracle PPT for every oracle-PPT indexed forger and every polynomial-time truncation bound.
Security #
Merkle signatures are secure ([Mer90], Section 6; [BS23],
Section 14.6.1): if S is one-time EUF-CMA secure and H is collision resistant, then
MerkleSignature.scheme S H depth is an indexed EUF-CMA secure signature scheme of capacity
2 ^ depth n. The reductions are oneTimeForger, with loss 2 ^ depth n, and collisionFinder,
with loss 1 (succProbability_indexedEufCmaGame_le).
Indexed signatures from one-way functions and collision-resistant hashing: Lamport's
one-time scheme on any one-way function, under Merkle's tree with any collision-resistant hash
family, gives an indexed EUF-CMA secure signature scheme of every polynomial capacity
2 ^ depth n.