Schnorr groups #
A Schnorr group is the subgroup of prime order q of (ZMod p)ˣ, for a prime p, generated by
a residue g of multiplicative order q. Its public group parameters are the triple (p, q, g)
of binary numbers; its elements are encoded by the binary digits of their residues. Multiplication
and exponentiation are computed modulo p, by schoolbook multiplication and square-and-multiply.
These groups form a PrimeOrderGroupFamily, so the discrete-logarithm assumption and the
security theorems stated for such families apply to them.
A parameter bundle is valid when p and q are prime, 1 < g < p and g ^ q % p = 1; these
facts imply that g has order q and that q divides p - 1. SchnorrGroup.Desc contains the
triple together with proofs of these conditions. For example, (23, 11, 2) selects the subgroup
of order 11 modulo 23 generated by 2. The fixed family schnorrGroups supplies modular
arithmetic algorithms for every such bundle. encDesc encodes just the binary triple, while
validity is part of the Lean input type. Nothing here claims efficient generation of valid
parameter bundles.
Main definitions #
Cslib.Crypto.SchnorrGroup.Valid: validity of public group parameters(p, q, g).Cslib.Crypto.SchnorrGroup.Desc: parameter bundles carrying their validity proofs.Cslib.Crypto.schnorrGroups: Schnorr groups as aPrimeOrderGroupFamily.
References #
Validity of public Schnorr-group parameters (p, q, g): p and q are prime, and the residue
g satisfies 1 < g < p and g ^ q ≡ 1 (mod p).
- prime_modulus : Nat.Prime (rawModulus d)
The modulus is prime.
The group order is prime.
- one_lt_generator : 1 < rawGeneratorResidue d
The generator is not
0or1. The generator is a reduced residue.
The generator has order dividing
q.
Public Schnorr-group parameters (p, q, g) together with validity proofs. A value selects
the subgroup of order q modulo p generated by g; for example, (23, 11, 2).
The prime modulus p of a valid Schnorr-group description (p, q, g).
Instances For
The prime subgroup order q of a valid Schnorr-group description (p, q, g).
The subgroup generator residue g of a valid Schnorr-group description (p, q, g).
The Schnorr group of a description, written additively.
Instances For
The generator has order dividing q.
Every element of the Schnorr group has order dividing q.
The generator is not the identity.
The generator of the Schnorr group.
The generator is not the identity of the Schnorr group.
Distinct elements have distinct encodings.
The encoded generator is the binary digits of g.
The group order is computable in polynomial time from the description.
The encoded generator is computable in polynomial time from the description.
Multiplication modulo p is computable in polynomial time.
Exponentiation modulo p is computable in polynomial time, by square-and-multiply.
Schnorr groups with efficient operations. This fixes the modular arithmetic algorithms;
each d : schnorrGroups.Desc supplies public parameters (p, q, g) and their validity proofs,
selecting the subgroup of order q of (ZMod p)ˣ generated by g.