Crate openzeppelin_crypto

Crate openzeppelin_crypto 

Source
Expand description

Common cryptographic procedures for a blockchain environment.

Note that crypto is still 0.*.*, so breaking changes may occur at any time. If you must depend on crypto, we recommend pinning to a specific version, i.e., =0.y.z.

§Verifying Merkle Proofs

merkle.rs provides:

  • A verify function which can prove that some value is part of a Merkle tree.
  • A verify_multi_proof function 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 instance module.
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 for loops in constant context.
const_for_unroll2
Allows for loop in constant context, with 2 stages loop unroll optimization.
const_for_unroll4
Allows for loop in constant context, with 4 stages loop unroll optimization.
const_for_unroll6
Allows for loop in constant context, with 6 stages loop unroll optimization.
const_for_unroll8
Allows for loop in constant context, with 8 stages loop unroll optimization.
const_rev_for
Allows reversed for loop in constant context.
const_rev_for_unroll6
Allows reversed for loop 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.