Skip to main content

Module params

Module params 

Source
Expand description

Lighter Poseidon2 parameter set, defined verbatim from the Apache-2.0 Go reference implementation elliottech/poseidon_crypto at the pinned revision recorded in the fixture metadata. Each round constant, the diagonal of the internal MDS matrix, and the round counts must agree byte-for-byte with that reference; the fixture vectors under test_data/ verify equivalence.

  • State width t = 12, sponge rate r = 8 and capacity c = 4.
  • S-box exponent D = 7.
  • 8 full external rounds (split 4 + 4 around the partial rounds), 22 partial internal rounds.
  • Internal MDS matrix is M_I = diag(MATRIX_DIAG_12) + J_12 where J_12 is the all-ones matrix; the diagonal is taken from the Plonky3 Goldilocks parameter set the Lighter reference adopts.

Constantsยง

D
S-box exponent: x -> x^7. The S-box itself is hard-coded in the permutation for performance; this constant exists to make the full parameter set explicit alongside the round counts it pairs with.
EXTERNAL_CONSTANTS
Round constants applied at each external round (one row per round, one constant per state position).
INTERNAL_CONSTANTS
Round constants applied to state[0] at each partial (internal) round.
MATRIX_DIAG_12
Diagonal of the internal MDS matrix (the off-diagonal entries are all 1).
RATE
Sponge absorption rate (elements per absorbed block).
ROUNDS_F
Number of full (external) rounds.
ROUNDS_F_HALF
Half the number of full rounds, applied before and after the partial rounds.
ROUNDS_P
Number of partial (internal) rounds.
WIDTH
Sponge state width.