[][src]Trait sapling_crypto_ce::circuit::merkle::MerkleTree

pub trait MerkleTree<E: Engine> {
    type Hash;
    fn path_bits_per_level(&self) -> usize;
fn branching_factor(&self) -> usize;
fn hash_leaf<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        leaf: &[Boolean]
    ) -> Result<Self::Hash, SynthesisError>;
fn hash_node<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        children: &[Self::Hash],
        level: usize
    ) -> Result<Self::Hash, SynthesisError>;
fn check_inclusion<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        leaf: &[Boolean],
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Boolean, SynthesisError>;
fn check_inclusion_for_root<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        root: &Self::Hash,
        leaf: &[Boolean],
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Boolean, SynthesisError>;
fn check_hash_inclusion<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        hash: &Self::Hash,
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Boolean, SynthesisError>;
fn check_hash_inclusion_for_root<CS: ConstraintSystem<E>>(
        &self,
        cs: CS,
        root: &Self::Hash,
        hash: &Self::Hash,
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Boolean, SynthesisError>;
fn update<CS: ConstraintSystem<E>>(
        &mut self,
        cs: CS,
        leaf: &[Boolean],
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Self::Hash, SynthesisError>;
fn update_from_hash<CS: ConstraintSystem<E>>(
        &mut self,
        cs: CS,
        hash: &Self::Hash,
        path: &[Boolean],
        witness: &[Self::Hash]
    ) -> Result<Self::Hash, SynthesisError>;
fn update_intersect<CS: ConstraintSystem<E>>(
        &mut self,
        cs: CS,
        leafs: (&[Boolean], &[Boolean]),
        paths: (&[Boolean], &[Boolean]),
        witnesses: (&[Self::Hash], &[Self::Hash])
    ) -> Result<Self::Hash, SynthesisError>;
fn update_from_hash_intersect<CS: ConstraintSystem<E>>(
        &mut self,
        cs: CS,
        leafs: (&Self::Hash, &Self::Hash),
        paths: (&[Boolean], &[Boolean]),
        witnesses: (&[Self::Hash], &[Self::Hash])
    ) -> Result<Self::Hash, SynthesisError>; }

Associated Types

type Hash

Loading content...

Required methods

fn path_bits_per_level(&self) -> usize

fn branching_factor(&self) -> usize

fn hash_leaf<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    leaf: &[Boolean]
) -> Result<Self::Hash, SynthesisError>

fn hash_node<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    children: &[Self::Hash],
    level: usize
) -> Result<Self::Hash, SynthesisError>

fn check_inclusion<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    leaf: &[Boolean],
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Boolean, SynthesisError>

fn check_inclusion_for_root<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    root: &Self::Hash,
    leaf: &[Boolean],
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Boolean, SynthesisError>

fn check_hash_inclusion<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    hash: &Self::Hash,
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Boolean, SynthesisError>

fn check_hash_inclusion_for_root<CS: ConstraintSystem<E>>(
    &self,
    cs: CS,
    root: &Self::Hash,
    hash: &Self::Hash,
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Boolean, SynthesisError>

fn update<CS: ConstraintSystem<E>>(
    &mut self,
    cs: CS,
    leaf: &[Boolean],
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Self::Hash, SynthesisError>

fn update_from_hash<CS: ConstraintSystem<E>>(
    &mut self,
    cs: CS,
    hash: &Self::Hash,
    path: &[Boolean],
    witness: &[Self::Hash]
) -> Result<Self::Hash, SynthesisError>

fn update_intersect<CS: ConstraintSystem<E>>(
    &mut self,
    cs: CS,
    leafs: (&[Boolean], &[Boolean]),
    paths: (&[Boolean], &[Boolean]),
    witnesses: (&[Self::Hash], &[Self::Hash])
) -> Result<Self::Hash, SynthesisError>

fn update_from_hash_intersect<CS: ConstraintSystem<E>>(
    &mut self,
    cs: CS,
    leafs: (&Self::Hash, &Self::Hash),
    paths: (&[Boolean], &[Boolean]),
    witnesses: (&[Self::Hash], &[Self::Hash])
) -> Result<Self::Hash, SynthesisError>

Loading content...

Implementors

impl<'a, E: JubjubEngine> MerkleTree<E> for PedersenHashTree<'a, E>[src]

type Hash = AllocatedNum<E>

impl<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> MerkleTree<E> for PoseidonHashTree<'a, E>[src]

type Hash = AllocatedNum<E>

Loading content...