liminal_ark_poseidon/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2
3/// Circuit field reexported from `ark_bls12_381`.
4pub use ark_bls12_381::Fr;
5/// Numeric type reexported from `ark_ff`.
6pub use ark_ff::biginteger::BigInteger256;
7
8/// Circuit counterparts to the methods in [hash] module. Available only under `circuit` feature.
9#[cfg(feature = "circuit")]
10pub mod circuit;
11/// Hashing raw field elements.
12pub mod hash;
13mod parameters;
14
15/// Poseidon paper suggests using domain separation for concretely encoding the use case in the
16/// capacity element (which is fine as it is 256 bits large and has a lot of bits to fill).
17pub const DOMAIN_SEPARATOR: u64 = 2137;
18
19/// Return [DOMAIN_SEPARATOR] as a field element.
20pub fn domain_separator() -> Fr {
21 DOMAIN_SEPARATOR.into()
22}