Decodable prime-order group families #
A DecodablePrimeOrderGroupFamily extends PrimeOrderGroupFamily with a canonical decoder
decode : ∀ d, List Bool → Option (Carrier d) whose domain indicator (decode d w).isSome is
computable in polynomial time (computableInPolyTime_isElem) and which inverts encode d on both
sides (decode_encode and encode_eq_of_decode_eq_some).
Because encode d is injective and decode d accepts only canonical encodings, the Boolean
membership test isElem (d, w) := (decode d w).isSome characterizes Set.range (encode d), and
the encoded partial inverse (decode d w).map (encode d) equals if isElem (d, w) then some w else none, so it is also computable in polynomial time (computableInPolyTime_decode_map_encode).
Main definitions #
Cslib.Crypto.DecodablePrimeOrderGroupFamily: aPrimeOrderGroupFamilyequipped with a canonical decoder and a polynomial-time group-element membership test.Cslib.Crypto.DecodablePrimeOrderGroupFamily.isElem: Boolean group-element membership test on(d, w).
Main results #
Cslib.Crypto.DecodablePrimeOrderGroupFamily.decode_eq_some_iff:decode d w = some x ↔ w = encode d x.Cslib.Crypto.DecodablePrimeOrderGroupFamily.isElem_eq_true_iff:isElem (d, w) = true ↔ w ∈ Set.range (encode d).Cslib.Crypto.DecodablePrimeOrderGroupFamily.computableInPolyTime_decode_map_encode: the encoded partial decoder(d, w) ↦ (decode d w).map (encode d)is computable in polynomial time.
A prime-order group family equipped with a canonical decoder whose domain membership test is computable in polynomial time.
- computableInPolyTime_generator : Turing.MultiTapeTM.ComputableInPolyTime (fun (d : self.Desc) => self.encode d (self.generator d)) self.encDesc Turing.MultiTapeTM.encBits
Decode a bit string as an element of
Carrier d, returningnoneif the word is not the canonical encoding of any group element.Decoding the encoding of any group element recovers that element.
- encode_eq_of_decode_eq_some {d : self.Desc} {w : List Bool} {x : self.Carrier d} : self.decode d w = some x → w = self.encode d x
decoderejects non-canonical encodings. - computableInPolyTime_isElem : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : self.Desc × List Bool) => (self.decode p.1 p.2).isSome) (Turing.MultiTapeTM.encPair self.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool
Testing whether a word represents a group element in
Carrier dis computable in polynomial time.
Boolean group-element membership test on (d, w): true iff F.decode d w succeeds.
On words, decoding followed by re-encoding equals gating w on F.isElem (d, w).
Decoding a word with fallback z and re-encoding equals returning w when F.isElem (d, w)
holds and F.encode d z otherwise.
Group-element membership testing for computed group descriptions and candidate words is computable in polynomial time.
The encoded partial decoder (d, w) ↦ (F.decode d w).map (F.encode d) is computable in
polynomial time.