Expand description
Common cryptographic procedures for a blockchain environment.
Note that
cryptois still0.*.*, so breaking changes may occur at any time. If you must depend oncrypto, we recommend pinning to a specific version, i.e.,=0.y.z.
§Verifying Merkle Proofs
merkle.rs provides:
- A
verifyfunction which can prove that some value is part of a Merkle tree. - A
verify_multi_prooffunction which can prove multiple values are part of a Merkle tree.
Re-exports§
pub use keccak::KeccakBuilder;
Modules§
- arithmetic
- This module provides a generic interface, constant functions and common arithmetics for big integers.
- bits
- Bit manipulation utilities.
- curve
- This module provides common operations to work with elliptic curves.
- eddsa
- This module contains an ed25519 signature implementation (EDDSA), that includes key derivation, signing, and signature verification.
- field
- This module provides common arithmetics to work with finite fields.
Implementations of some used fields provided in the
instancemodule. - hash
- Generic hashing support.
- keccak
- An interface to the default hashing algorithm used in this library’s merkle proofs.
- merkle
- This module deals with verification of Merkle Tree proofs.
- pedersen
- This module contains Pedersen Hash Function implementation.
- poseidon2
- This module contains the Poseidon hash (whitepaper) function implemented as a Sponge Function.
Macros§
- const_
for - Allows
forloops in constant context. - const_
for_ unroll2 - Allows
forloop in constant context, with 2 stages loop unroll optimization. - const_
for_ unroll4 - Allows
forloop in constant context, with 4 stages loop unroll optimization. - const_
for_ unroll6 - Allows
forloop in constant context, with 6 stages loop unroll optimization. - const_
for_ unroll8 - Allows
forloop in constant context, with 8 stages loop unroll optimization. - const_
rev_ for - Allows reversed
forloop in constant context. - const_
rev_ for_ unroll6 - Allows reversed
forloop in constant context, with 6 stages loop unroll optimization. - cycle
- Single cycle step in the loop.
- fp_
from_ hex - This macro converts a string hex number to a field element.
- fp_
from_ num - This macro converts a string base-10 number to a field element.
- from_
hex - This macro converts a string hex number to a big integer.
- from_
num - This macro converts a string base-10 number to a big integer.
- impl_
additive_ ops_ from_ ref - Implements additive operations by deferring to an implementation on &Self.
- rev_
cycle - Single cycle step back in the loop.