Pairing-group infrastructure #
Infrastructure for cryptographic pairing groups, after [BS23], Section 15.4
(Definition 15.2 and equation (15.7), p. 625), where a pairing is an efficiently computable
bilinear map e : G₀ × G₁ → GT between cyclic groups of the same prime order q, with generators
g₀ and g₁ of the source groups, such that e(g₀, g₁) generates the target group GT.
PairingGroupFamily states this for a family of groups indexed by public parameters, as
PrimeOrderGroupFamily does for one group. The first source group is a PrimeOrderGroupFamily,
which supplies the parameters, their encoding and the order. The second source group and the
target group are PrimeOrderGroupFamily.Companions of it: further groups of the same order over
the same parameters, each with its own generator, encoding and polynomial-time operations. The
pairing is a ZMod q-bilinear map for each choice of parameters, together with a function on
encodings that computes it in polynomial time.
Groups are written additively, as in PrimeOrderGroupFamily: the source's u ^ α is α • u, its
u · u' is u + u' and its identity is 0. Bilinearity is stated as linearity over ZMod q in
each argument (PairingGroupFamily.pair_smul_smul,
PairingGroupFamily.pair_smul_generator_smul_generator for (15.7)), and non-degeneracy as the
equation pair d g₀ g₁ = gT for the generator gT that the target group carries
(PairingGroupFamily.pair_generator_ne_zero). Using the supporting algebraic equivalence
biadditive_iff_apply_smul_generator (after the remark following (15.7) on p. 625),
bilinearOfSmulGenerator and PairingGroupFamily.ofSmulGenerator build the ZMod q-bilinear
pairing and family directly from a plain map satisfying the generator product rule (15.7).
A companion is a prime-order group family of its own (Companion.toFamily), so DiscreteLog (and,
for clients importing CslibFrontier.Crypto.Computational.DiffieHellman, CDH and DDH) are
stated for the second source group and for the target group as they are for the first, and
Companion forwards fun_prop rules for encoded group operations. A family is a companion of
itself (PrimeOrderGroupFamily.self); a pairing is symmetric when its second source group is the
first one, P.G₁ = P.G₀.self.
This module provides pairing-group definitions and supporting infrastructure only; it constructs no elliptic-curve pairing and states no hardness assumption or published theorem endpoint. Co-CDH and decision BDH, BLS signatures, pairing-based identity-based encryption, and tripartite/multilinear Diffie–Hellman key exchange ([BS23], Sections 15.4–15.6 and 15.8) are tracked in #640 and #5739.
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.Companion: a further group of the same order over the parameters of a prime-order group family.Cslib.Crypto.PrimeOrderGroupFamily.Companion.toFamily: a companion as a family of its own.Cslib.Crypto.PrimeOrderGroupFamily.self: a family as its own companion.Cslib.Crypto.bilinearOfSmulGenerator: constructs aZMod q-bilinear map between cyclicZMod q-modules from a function satisfying the generator product rule (15.7).Cslib.Crypto.PairingGroupFamily: two source groups, a target group and a pairing computable in polynomial time on encodings.Cslib.Crypto.PairingGroupFamily.ofSmulGenerator: constructs aPairingGroupFamilyfrom a plain pairing function satisfyingpair d (α • g₀) (β • g₁) = (α * β) • gT.
Main results #
Cslib.Crypto.PairingGroupFamily.computableInPolyTime_encode_pair:fun_propcertificate showing that the encoded pairing of polynomial-time computed elements is computable in polynomial time (original infrastructure).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 15.4 (Definition 15.2 and (15.7), p. 625).
A further family of cyclic groups over the public parameters of F: for each d : F.Desc a
group Carrier d of the same prime order F.order d, with its own generator, encoding and
polynomial-time operations on encoded elements. The second source group and the target group of a
pairing are companions of the first source group.
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.The generator is not the identity, so it generates the group of prime order.
Group elements as words.
Distinct elements have distinct encodings.
Addition of encoded elements.
- add_encode (d : F.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 : F.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_generator : Turing.MultiTapeTM.ComputableInPolyTime (fun (d : F.Desc) => self.encode d (self.generator d)) F.encDesc Turing.MultiTapeTM.encBits
The encoded generator is computable in polynomial time from the public group parameters.
- computableInPolyTime_add : Turing.MultiTapeTM.ComputableInPolyTime self.add (encDescBitsPair F.encDesc) Turing.MultiTapeTM.encBits
Addition is computable in polynomial time.
- computableInPolyTime_smul : Turing.MultiTapeTM.ComputableInPolyTime self.smul (Turing.MultiTapeTM.encPair F.encDesc (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encNat Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits
Multiplication by a binary natural number is computable in polynomial time.
Equality of elements of a companion, decided on their injective encodings.
A companion of F as a prime-order group family of its own, with the parameters, their
encoding and the orders of F. The assumptions DiscreteLog, CDH and DDH for a companion are
those of C.toFamily.
The encoded generator of a companion at computed group parameters.
The encoded identity of a companion at computed group parameters.
The encoded sum of computed elements of a companion.
The encoded multiple of a computed element of a companion by a computed natural number.
Supporting algebraic step for bilinearOfSmulGenerator (after [BS23], Section 15.4,
equation (15.7), p. 625): between ZMod q-modules generated by g₀ and g₁, a map e is
additive in each argument if and only if e (α • g₀) (β • g₁) = (α * β) • e g₀ g₁ for all α and
β.
Construct a ZMod q-bilinear map between ZMod q-modules generated by g₀ and g₁ from a
plain function e satisfying the generator product rule e (α • g₀) (β • g₁) = (α * β) • e g₀ g₁
(after [BS23], Section 15.4, equation (15.7), p. 625).
Evaluating bilinearOfSmulGenerator recovers the underlying function e.
A family of pairing groups ([BS23], Section 15.4, Definition 15.2, p. 625): for each
choice of public parameters d, groups G₀ d, G₁ d and GT d of the same prime order q with
generators g₀, g₁ and gT, and a bilinear map pair d : G₀ d → G₁ d → GT d with
pair d g₀ g₁ = gT, computable in polynomial time on encodings.
The source groups are G₀ and G₁ and the target group is GT. Groups are written additively,
so bilinearity is linearity over ZMod q in each argument. The source names e(g₀, g₁) as the
generator gT of the target group; here GT carries a generator, which its polynomial-time
operations use, and pair_generator states that it is the pairing of the two generators.
The first source group, which fixes the public parameters and the order.
The second source group.
The target group.
- pair (d : self.G₀.Desc) : self.G₀.Carrier d →ₗ[ZMod (self.G₀.order d)] self.G₁.Carrier d →ₗ[ZMod (self.G₀.order d)] self.GT.Carrier d
The pairing, bilinear over
ZMod q. - pair_generator (d : self.G₀.Desc) : ((self.pair d) (self.G₀.generator d)) (self.G₁.generator d) = self.GT.generator d
Non-degeneracy: the pairing of the two generators is the generator of the target group.
The pairing on encoded elements.
- pairEncoded_encode (d : self.G₀.Desc) (u : self.G₀.Carrier d) (v : self.G₁.Carrier d) : self.pairEncoded (d, self.G₀.encode d u, self.G₁.encode d v) = self.GT.encode d (((self.pair d) u) v)
pairEncodedpairs encoded elements. - computableInPolyTime_pairEncoded : Turing.MultiTapeTM.ComputableInPolyTime self.pairEncoded (encDescBitsPair self.G₀.encDesc) Turing.MultiTapeTM.encBits
The pairing is computable in polynomial time.
Construct a PairingGroupFamily from a plain pairing function pair satisfying the generator
product rule pair d (α • g₀) (β • g₁) = (α * β) • gT (after [BS23], Section 15.4,
equation (15.7), p. 625), deriving ZMod q-bilinearity via bilinearOfSmulGenerator and
pair_generator at α = β = 1.
The identity e(g₀ ^ α, g₁ ^ β) = e(g₀, g₁) ^ (α · β) of [BS23], (15.7), first
equality (p. 625), with e(g₀, g₁) written as the generator of the target group.
The encoded pairing of computed elements.