R1CS Poseidon2 compress gadget over BLS12-381 Fr.
This crate matches:
poseidon2-evm-bls12-381- gnark-crypto
fr/poseidon2with(t=2, rF=8, rP=56)and feed-forward output
It is compress-only and keeps constants in source.
compress(left, right) -> Scalar: native reference computation.gadget::compress_allocated(cs, left, right) -> AllocatedNum<Scalar>: R1CS gadget.
This crate is gadget-centric. A test-only circuit wrapper lives in
tests/compress_vectors.rs to run vector conformance checks.
Vector fixtures are committed in-repo at tests/vectors.json.
Run tests:
cargo test