Documentation

GaudisCrypt.Lib.EC.BitWordRing

Bit words: the algebra of +^ (EasyCrypt theories/datatypes/BitWord.eca) #

The lemmas xorw0, xorwA, xorwC, xorwK of EC's BitWord, what its algebra uses on words (EC: clone import Ring.BoolRing as WRing), and the uniform distribution's facts that the conditions of rnd ask for. Names are EasyCrypt's.

theorem GaudisCrypt.EC.BitWord.xorwE {n : ℤ} (w₁ w₂ : word n) (i : Fin n.toNat) :
List.Vector.get (w₁ +^ w₂) i = (List.Vector.get w₁ i ^^ List.Vector.get w₂ i)

lemma xorwE w1 w2 i: (w1 +^ w2).[i] = w1.[i] ^^ w2.[i].

@[simp]
theorem GaudisCrypt.EC.BitWord.xorw0 {n : ℤ} (w : word n) :
w +^ zerow = w

lemma xorw0: right_id zerow (+^).

theorem GaudisCrypt.EC.BitWord.xorwA {n : ℤ} (w₁ w₂ w₃ : word n) :
w₁ +^ (w₂ +^ w₃) = w₁ +^ w₂ +^ w₃

lemma xorwA: associative (+^).

theorem GaudisCrypt.EC.BitWord.xorwC {n : ℤ} (w₁ w₂ : word n) :
w₁ +^ w₂ = w₂ +^ w₁

lemma xorwC: commutative (+^).

@[simp]
theorem GaudisCrypt.EC.BitWord.xorwK {n : ℤ} (w : word n) :
w +^ w = zerow

lemma xorwK: forall x, x +^ x = zerow.

@[simp]
theorem GaudisCrypt.EC.BitWord.xor0w {n : ℤ} (w : word n) :
zerow +^ w = w

zerow is a left identity (EC: xorwC, xorw0).

@[simp]
theorem GaudisCrypt.EC.BitWord.xorwKr {n : ℤ} (w m : word n) :
w +^ m +^ m = w

Adding the same word twice cancels (EC's algebra).

@[simp]

dunifin charges every word (EC's dunifin_fu), for the conditions of rnd.

@[simp]

All words have the same probability (EC's dunifin_funi), as EC's rnd asks.