pub struct PoseidonHashTree<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> { /* private fields */ }Implementations§
Source§impl<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> PoseidonHashTree<'a, E>
impl<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> PoseidonHashTree<'a, E>
pub fn new( root: AllocatedNum<E>, height: usize, bits_per_level: usize, params: &'a E::Params, zero: AllocatedNum<E>, ) -> Self
pub fn calculate_swaps<CS: ConstraintSystem<E>>( &self, cs: CS, path_bits_slice: &[Boolean], ) -> Result<Vec<Boolean>, SynthesisError>
Trait Implementations§
Source§impl<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> MerkleTree<E> for PoseidonHashTree<'a, E>
impl<'a, E: PoseidonEngine<SBox = QuinticSBox<E>>> MerkleTree<E> for PoseidonHashTree<'a, E>
type Hash = AllocatedNum<E>
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>
Auto Trait Implementations§
impl<'a, E> Freeze for PoseidonHashTree<'a, E>
impl<'a, E> RefUnwindSafe for PoseidonHashTree<'a, E>
impl<'a, E> Send for PoseidonHashTree<'a, E>
impl<'a, E> Sync for PoseidonHashTree<'a, E>
impl<'a, E> Unpin for PoseidonHashTree<'a, E>
impl<'a, E> UnwindSafe for PoseidonHashTree<'a, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more