2023-10-25 18:12:26 +02:00
|
|
|
|
|
|
|
|
-- | Poseidon2 hash function for the bn128 curve's scalar field and t=3.
|
|
|
|
|
|
|
|
|
|
module Poseidon2
|
|
|
|
|
( Fr
|
|
|
|
|
, sponge1 , sponge2
|
|
|
|
|
, calcMerkleRoot , calcMerkleTree
|
|
|
|
|
, MerkleTree(..) , depthOf , merkleRootOf
|
|
|
|
|
, MerkleProof(..) , extractMerkleProof , extractMerkleProof_ , reconstructMerkleRoot
|
2023-11-16 11:53:08 +01:00
|
|
|
, compressPair, keyedCompressPair
|
2023-10-25 18:12:26 +02:00
|
|
|
, permutation
|
|
|
|
|
)
|
|
|
|
|
where
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
import ZK.Algebra.Curves.BN128.Fr.Mont (Fr)
|
|
|
|
|
|
|
|
|
|
import Poseidon2.Sponge
|
|
|
|
|
import Poseidon2.Merkle
|
|
|
|
|
import Poseidon2.Permutation
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|