Expand description
Cryptographic utilities for input preparation
Provides Poseidon2 hashing and key derivation functions matching the Circom circuit implementations.
Constants§
- BN256_
MOD_ BYTES - BN256 modulus as Big Endian bytes
- ZERO_
LEAF_ BYTES - Zero leaf value as Big Endian bytes
Functions§
- bn256_
modulus - Returns BN256 modulus as Big Endian bytes
- compute_
commitment - Compute commitment: hash(amount, publicKey, blinding)
- compute_
nullifier - Compute nullifier: hash(commitment, pathIndices, signature)
- compute_
signature - Compute signature: hash(privateKey, commitment, merklePath)
- derive_
public_ key - Derive public key from private key
- derive_
public_ key_ hex - Derive public key and return as hex string (for JS BigInt)
- poseidon2_
compression_ wasm - Poseidon2 hash with 2 inputs as compression mode
- poseidon2_
hash2 - Poseidon2 hash with 2 inputs and domain separation
- zero_
leaf - Returns Zero leaf used in merkle trees as Big Endian bytes