Documentation

CslibFrontier.Crypto.Primitives.SDitH.ExpandSeed

SDitH seed expansion #

For Categories I and V, SDitH v3 expands one seed into its two GGM-tree children by encrypting two domain-separated plaintexts under that seed. The plaintexts use the even and odd 24-bit tweaks 2 * idx and 2 * idx + 1, respectively, with the seed-expansion tag set to true.

This module formalizes only the two-call ExpandSeed procedure. The modified block cipher Enc* is an explicit function parameter: this layer neither instantiates AES or Rijndael nor asserts a pseudorandomness or ideal-cipher property. It does not build the full GGM tree, CommitSeed, the one-tree BAVC, or the SDitH protocol.

The specification passage attributes this procedure only to Categories I and V. The generalized primitive-parametric API also accommodates the reference implementation's 192-bit Category III path using truncated Rijndael-256-256, but that compatibility observation is not a Category III claim from the cited passage.

At the function level, expandSeed makes exactly two calls to encStar and materializes exactly two tweaked salts. This is not a native implementation or resource certificate. Later consumers must account for those calls, the full securityBits-bit plaintexts, retained program-description size, and all time, space, randomness, query, output, and reduction resources.

Main definitions #

Main results #

References #

def Cslib.Crypto.SDitH.expandSeedLeftTweak (idx : Fin (2 ^ 23)) :
Fin (2 ^ 24)

The even 24-bit tweak used for the left child of source node idx.

Restricting idx to 23 bits makes both source expressions 2 * idx and 2 * idx + 1 valid 24-bit tweaks without modular wraparound.

The odd 24-bit tweak used for the right child of source node idx.

@[simp]
theorem Cslib.Crypto.SDitH.expandSeedLeftTweak_val (idx : Fin (2 ^ 23)) :
↑(expandSeedLeftTweak idx) = 2 * ↑idx
@[simp]
theorem Cslib.Crypto.SDitH.expandSeedRightTweak_val (idx : Fin (2 ^ 23)) :
↑(expandSeedRightTweak idx) = 2 * ↑idx + 1

The source's even and odd child tweaks are distinct.

def Cslib.Crypto.SDitH.expandSeed {securityBits : ℕ} (encStar : BitString securityBits → BitString securityBits → BitString securityBits) (variant : GrindingVariant) (salt seed : BitString securityBits) (idx : Fin (2 ^ 23)) :
BitString securityBits × BitString securityBits

SDitH v3 Section 3.2.2, ExpandSeed, stated by the source for Categories I and V.

The first encStar argument is the key/seed and the second is the plaintext. The explicit grinding variant selects Algorithm 5's high-bit layout for the calling parameter set. The primitive-parametric definition also fits the reference implementation's 192-bit Category III path using truncated Rijndael-256-256; that is an implementation compatibility observation, not a Category III attribution to this source passage.

@[simp]
theorem Cslib.Crypto.SDitH.expandSeed_fst {securityBits : ℕ} (encStar : BitString securityBits → BitString securityBits → BitString securityBits) (variant : GrindingVariant) (salt seed : BitString securityBits) (idx : Fin (2 ^ 23)) :
(expandSeed encStar variant salt seed idx).1 = encStar seed (tweakSalt variant salt (expandSeedLeftTweak idx) true)

The left output of expandSeed is the encryption at the even child tweak.

@[simp]
theorem Cslib.Crypto.SDitH.expandSeed_snd {securityBits : ℕ} (encStar : BitString securityBits → BitString securityBits → BitString securityBits) (variant : GrindingVariant) (salt seed : BitString securityBits) (idx : Fin (2 ^ 23)) :
(expandSeed encStar variant salt seed idx).2 = encStar seed (tweakSalt variant salt (expandSeedRightTweak idx) true)

The right output of expandSeed is the encryption at the odd child tweak.

theorem Cslib.Crypto.SDitH.expandSeed_plaintexts_ne (variant : GrindingVariant) {securityBits : ℕ} (hsecurity : 26 ≤ securityBits) (salt : BitString securityBits) (idx : Fin (2 ^ 23)) :

At widths where Algorithm 5's tweak and tag coordinates are disjoint, ExpandSeed supplies distinct plaintexts to its two block-cipher calls. This does not assert that the encrypted child seeds are distinct.