Documentation

CslibFrontier.Crypto.Protocols.VOLE.RingMAC

IT-MACs over ZMod n: root bounds and statistical binding #

Over a field, a forged IT-MAC opening passes for at most one global key (Basic.lean). Hazay and Yang [HY24] run IT-MACs over the ring ZMod (N ^ ζ) of Damgård–Jurik plaintexts, where N = p * q. There a nonzero linear or quadratic polynomial can have many roots, and binding holds only up to the smallest prime factor of the modulus.

Degrees one and two of the root bound ZMod.card_filter_eval_eq_zero_le give the IT-MAC binding lemma and the quadratic root bound of [HY24], §5.1 (Lemmas 3 and 4 of the ePrint version), for every modulus n: the errors are 1 / n.minFac and 2 * (n / n.minFac) roots. Both bounds are attained for every n > 1. For the Damgård–Jurik modulus (p * q) ^ ζ with primes p < q they take the paper's form 1 / p and 2 * p ^ (ζ - 1) * q ^ ζ.

Main definitions #

Main results #

References #

IT-MAC binding over ZMod n #

theorem Cslib.Crypto.Protocols.VOLE.card_filter_mac_eq_le {n : ℕ} [NeZero n] {x x' : ZMod n} (m m' : ZMod n) (hne : x' ≠ x) :
{delta : ZMod n | x * delta + m = x' * delta + m'}.card ≤ n / n.minFac

IT-MAC binding over ZMod n, counting form ([HY24], §5.1, Lemma 3). If the honest IT-MAC relation is x * Δ + m and a forger opens a different value x' ≠ x with any tag m', at most n / n.minFac global keys Δ accept the forgery.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_voleVerifyOpening_le_minFac {n k : ℕ} [NeZero n] {x v x' v' : Fin k → ZMod n} (hne : x' ≠ x) :
(Probability.PMF.uniformOfFintype (ZMod n)).toOuterMeasure {delta : ZMod n | ∀ (i : Fin k), x i * delta + v i = x' i * delta + v' i} ≤ 1 / ↑n.minFac

IT-MAC binding over ZMod n ([HY24], §5.1, Lemma 3). For opened value vectors x' ≠ x, a forged opening passes verification under a uniform global key with probability at most 1 / n.minFac. For the Damgård–Jurik modulus (p * q) ^ ζ this is 1 / p (toOuterMeasure_voleVerifyOpening_le_inv_prime). This is the ring counterpart of toOuterMeasure_voleVerifyOpening_le.

Quadratic root bound #

theorem Cslib.Crypto.Protocols.VOLE.card_filter_quadratic_eq_zero_le {n : ℕ} [NeZero n] {a : ZMod n} (b c : ZMod n) (ha : a ≠ 0) :
{χ : ZMod n | a * χ ^ 2 + b * χ + c = 0}.card ≤ 2 * (n / n.minFac)

Quadratic root bound over ZMod n ([HY24], §5.1, Lemma 4). A quadratic a * χ ^ 2 + b * χ + c with a ≠ 0 has at most 2 * (n / n.minFac) roots in ZMod n.

Sharpness #

The residue n / n.minFac in ZMod n. It is nonzero for n > 1 (ringMacGap_ne_zero), and a nonzero value gap of this size attains both bounds above.

ringMacGap n * y = 0 exactly when y vanishes modulo the smallest prime factor of n.

For n > 1, ringMacGap n is nonzero.

theorem Cslib.Crypto.Protocols.VOLE.card_filter_mac_ringMacGap {n : ℕ} [NeZero n] (x m : ZMod n) :
{delta : ZMod n | x * delta + m = (x + ringMacGap n) * delta + m}.card = n / n.minFac

Lemma 3 is sharp. Shifting the value by ringMacGap n leaves exactly n / n.minFac accepting keys.

theorem Cslib.Crypto.Protocols.VOLE.card_filter_quadratic_ringMacGap {n : ℕ} [NeZero n] (hn : 1 < n) :
{χ : ZMod n | ringMacGap n * χ ^ 2 + -ringMacGap n * χ + 0 = 0}.card = 2 * (n / n.minFac)

Lemma 4 is sharp. For n > 1, the quadratic g * χ ^ 2 - g * χ with g = ringMacGap n ≠ 0 has exactly 2 * (n / n.minFac) roots: the residues that are 0 or 1 modulo n.minFac.

Damgård–Jurik moduli #

theorem Cslib.Crypto.Protocols.VOLE.mul_pow_div_minFac {p q ζ : ℕ} (hp : Nat.Prime p) (hq : Nat.Prime q) (hpq : p < q) (hζ : ζ ≠ 0) :
(p * q) ^ ζ / ((p * q) ^ ζ).minFac = p ^ (ζ - 1) * q ^ ζ

For primes p < q and ζ ≠ 0, the bound n / n.minFac at n = (p * q) ^ ζ is p ^ (ζ - 1) * q ^ ζ.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_voleVerifyOpening_le_inv_prime {p q ζ k : ℕ} (hp : Nat.Prime p) (hq : Nat.Prime q) (hpq : p < q) (hζ : ζ ≠ 0) [NeZero ((p * q) ^ ζ)] {x v x' v' : Fin k → ZMod ((p * q) ^ ζ)} (hne : x' ≠ x) :
(Probability.PMF.uniformOfFintype (ZMod ((p * q) ^ ζ))).toOuterMeasure {delta : ZMod ((p * q) ^ ζ) | ∀ (i : Fin k), x i * delta + v i = x' i * delta + v' i} ≤ 1 / ↑p

IT-MAC binding for Damgård–Jurik moduli ([HY24], §5.1, Lemma 3, in the paper's form). Over ZMod ((p * q) ^ ζ) with primes p < q, a forged opening x' ≠ x passes under a uniform key with probability at most 1 / p.

theorem Cslib.Crypto.Protocols.VOLE.card_filter_quadratic_eq_zero_le_mul_pow {p q ζ : ℕ} (hp : Nat.Prime p) (hq : Nat.Prime q) (hpq : p < q) (hζ : ζ ≠ 0) [NeZero ((p * q) ^ ζ)] {a : ZMod ((p * q) ^ ζ)} (b c : ZMod ((p * q) ^ ζ)) (ha : a ≠ 0) :
{χ : ZMod ((p * q) ^ ζ) | a * χ ^ 2 + b * χ + c = 0}.card ≤ 2 * p ^ (ζ - 1) * q ^ ζ

Quadratic root bound for Damgård–Jurik moduli ([HY24], §5.1, Lemma 4, in the paper's form). Over ZMod ((p * q) ^ ζ) with primes p < q, a quadratic with nonzero leading coefficient has at most 2 * p ^ (ζ - 1) * q ^ ζ roots.