Documentation

CslibFrontier.Crypto.Primitives.UHF.Difference

Computational difference unpredictability #

An adversary receives the unary security parameter and the public setup, then submits two messages and an encoded digest difference. The challenger keeps the uniform hash key private. Checking the encoded difference allows the digest group to vary with the public setup while the adversary's output encoding stays fixed.

Main definitions #

Main results #

References #

theorem Cslib.Crypto.UHF.encDifferenceGuess_mk_polyTime {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → CollisionGuess M} {x1 : γ → T} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn (encCollisionGuess encM)) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn encT) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { toCollisionGuess := x0 x, difference := x1 x }) encIn (encDifferenceGuess encM encT)

Frame the encoded pair of messages, then write the encoded difference.

theorem Cslib.Crypto.UHF.encDifferenceGuess_mk_deg {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : CollisionGuess M × T) => { toCollisionGuess := p.1, difference := p.2 }) (encDifferenceGuessFields encM encT) (encDifferenceGuess encM encT) 1 1
theorem Cslib.Crypto.UHF.encDifferenceGuess_mk_budget {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → CollisionGuess M} {x1 : γ → T} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (encCollisionGuess encM) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encT budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { toCollisionGuess := x0 x, difference := x1 x }) encIn (encDifferenceGuess encM encT) budget
theorem Cslib.Crypto.UHF.encDifferenceGuess_mk_inO {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → CollisionGuess M} {T0 S0 : γ → ℕ} {x1 : γ → T} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (encCollisionGuess encM) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn encT T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { toCollisionGuess := x0 x, difference := x1 x }) encIn (encDifferenceGuess encM encT) (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Crypto.UHF.encDifferenceGuess_difference_budget {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DifferenceGuess M T} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encDifferenceGuess encM encT) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).difference) encIn✝ encT S✝
theorem Cslib.Crypto.UHF.encDifferenceGuess_toCollisionGuess_budget {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DifferenceGuess M T} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encDifferenceGuess encM encT) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).toCollisionGuess) encIn✝ (encCollisionGuess encM) S✝
@[reducible, inline]

The tuple of the fields of encDifferenceGuess.

theorem Cslib.Crypto.UHF.encDifferenceGuess_toCollisionGuess_polyTime {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → DifferenceGuess M T} :
theorem Cslib.Crypto.UHF.encDifferenceGuess_difference_polyTime {M T : Type} (encM : M ↪ List Bool) (encT : T ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → DifferenceGuess M T} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encDifferenceGuess encM encT) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).difference) encIn✝ encT
noncomputable def Cslib.Crypto.UHF.differenceGame {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → AddGroup (Y d)] (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (encY : (d : D) → Y d ↪ List Bool) (A : ℕ × D → ProbComp (DifferenceGuess M (List Bool))) (n : ℕ) :

Attack Game 7.3 ([BS23], v0.6, §7.4, p. 268) with public setup. Two distinct valid messages win when the submitted bits encode the second digest minus the first. The key is uniform in K d and private. Digest groups can vary with setup. Remark 7.3 allows group-valued digests.

def Cslib.Crypto.UHF.IsComputationalDUF {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → AddGroup (Y d)] (encD : D ↪ List Bool) (encM : M ↪ List Bool) (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (encY : (d : D) → Y d ↪ List Bool) :

Computational DUF security ([BS23], Definition 7.5 and Remark 7.3, printed p. 269) against uniform strict PPT adversaries who receive the framed unary parameter and public setup. Predictions are digest words. Malformed words and invalid or repeated messages lose. Setup may have arbitrary runtime in this security predicate. Applications supply the hash family's recognition, sampling and evaluation requirements from Definition 7.4.

theorem Cslib.Crypto.UHF.IsComputationalDUF.isComputationalUHF_of_zero_polyTime {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → AddGroup (Y d)] [(d : D) → DecidableEq (Y d)] {encD : D ↪ List Bool} {encM : M ↪ List Bool} {setup : ℕ → ProbComp D} {valid : ℕ → D → M → Bool} {H : ℕ → (d : D) → K d → M → Y d} {encY : (d : D) → Y d ↪ List Bool} (hH : IsComputationalDUF encD encM setup valid H encY) (hzero : Turing.MultiTapeTM.ComputableInPolyTime (fun (d : D) => (encY d) 0) encD Turing.MultiTapeTM.encBits) :
IsComputationalUHF encD encM setup valid H

If the encoded zero is efficiently available from setup, a collision guess gives a difference guess with the same success probability. This transports computational DUF security across arbitrary digest encodings using the zero prediction of [BS23], p. 269.

theorem Cslib.Crypto.UHF.IsComputationalDUF.isComputationalUHF_zmod {D M : Type} {K : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] {encD : D ↪ List Bool} {encM : M ↪ List Bool} {setup : ℕ → ProbComp D} {valid : ℕ → D → M → Bool} {modulus : D → ℕ} {H : ℕ → (d : D) → K d → M → ZMod (modulus d)} (hH : IsComputationalDUF encD encM setup valid H fun (d : D) => Turing.MultiTapeTM.encZMod (modulus d)) :
IsComputationalUHF encD encM setup valid H

Computational difference unpredictability over canonically encoded residues implies computational universal hashing. This is the asymptotic form of the zero-prediction reduction in [BS23], v0.6, §7.4, p. 269. The certified predictor writes the encoding of integer zero, which is the same at every modulus.