The group structure behind Paillier encryption #
Paillier encryption works in the unit group of ZMod (N ^ 2) for a modulus N = p * q. These
are the three facts that make up [KL20], Proposition 15.6:
- for distinct odd primes
pandqof the same bit length,gcd(N, φ(N)) = 1(Claim 15.7); - for every positive
N,(1 + N) ^ a = 1 + a * NinZMod (N ^ 2), so1 + Nhas order exactlyNthere (Claim 15.8:ZMod.one_add_natCast_powandZMod.orderOf_one_add_natCastinCslibFrontier.Foundations.Data.ZMod.SquareModulus); - when
gcd(N, φ(N)) = 1, the map(a, b) ↦ (1 + N) ^ a * b ^ Nis a group isomorphism fromZMod N × (ZMod N)ˣonto(ZMod (N ^ 2))ˣ(Claim 15.9).
This file proves Claims 15.7 and 15.9. It also proves the identity behind Paillier decryption:
raising (1 + N) ^ m * r ^ N to the power φ(N) removes the randomness r and leaves
1 + m * φ(N) * N. The function logOneAdd reads the exponent back off: it is the function L
of [KL20], Construction 15.11.
Main definitions #
Cslib.Crypto.Paillier.unitsEquiv: the isomorphismMultiplicative (ZMod N) × (ZMod N)ˣ ≃* (ZMod (N ^ 2))ˣof Claim 15.9.Cslib.Crypto.Paillier.logOneAdd: the discrete logarithmx ↦ (x - 1) / Nto the base1 + N.
Main results #
Cslib.Crypto.Paillier.coprime_totient: Claim 15.7.Cslib.Crypto.Paillier.coe_unitsEquiv_ofAdd: Claim 15.9.Cslib.Crypto.Paillier.one_add_pow_mul_pow_pow_totient: the decryption identity.Cslib.Crypto.Paillier.logOneAdd_oneAddPowHom:logOneAddinvertsa ↦ (1 + N) ^ a.Cslib.Crypto.Paillier.powSelfHom_unitsMap: anN-th power moduloN ^ 2depends only on its base moduloN.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Chapter 15, Proposition 15.6 and Claims 15.7, 15.8 and 15.9.
Claim 15.7 #
Claim 15.9 #
Powers of 1 + N depend only on the exponent modulo N.
The N-th power of a unit modulo N ^ 2 is powSelfHom of its reduction modulo N: it
depends only on the unit modulo N.
When gcd(N, φ(N)) = 1, the map (a, b) ↦ (1 + N) ^ a * b ^ N is bijective.
Claim 15.9 ([KL20]): when gcd(N, φ(N)) = 1, the map
(a, b) ↦ (1 + N) ^ a * b ^ N is a group isomorphism
Multiplicative (ZMod N) × (ZMod N)ˣ ≃* (ZMod (N ^ 2))ˣ.
The decryption identity #
logOneAdd inverts a ↦ (1 + N) ^ a.