Trait filecoin_hashers::HashFunction[][src]

pub trait HashFunction<T: Domain>: Clone + Debug + Send + Sync + LightAlgorithm<T> {
    fn hash(data: &[u8]) -> T;
fn hash2(a: &T, b: &T) -> T;
fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: ConstraintSystem<Bls12>>(
        cs: CS,
        leaves: &[AllocatedNum<Bls12>],
        height: usize
    ) -> Result<AllocatedNum<Bls12>, SynthesisError>;
fn hash_circuit<CS: ConstraintSystem<Bls12>>(
        cs: CS,
        bits: &[Boolean]
    ) -> Result<AllocatedNum<Bls12>, SynthesisError>;
fn hash2_circuit<CS>(
        cs: CS,
        a: &AllocatedNum<Bls12>,
        b: &AllocatedNum<Bls12>
    ) -> Result<AllocatedNum<Bls12>, SynthesisError>
    where
        CS: ConstraintSystem<Bls12>
; fn hash_md(input: &[T]) -> T { ... }
fn hash_leaf(data: &dyn LightHashable<Self>) -> T { ... }
fn hash_single_node(data: &dyn LightHashable<Self>) -> T { ... }
fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
        cs: CS,
        left: &AllocatedNum<Bls12>,
        right: &AllocatedNum<Bls12>,
        height: usize
    ) -> Result<AllocatedNum<Bls12>, SynthesisError> { ... }
fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
        _cs: &mut CS,
        _elements: &[AllocatedNum<Bls12>]
    ) -> Result<AllocatedNum<Bls12>, SynthesisError> { ... }
fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
        _cs: CS,
        _left: &[Boolean],
        _right: &[Boolean],
        _height: usize
    ) -> Result<AllocatedNum<Bls12>, SynthesisError> { ... } }

Required methods

Provided methods

Implementors