Cyclic group families of arbitrary order #
A CyclicGroupFamily is a family of finite cyclic groups whose orders need not be prime, with the
encodings and polynomial-time operations of a PrimeOrderGroupFamily. It differs from
PrimeOrderGroupFamily in two fields: order_ne_zero replaces prime_order, and
smul_generator_injective, the injectivity of α ↦ α • g on ZMod q, replaces
generator_ne_zero. With card_carrier the injectivity says that g generates its group of
order q. PrimeOrderGroupFamily.toCyclicGroupFamily maps every prime-order family to a cyclic
one, with the injectivity from PrimeOrderGroupFamily.smul_generator_injective.
Families of composite order are the setting of [BS23], Exercise 10.24 (p. 431), which drops the restriction that the order is prime from the DDH attack game.
Main definitions #
Cslib.Crypto.CyclicGroupFamily: cyclic groups of nonzero order with polynomial-time operations on encoded elements.Cslib.Crypto.PrimeOrderGroupFamily.toCyclicGroupFamily: a prime-order family as a cyclic one.
Main results #
Cslib.Crypto.CyclicGroupFamily.computableInPolyTime_order_comp,Cslib.Crypto.CyclicGroupFamily.computableInPolyTime_encode_generator,Cslib.Crypto.CyclicGroupFamily.computableInPolyTime_encode_zero,Cslib.Crypto.CyclicGroupFamily.computableInPolyTime_encode_natCast_smul:fun_proprules for the order, the encoded generator, the encoded identity and the encoded multiple by a natural number, on computed group parameters.
Implementation notes #
PrimeOrderGroupFamily does not extend CyclicGroupFamily: the two structures repeat their
common fields, and toCyclicGroupFamily copies them. The DDH vocabulary over this structure, and
its agreement with the prime-order one under toCyclicGroupFamily, are in
CslibFrontier/Crypto/Computational/DiffieHellman/CyclicGroupFamily.lean.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 10.5 and Exercise 10.24 (p. 431).
A family of finite cyclic groups of nonzero order, indexed by public group parameters, with
polynomial-time operations on encoded elements. It is PrimeOrderGroupFamily with
order_ne_zero in place of prime_order and smul_generator_injective in place of
generator_ne_zero, so the order need not be prime.
- Desc : Type
The bit-string encoding of the public group parameters given to algorithms.
The order of each group.
Every order is nonzero.
The groups, written additively.
Each group is commutative.
Each group is a
ZMod q-module, whereqis its order.The generator of each group.
Each group has
qelements.- smul_generator_injective (d : self.Desc) : Function.Injective fun (α : ZMod (self.order d)) => α • self.generator d
The generator has order
q:α ↦ α • gis injective onZMod q. Withcard_carrier, the generator generates the group. Group elements as words.
Distinct elements have distinct encodings.
Addition of encoded elements.
- add_encode (d : self.Desc) (x y : self.Carrier d) : self.add (d, self.encode d x, self.encode d y) = self.encode d (x + y)
addadds encoded elements. Multiplication of an encoded element by a natural number.
- smul_encode (d : self.Desc) (a : ℕ) (x : self.Carrier d) : self.smul (d, a, self.encode d x) = self.encode d (↑a • x)
smulmultiplies encoded elements by natural numbers. - computableInPolyTime_order : Turing.MultiTapeTM.ComputableInPolyTime self.order self.encDesc Turing.MultiTapeTM.encNat
The order is computable in polynomial time from the public group parameters.
- computableInPolyTime_generator : Turing.MultiTapeTM.ComputableInPolyTime (fun (d : self.Desc) => self.encode d (self.generator d)) self.encDesc Turing.MultiTapeTM.encBits
The encoded generator is computable in polynomial time from the public group parameters.
- computableInPolyTime_add : Turing.MultiTapeTM.ComputableInPolyTime self.add (Turing.MultiTapeTM.encPair self.encDesc (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits
Addition is computable in polynomial time.
- computableInPolyTime_smul : Turing.MultiTapeTM.ComputableInPolyTime self.smul (Turing.MultiTapeTM.encPair self.encDesc (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encNat Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits
Multiplication by a binary natural number is computable in polynomial time.
A prime-order family as a cyclic group family: a prime is nonzero, and
PrimeOrderGroupFamily.smul_generator_injective supplies the injectivity. The other fields are
copied.
Equality of group elements, decided on their injective encodings.
The order of computed group parameters.
The encoded generator of computed group parameters.
The encoded identity of computed group parameters, computed as 0 • g.
The encoded multiple of a computed element by a computed natural number.