Expand description
Rainbow — Jintai Ding & Dieter Schmidt’s multilayer Oil-and-Vinegar signature (ACNS 2005),
the multivariate scheme our XL engine is built to attack. This is a faithful reference over
GF(2^8): a two-layer central map F, invertible affine transforms S and T, public key
P = S ∘ F ∘ T, and the Oil-and-Vinegar trapdoor that inverts F at signing time.
The public map is produced as xl::Poly<Gf256> per output, so forge_system hands it
straight to crate::xl::xl_solve — the algebraic cryptanalysis Ding formalized through the
degree of regularity — closing the build-and-break loop on one substrate. All finite-field
linear algebra reuses the exhaustively-verified logicaffeine_base::gf256.
Field note: this reference works over the logicaffeine_base::gf256 field (reduction
polynomial 0x11d). The NIST submission fixes its own GF(256) tower representation; matching
that byte-for-byte is the separate bit-exact-vs-KAT effort.
Structs§
- Keygen
Inputs - Inputs for the LOGOS
rainbowKeygen(the public-map compositionP = S∘F∘T): the FORWARD affine mapsT/S(recovered by inverting the stored inverses) and the central map, all row-major / packed likeflatten_public. - Public
Key - Rainbow
Params - Rainbow layer sizes:
v1vinegars, theno1first-layer oils, theno2second-layer oils. - Secret
Flat - The secret key flattened for the LOGOS
rainbowSign: the central map in the same per-output layout asflatten_public, plus the affine inversesS⁻¹/T⁻¹(row-major) and their shifts. - Secret
Key
Functions§
- flatten_
keygen - flatten_
public - Flatten the public key into three byte arrays for a coefficient-driven verifier:
pubqholds the upper-triangular quadratic coefficients per output (orderi ≤ j),publinthe linear coefficients,pubcthe constants. This is the exact layout the LOGOSrainbowVerifyconsumes. - flatten_
secret - forge_
system - The MQ system a forger must solve —
P_k(x) − d_k = 0for every output — handed straight tocrate::xl::xl_solve. A solution is a signature forgery produced with NO secret key. - keygen
- sign
- Sign a message hash (
mfield elements). Returns the signaturex ∈ GF(256)^n, orNoneif the Oil-and-Vinegar inversion kept hitting singular systems (astronomically unlikely). - sign_
with_ vinegars - Sign with the
v1vinegar values supplied explicitly (deterministic;Noneif they make a layer’s linear system singular). This is the exact core the LOGOSrainbowSignmirrors. - verify
- Verify a signature: evaluate every public polynomial at
xand compare to the message hash.