Residues modulo a square #
In ZMod (N ^ 2) the residue N squares to zero. So 1 + N behaves like 1 + ε with
ε ^ 2 = 0: (1 + N) ^ a = 1 + a * N, and 1 + N has order exactly N for positive N. An
N-th power modulo N ^ 2 depends only on its base modulo N, and the units satisfy Euler's
theorem with exponent φ(N ^ 2) = N * φ(N). These facts underlie Paillier encryption
([KL20], Claim 15.8 and the proof of Claim 15.9).
Main results #
ZMod.natCast_mul_self_eq_zero:N * N = 0inZMod (N ^ 2).ZMod.one_add_natCast_pow,ZMod.one_add_natCast_pow_self,ZMod.orderOf_one_add_natCast:(1 + N) ^ a = 1 + a * N, so(1 + N) ^ N = 1, and1 + Nhas orderNwhen0 < N.ZMod.val_one_add_natCast_mul: the least representative of1 + k * Nis1 + (k % N) * N.ZMod.add_natCast_mul_pow_self,ZMod.natCast_pow_self_mod: anN-th power moduloN ^ 2only depends on the base moduloN.ZMod.natCast_pow_mul_totient:r ^ (N * φ(N)) = 1moduloN ^ 2forrcoprime toN.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Chapter 15, Claims 15.8 and 15.9.