Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.Cascade

The Boneh–Shoup cascade on words #

The cascade of [BS23], v0.6, Section 6.4.2, Figure 6.3b (printed pp. 226 and 229), starts at the secret key and evaluates the base function with the current state as its key and the next message block as its input. The input block width may differ from the key width.

The evaluator reads as many whole blocks as fit in the message at the width determined by the initial key length. It returns the initial key on an empty message. For a base function with outputs the size of its key, the same width applies throughout the evaluation. Its polynomial-time certificate uses that bound on intermediate states.

Main definitions #

Main results #

def Cslib.Crypto.cascadeFamily (inLen : ℕ → ℕ) (family : List Bool → List Bool → List Bool) (key msg : List Bool) :

Evaluate the key-chaining cascade on the full blocks of msg, using inLen key.length bits per block. When this width is zero the fold processes no blocks.

theorem Cslib.Crypto.length_cascadeFamily {inLen : ℕ → ℕ} {family : List Bool → List Bool → List Bool} (hlen : ∀ (key block : List Bool), block.length = inLen key.length → (family key block).length = key.length) (key msg : List Bool) :
(cascadeFamily inLen family key msg).length = key.length

A base function with outputs in its key space gives cascade outputs of the same key width.

@[simp]
theorem Cslib.Crypto.cascadeFamily_nil (inLen : ℕ → ℕ) (family : List Bool → List Bool → List Bool) (key : List Bool) :
cascadeFamily inLen family key [] = key

The empty message returns the initial key.

theorem Cslib.Crypto.cascadeFamily_append {inLen : ℕ → ℕ} {family : List Bool → List Bool → List Bool} (hlen : ∀ (key block : List Bool), block.length = inLen key.length → (family key block).length = key.length) (key : List Bool) {msg suffix : List Bool} (hwidth : 0 < inLen key.length) (hmsg : inLen key.length ∣ msg.length) (hsuffix : inLen key.length ∣ suffix.length) :
cascadeFamily inLen family key (msg ++ suffix) = cascadeFamily inLen family (cascadeFamily inLen family key msg) suffix

On aligned words the tag of a prefix is the key for its suffix. This gives the cascade extension identity (6.16) of [BS23], v0.6, Section 6.4.3, printed p. 230.

Evaluate the cascade in polynomial time using the base function's fixed-width outputs on valid blocks to bound the accumulator.