GHASH, the GCM authenticator (NIST SP 800-38D §6.4) #
Blocks are read as big-endian 128-bit integers. GCM numbers bits from the most significant end,
so the coefficient of x⁰ is the integer's top bit and multiplying by x is a right shift,
reduced by R = 0xE1 ‖ 0¹²⁰.
Equations
- Cryptlib.Primitives.Cipher.GHash.R = 225 <<< 120
Instances For
Equations
- Cryptlib.Primitives.Cipher.GHash.ofBytes b = Array.foldl (fun (acc : Nat) (x : UInt8) => acc <<< 8 ||| x.toNat) 0 b
Instances For
Equations
- Cryptlib.Primitives.Cipher.GHash.toBytes n = Vector.ofFn fun (i : Fin 16) => UInt8.ofNat (n >>> (8 * (15 - ↑i)))
Instances For
SP 800-38D Algorithm 1, X • Y in GF(2¹²⁸).
Equations
- One or more equations did not get rendered due to their size.