Index Mathematics Conjectures nbv lettuce Widgets

poseidon_milli

stdlib/milli/poseidon/poseidon_milli.nbv only in the milli field

poseidon_milli(let input, static INPUT_LEN, static OUTPUT_LEN, static ALPHA, static N_ROUNDS_F, static N_ROUNDS_P, static MDS_MATRIX, static ROUND_CONSTANTS)

No description.

Calls
calloc, milli/poseidon/poseidon_milli_state, slice_from_start
Precompiles
assert_eq!, clone!, concat!, len!, println!, wtns!
Used by
milli/poseidon/poseidon_milli_16_1, milli/poseidon/poseidon_milli_16_16, milli/poseidon/poseidon_milli_32_16

Source

(
  let input,
  static INPUT_LEN,
  static OUTPUT_LEN,
  static ALPHA,
  static N_ROUNDS_F,
  static N_ROUNDS_P,
  static MDS_MATRIX,
  static ROUND_CONSTANTS
)

static T = INPUT_LEN + OUTPUT_LEN
assert_eq! T * T, len! MDS_MATRIX
assert_eq! T * (N_ROUNDS_F + N_ROUNDS_P), len! ROUND_CONSTANTS

# TODO: assert field cardinality using negone

let input = wtns! input
static input_len = len! input

println! "input_len = ", INPUT_LEN, "| output_len = ", OUTPUT_LEN, "| input = ", clone! input

# initialize state vector
let state = concat! calloc(OUTPUT_LEN), input, calloc(INPUT_LEN - input_len)

# run the permutation
let state = poseidon_milli_state(state, INPUT_LEN, OUTPUT_LEN, ALPHA, N_ROUNDS_F, N_ROUNDS_P, MDS_MATRIX, ROUND_CONSTANTS)

# take the output elements
slice_from_start(state, OUTPUT_LEN)