Sequential squaring modulo a fixed squarefree modulus #
For a squarefree modulus M, write λ(M) for the Carmichael exponent, here the exponent of the
unit group (ZMod M)ˣ (carmichael). Every residue, unit or not, satisfies
x ^ (λ(M) + 1) = x (pow_carmichael_succ), so two positive exponents that agree modulo λ(M)
give the same power map (pow_eq_pow_of_modEq). Consequently T sequential squarings are the
single power x ↦ x ^ e with e = 1 + (2 ^ T - 1) % λ(M) (reducedExponent,
iterate_square_reduced), for every T, including T = 0, and every residue.
Main definitions #
Cslib.Circuits.Boolean.Iteration.SequentialSquaring.carmichael: the Carmichael exponentλ(M)ofZMod M, defined asMonoid.exponent (ZMod M)ˣ.Cslib.Circuits.Boolean.Iteration.SequentialSquaring.reducedExponent: the reduced exponent1 + (2 ^ T - 1) % λ(M)ofTsequential squarings.
Main results #
Cslib.Circuits.Boolean.Iteration.SequentialSquaring.pow_carmichael_succ: for squarefreeM, everyx : ZMod Msatisfiesx ^ (carmichael M + 1) = x.Cslib.Circuits.Boolean.Iteration.SequentialSquaring.pow_eq_pow_of_modEq: positive exponents congruent modulocarmichael Minduce identical power maps onZMod M.Cslib.Circuits.Boolean.Iteration.SequentialSquaring.iterate_square_reduced:Tsequential squarings modulo squarefreeMequalx ^ reducedExponent M T.Cslib.Circuits.Boolean.Iteration.SequentialSquaring.crypto_table_entries: parameter table values forn = 512, 256, 128andT = 2 ^ 40.
References #
- Adapted from lean/Proofs/SequentialSquaring.lean in S. Schlesinger, Square-root circuit bounds for iterated functions.
The Carmichael exponent λ(M): the exponent of the unit group of ZMod M.
Instances For
The Carmichael exponent of any modulus is positive.
For squarefree M, every residue modulo M, unit or not, satisfies x ^ (λ(M) + 1) = x.
Adding a multiple of λ(M) to a positive exponent does not change the power map.
For squarefree M, positive exponents congruent modulo λ(M) give the same power of every
residue, including non-units.
The reduced exponent 1 + (2 ^ T - 1) % λ(M) of T squarings.
Instances For
The reduced exponent is positive and at most λ(M).
Sequential squaring modulo a fixed squarefree M: for every T and every residue x,
including non-units, T squarings equal the single power x ^ (1 + (2 ^ T - 1) % λ(M)).
The entries of the parameter table in the cryptographic section, without the omitted
constant and polynomial factors. For state lengths n = 512, 256, 128 and T = 2 ^ 40, the
dictionary size n ^ 3 * 2 ^ n / T of a constant-factor speed-up is 2 ^ 499, 2 ^ 240, and
2 ^ 109, and sqrt (2 ^ n) is 2 ^ 256, 2 ^ 128, and 2 ^ 64.