Documentation

Complexity.Computability.Circuit.Boolean.Iteration.SequentialSquaring

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 #

Main results #

References #

@[reducible, inline]

The Carmichael exponent λ(M): the exponent of the unit group of ZMod M.

Instances For

    The Carmichael exponent of any modulus is positive.

    Modulo a prime divisor p of M, every residue satisfies y ^ (λ(M) + 1) = y.

    For squarefree M, every residue modulo M, unit or not, satisfies x ^ (λ(M) + 1) = x.

    theorem Cslib.Circuits.Boolean.Iteration.SequentialSquaring.pow_add_mul_carmichael {M : ℕ} (hM : Squarefree M) (x : ZMod M) {a : ℕ} (ha : 1 ≤ a) (k : ℕ) :
    x ^ (a + carmichael M * k) = x ^ a

    Adding a multiple of λ(M) to a positive exponent does not change the power map.

    theorem Cslib.Circuits.Boolean.Iteration.SequentialSquaring.pow_eq_pow_of_modEq {M : ℕ} (hM : Squarefree M) (x : ZMod M) {a b : ℕ} (ha : 1 ≤ a) (hb : 1 ≤ b) (h : a ≡ b [MOD carmichael M]) :
    x ^ a = x ^ b

    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)).

      theorem Cslib.Circuits.Boolean.Iteration.SequentialSquaring.crypto_table_entries :
      512 ^ 3 * 2 ^ 512 / 2 ^ 40 = 2 ^ 499 ∧ 256 ^ 3 * 2 ^ 256 / 2 ^ 40 = 2 ^ 240 ∧ 128 ^ 3 * 2 ^ 128 / 2 ^ 40 = 2 ^ 109 ∧ (2 ^ 512).sqrt = 2 ^ 256 ∧ (2 ^ 256).sqrt = 2 ^ 128 ∧ (2 ^ 128).sqrt = 2 ^ 64

      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.