Documentation

CslibFrontier.Crypto.Protocols.UOV.BlockKey

Round-3 UOV block public keys and signing linearization #

In Version 3.0 of the UOV specification ([BCD+26], §3.1, pp. 11–13, and §3.2.3 / Figure 2, pp. 14–17), the secret oil subspace is the column space of the (v + m) × m block matrix [O; Iₘ] for O ∈ R^{v × m}, and each of the m homogeneous public polynomials is represented by an upper-triangular (v + m) × (v + m) block matrix

Pᵢ = [[Pᵢ⁽¹⁾, Pᵢ⁽²⁾],
      [0,     Pᵢ⁽³⁾]]

with upper-triangular Pᵢ⁽¹⁾ and Pᵢ⁽³⁾ = Upper(-Oᵀ Pᵢ⁽¹⁾ O - Oᵀ Pᵢ⁽²⁾). Because Upper(M) - M induces an alternating bilinear form in every characteristic (Matrix.isAlt_toLinearMap₂'_upperQuadratic_sub), the restricted matrix [Oᵀ Iₘ] Pᵢ [O; Iₘ] = Oᵀ Pᵢ⁽¹⁾ O + Oᵀ Pᵢ⁽²⁾ + Pᵢ⁽³⁾ induces an alternating bilinear form and therefore vanishes identically on the embedded oil subspace, including in characteristic two.

To invert the resulting public map P : R^{v + m} → R^m at target t given a vinegar vector u ∈ R^v, UOV forms the candidate preimage s = [u; 0] + [O; Iₘ] x, the vinegar evaluation yᵢ = uᵀ Pᵢ⁽¹⁾ u, the precomputed secret-key matrices Sᵢ = (Pᵢ⁽¹⁾ + Pᵢ⁽¹⁾ᵀ) O + Pᵢ⁽²⁾, and the m × m linear system matrix L whose i-th row is uᵀ Sᵢ. Reusing MultivariateQuadraticMap.map_add_of_mem and MultivariateQuadraticMap.polar_ofMatrices_apply yields the exact characteristic-independent linearization law

P(s)ᵢ = uᵀ Pᵢ⁽¹⁾ u + (uᵀ Sᵢ) x,

so P(s) = t if and only if L x = t - y.

The algebraic construction is parameterized over any commutative ring R and dimensions (v, m), instantiating directly at the Round-3 binary extension fields UOV.F16 and UOV.F256 from CslibFrontier.Crypto.Protocols.UOV.Field. Seed expansion (SHAKE256 / AES128-CTR), byte serialization, the 256-attempt counter loop, retry failure bounds, and ROM/QROM security reductions remain open under #4987.

Main definitions #

Main results #

References #

structure Cslib.Crypto.UOV.BlockKeyMaterial (R : Type u_2) [Zero R] (v m : ℕ) :
Type u_2

The expanded algebraic key matrices from which Round-3 UOV constructs its public key and signing matrices ([BCD+26], Figure 2, line 3, p. 16): the secret oil matrix O ∈ R^{v × m} together with upper-triangular vinegar-vinegar blocks P1 i ∈ R^{v × v} and vinegar-oil blocks P2 i ∈ R^{v × m}.

  • oilMatrix : Matrix (Fin v) (Fin m) R

    Secret oil-space generator O ∈ R^{v × m} defining the oil embedding x ↦ [O x; x].

  • vinegarBlock : Fin m → Matrix (Fin v) (Fin v) R

    Upper-left vinegar quadratic blocks Pᵢ⁽¹⁾ ∈ R^{v × v}.

  • mixedBlock : Fin m → Matrix (Fin v) (Fin m) R

    Upper-right mixed vinegar-oil blocks Pᵢ⁽²⁾ ∈ R^{v × m}.

  • isUpperTriangular_vinegarBlock (i : Fin m) : (self.vinegarBlock i).IsUpperTriangular

    Each expanded Pᵢ⁽¹⁾ block is upper triangular ([BCD+26], Figure 2, line 3, p. 16).

def Cslib.Crypto.UOV.vinegarEmbed {R : Type u_1} [CommRing R] {v m : ℕ} (u : Fin v → R) :
Fin (v + m) → R

Embed a vinegar vector u ∈ R^v as [u; 0] ∈ R^{v + m}.

def Cslib.Crypto.UOV.oilEmbed {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) :
(Fin m → R) →ₗ[R] Fin (v + m) → R

Linear map x ↦ [O x; x] parametrizing the Round-3 UOV oil subspace ([BCD+26], §3.1, p. 12).

theorem Cslib.Crypto.UOV.oilEmbed_apply {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (x : Fin m → R) :
(oilEmbed O) x = Fin.append (O.mulVec x) x

Explicit coordinate formula for oilEmbed O x.

theorem Cslib.Crypto.UOV.oilEmbed_injective {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) :

The oil-space parameterization x ↦ [O x; x] is injective because its last m coordinates recover x directly ([BCD+26], §3.1, p. 12).

def Cslib.Crypto.UOV.blockOilSubspace {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) :
Submodule R (Fin (v + m) → R)

The hidden oil subspace spanned by the columns of [O; Iₘ].

@[simp]
theorem Cslib.Crypto.UOV.mem_blockOilSubspace {R : Type u_1} [CommRing R] {v m : ℕ} {O : Matrix (Fin v) (Fin m) R} {z : Fin (v + m) → R} :
z ∈ blockOilSubspace O ↔ ∃ (x : Fin m → R), (oilEmbed O) x = z
theorem Cslib.Crypto.UOV.oilEmbed_mem_blockOilSubspace {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (x : Fin m → R) :

Every vector oilEmbed O x lies in blockOilSubspace O.

def Cslib.Crypto.UOV.signatureVector {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (u : Fin v → R) (x : Fin m → R) :
Fin (v + m) → R

Candidate UOV signature vector s = [u; 0] + [O; Iₘ] x = [u + O x; x] ([BCD+26], §3.1, p. 12).

theorem Cslib.Crypto.UOV.signatureVector_eq_append {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (u : Fin v → R) (x : Fin m → R) :

signatureVector O u x equals Fin.append (u + O *ᵥ x) x.

def Cslib.Crypto.UOV.oilBlock {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) :
Matrix (Fin m) (Fin m) R

The lower-right oil block Pᵢ⁽³⁾ = Upper(-Oᵀ Pᵢ⁽¹⁾ O - Oᵀ Pᵢ⁽²⁾) ([BCD+26], §3.1, p. 12, and Figure 2, line 5, p. 16).

theorem Cslib.Crypto.UOV.oilBlock_eq_of_charTwo {R : Type u_1} [CommRing R] {v m : ℕ} [CharP R 2] (O : Matrix (Fin v) (Fin m) R) (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) :
oilBlock O P1 P2 = (O.transpose * P1 * O + O.transpose * P2).upperQuadratic

In characteristic two, signs drop from oilBlock: Pᵢ⁽³⁾ = Upper(Oᵀ Pᵢ⁽¹⁾ O + Oᵀ Pᵢ⁽²⁾).

def Cslib.Crypto.UOV.blockMatrix {R : Type u_1} [CommRing R] {v m : ℕ} (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) (P3 : Matrix (Fin m) (Fin m) R) :
Matrix (Fin (v + m)) (Fin (v + m)) R

Assemble the (v + m) × (v + m) public polynomial matrix [[P1, P2], [0, P3]] indexed on Fin (v + m) via finSumFinEquiv ([BCD+26], §3.1, p. 12).

theorem Cslib.Crypto.UOV.isUpperTriangular_blockMatrix {R : Type u_1} [CommRing R] {v m : ℕ} {P1 : Matrix (Fin v) (Fin v) R} (P2 : Matrix (Fin v) (Fin m) R) {P3 : Matrix (Fin m) (Fin m) R} (hP1 : P1.IsUpperTriangular) (hP3 : P3.IsUpperTriangular) :

When P1 and P3 are upper triangular, the assembled (v + m) × (v + m) block matrix is upper triangular under the standard order on Fin (v + m).

theorem Cslib.Crypto.UOV.isAlt_oilRestriction {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) :

The restricted oil-space matrix Oᵀ P1 O + Oᵀ P2 + oilBlock O P1 P2 ([Oᵀ Iₘ] Pᵢ [O; Iₘ]) induces an alternating bilinear form in every characteristic ([BCD+26], §3.1, p. 12).

theorem Cslib.Crypto.UOV.eq_oilBlock_iff {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) {P3 : Matrix (Fin m) (Fin m) R} :

Uniqueness of the oil block Pᵢ⁽³⁾ ([BCD+26], §3.1, p. 12): an m × m matrix P3 is upper triangular and makes (blockMatrix P1 P2 P3).toQuadraticForm' vanish on blockOilSubspace O if and only if P3 = oilBlock O P1 P2.

def Cslib.Crypto.UOV.BlockKeyMaterial.publicMatrix {R : Type u_1} [CommRing R] {v m : ℕ} (key : BlockKeyMaterial R v m) (i : Fin m) :
Matrix (Fin (v + m)) (Fin (v + m)) R

i-th public polynomial matrix Pᵢ constructed from key.

Every key.publicMatrix i is upper triangular ([BCD+26], §3.1, p. 12, and Figure 2, lines 3–6, p. 16).

The Round-3 UOV public quadratic map P : R^{v + m} → R^m assembled from key.publicMatrix.

The constructed public quadratic map vanishes on the entire embedded oil subspace [O; Iₘ].

Signing linearization #

def Cslib.Crypto.UOV.linearizationMatrix {R : Type u_1} [CommRing R] {v m : ℕ} (O : Matrix (Fin v) (Fin m) R) (P1 : Matrix (Fin v) (Fin v) R) (P2 : Matrix (Fin v) (Fin m) R) :
Matrix (Fin v) (Fin m) R

Precomputed secret-key matrix Sᵢ = (Pᵢ⁽¹⁾ + Pᵢ⁽¹⁾ᵀ) O + Pᵢ⁽²⁾ ∈ R^{v × m} ([BCD+26], §3.1, p. 13, and UOV.ExpandSK, Figure 2, line 4, p. 16).

def Cslib.Crypto.UOV.vinegarEval {R : Type u_1} [CommRing R] {v m : ℕ} (P1 : Fin m → Matrix (Fin v) (Fin v) R) (u : Fin v → R) :
Fin m → R

Vinegar evaluation vector y ∈ R^m with yᵢ = uᵀ Pᵢ⁽¹⁾ u ([BCD+26], §3.1, p. 13).

@[simp]

key.publicMap evaluated at vinegarEmbed u = [u; 0] equals vinegarEval key.vinegarBlock u.

def Cslib.Crypto.UOV.signingMatrix {R : Type u_1} [CommRing R] {v m : ℕ} (S : Fin m → Matrix (Fin v) (Fin m) R) (u : Fin v → R) :
Matrix (Fin m) (Fin m) R

The m × m signing linear-system matrix L whose i-th row is uᵀ Sᵢ ([BCD+26], §3.1, p. 13).

@[simp]
theorem Cslib.Crypto.UOV.signingMatrix_mulVec_apply {R : Type u_1} [CommRing R] {v m : ℕ} (S : Fin m → Matrix (Fin v) (Fin m) R) (u : Fin v → R) (x : Fin m → R) (i : Fin m) :
def Cslib.Crypto.UOV.BlockKeyMaterial.signingSystemMatrix {R : Type u_1} [CommRing R] {v m : ℕ} (key : BlockKeyMaterial R v m) (u : Fin v → R) :
Matrix (Fin m) (Fin m) R

key's signing matrix L at vinegar vector u.

Polar evaluation between [u; 0] and [O x; x] equals (uᵀ Sᵢ) x, retaining the transpose contribution Pᵢ⁽¹⁾ᵀ O in every characteristic.

theorem Cslib.Crypto.UOV.BlockKeyMaterial.publicMap_signatureVector_apply {R : Type u_1} [CommRing R] {v m : ℕ} (key : BlockKeyMaterial R v m) (u : Fin v → R) (x : Fin m → R) (i : Fin m) :

UOV coordinate signing linearization ([BCD+26], §3.1, pp. 12–13): pᵢ([u; 0] + [O; Iₘ] x) = uᵀ Pᵢ⁽¹⁾ u + (uᵀ Sᵢ) x in every characteristic.

UOV vector signing linearization ([BCD+26], §3.1, p. 13): P([u; 0] + [O; Iₘ] x) = y + L x.

UOV signing linear-system equivalence ([BCD+26], §3.1, p. 13, and UOV.Sign / UOV.Verify, Figure 2, pp. 16–17): P([u; 0] + [O; Iₘ] x) = t if and only if L x = t - y.