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
fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash2_circuit<CS>(
cs: CS,
a: &AllocatedNum<Bls12>,
b: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]Provided methods
fn hash_leaf(data: &dyn LightHashable<Self>) -> T
[src]fn hash_single_node(data: &dyn LightHashable<Self>) -> T
[src]fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &AllocatedNum<Bls12>,
right: &AllocatedNum<Bls12>,
height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
_cs: &mut CS,
_elements: &[AllocatedNum<Bls12>]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
_cs: CS,
_left: &[Boolean],
_right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]Implementors
fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash2_circuit<CS>(
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &AllocatedNum<Bls12>,
right: &AllocatedNum<Bls12>,
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
cs: &mut CS,
elements: &[AllocatedNum<Bls12>]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_circuit<CS: ConstraintSystem<Bls12>>(
_cs: CS,
_bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash2_circuit<CS>(
cs: CS,
a: &AllocatedNum<Bls12>,
b: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]fn hash2_circuit<CS>(
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]