-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
What problem does your feature solve?
Currently (upon merging #1 ), both Poseidon and Poseidon2 only support single-round absorption, meaning the number of inputs is limited to the rate (T - 1). For example, with T=4 (rate=3), you can only hash up to 3 field elements:
// T=4 means rate=3, so maximum 3 inputs
let inputs = vec![&env, a, b, c, d]; // 4 inputs - PANICS
let mut sponge = Poseidon2Sponge::<4, BnScalar>::new(&env);
let _ = sponge.compute_hash(&inputs);
This limits usability for hashing larger data structures or variable-length inputs.
What would you like to see?
Multi-round absorption that allows hashing arbitrary-length inputs by repeatedly absorbing and permuting inputs in chunks until all inputs are absorbed. Proper padding must be accounted for.
Current blocker: requires field addition operation for bn254 (bn254_fr_add), which isn't currently available but are planned for the next protocol version.
What alternatives are there?
- Use a larger state size (e.g., T=6 for Poseidon supports up to 5 inputs)
- Implement guest-side
bn254_fr_add
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels