Documentation

CslibFrontier.Crypto.Computational.CompositeResiduosity.Finite

The decisional composite residuosity experiments at a fixed modulus #

Fix a positive modulus N. The decisional composite residuosity (DCR) problem ([KL20], Definition 15.10) asks to tell a uniform N-th residue modulo N ^ 2 from a uniform unit modulo N ^ 2. This module states its two worlds at one modulus. The distinguisher receives the challenge as a unit of ZMod (N ^ 2); there are no encodings, security parameter or setup. Each world is an Experiment, read as the challenger's steps.

The asymptotic assumption DCR, over a law on balanced moduli and strict-PPT distinguishers on encoded inputs, is in CslibFrontier/Crypto/Computational/CompositeResiduosity.lean. Its games dcrRealGame and dcrRandomGame draw a modulus and run these experiments.

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.dcrRealExperiment (N : ℕ) [NeZero N] (D : (ZMod (N ^ 2))ˣ → Experiment) :

The real world of the decisional composite residuosity experiment ([KL20], Definition 15.10) at modulus N: the challenger draws a uniform unit s modulo N ^ 2 and gives the distinguisher the N-th residue s ^ N.

noncomputable def Cslib.Crypto.dcrRandomExperiment (N : ℕ) [NeZero N] (D : (ZMod (N ^ 2))ˣ → Experiment) :

The random world of the decisional composite residuosity experiment ([KL20], Definition 15.10) at modulus N: the challenger gives the distinguisher a uniform unit modulo N ^ 2.

noncomputable def Cslib.Crypto.dcrAdvantage (N : ℕ) [NeZero N] (D : (ZMod (N ^ 2))ˣ → Experiment) :

The DCR advantage of D at modulus N: its distinguishing advantage between dcrRealExperiment and dcrRandomExperiment.

In the real world the challenge is powSelfHom N r, the N-th power of a uniform unit r modulo N. An N-th power modulo N ^ 2 depends only on its base modulo N, and reduction modulo N sends the uniform unit modulo N ^ 2 to the uniform unit modulo N.