mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-10 09:13:12 +00:00
crypto dn added
This commit is contained in:
parent
75e5652bf6
commit
c5a9c81642
11
sc_core/src/cryptography.rs
Normal file
11
sc_core/src/cryptography.rs
Normal 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)
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
pub mod proofs_circuits;
|
||||
pub mod transaction_payloads_tools;
|
||||
pub mod utxo_manipulator;
|
||||
pub mod cryptography;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user