lssa/sc_core/src/cryptography.rs
2025-06-26 07:21:31 +03:00

11 lines
270 B
Rust

use ark_bn254::Fr;
use light_poseidon::{Poseidon, PoseidonBytesHasher};
pub fn poseidon_hash(inputs: &[&[u8]]) -> anyhow::Result<[u8; 32]> {
let mut poseidon = Poseidon::<Fr>::new_circom(2).unwrap();
let hash = poseidon.hash_bytes_be(inputs)?;
Ok(hash)
}