crypto dn added

This commit is contained in:
Rostyslav Tyshko 2025-03-16 11:05:08 -04:00
parent 75e5652bf6
commit c5a9c81642
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,11 @@
use light_poseidon::{Poseidon, PoseidonBytesHasher, parameters::bn254_x5};
use ark_bn254::Fr;
use ark_ff::{BigInteger, PrimeField};
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)
}

View File

@ -1,3 +1,4 @@
pub mod proofs_circuits;
pub mod transaction_payloads_tools;
pub mod utxo_manipulator;
pub mod cryptography;