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(data: &[u8]) -> T
[src]
fn hash2(a: &T, b: &T) -> T
[src]
fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
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>
[src]
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>,
[src]
cs: CS,
a: &AllocatedNum<Bls12>,
b: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
Provided methods
fn hash_md(input: &[T]) -> T
[src]
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]
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>
[src]
_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>
[src]
_cs: CS,
_left: &[Boolean],
_right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
Implementors
impl HashFunction<Blake2sDomain> for Blake2sFunction
[src]
impl HashFunction<Blake2sDomain> for Blake2sFunction
[src]fn hash(data: &[u8]) -> Blake2sDomain
[src]
fn hash2(a: &Blake2sDomain, b: &Blake2sDomain) -> Blake2sDomain
[src]
fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash2_circuit<CS>(
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
impl HashFunction<PoseidonDomain> for PoseidonFunction
[src]
impl HashFunction<PoseidonDomain> for PoseidonFunction
[src]fn hash(data: &[u8]) -> PoseidonDomain
[src]
fn hash2(a: &PoseidonDomain, b: &PoseidonDomain) -> PoseidonDomain
[src]
fn hash_md(input: &[PoseidonDomain]) -> PoseidonDomain
[src]
fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &AllocatedNum<Bls12>,
right: &AllocatedNum<Bls12>,
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
left: &AllocatedNum<Bls12>,
right: &AllocatedNum<Bls12>,
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
leaves: &[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>
[src]
cs: &mut CS,
elements: &[AllocatedNum<Bls12>]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_circuit<CS: ConstraintSystem<Bls12>>(
_cs: CS,
_bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
_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>,
[src]
cs: CS,
a: &AllocatedNum<Bls12>,
b: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
impl HashFunction<Sha256Domain> for Sha256Function
[src]
impl HashFunction<Sha256Domain> for Sha256Function
[src]fn hash(data: &[u8]) -> Sha256Domain
[src]
fn hash2(a: &Sha256Domain, b: &Sha256Domain) -> Sha256Domain
[src]
fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
leaves: &[AllocatedNum<Bls12>],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
left: &[Boolean],
right: &[Boolean],
_height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash_circuit<CS: ConstraintSystem<Bls12>>(
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]
cs: CS,
bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
fn hash2_circuit<CS>(
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,
[src]
cs: CS,
a_num: &AllocatedNum<Bls12>,
b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
CS: ConstraintSystem<Bls12>,