Liminal Arkworks Poseidon

This package contains two crates: a library exposing arkworks-based Poseidon hashing and a binary for regenerating parameters. Parameters are generated using https://github.com/penumbra-zone/poseidon377.

Library usage

The lib crate liminal-ark-poseidon provides two modules: - hash module that exposes <x>_to_one_hash method family for hashing raw field elements - circuit module that exposes <x>_to_one_hash method family for hashing circuit field elements; it is available only under circuit feature flag

Currently, <x> is one, two and four, i.e. we support 1:1, 2:1 and 4:1 hashing.

Example usage: ```rust fn hashoutsidecircuit(left: Fr, right: Fr) -> Fr { liminalarkposeidon::hash::twotoone_hash([left, right]) }

fn hashincircuit( cs: ConstraintSystemRef, left: FpVar, right: FpVar, ) -> Result, SynthesisError> { liminalarkposeidon::circuit::twotoone_hash(cs, [left, right]) } ```

Binary usage

If you need fresh parameters, you can regenerate parameters module by running: shell cargo run --release --features paramgen

You can also manipulate security level with SECURITY_LEVEL env variable.