pub struct VectorCommitmentBranchNode {
pub prefix: Vec<usize>,
pub children: [Option<VectorCommitmentNode>; 64],
pub commitment: Option<Vec<u8>>,
pub size: BigUint,
pub leaf_count: usize,
pub longest_branch: usize,
}Expand description
Branch node with 64 children
Fields§
§prefix: Vec<usize>Prefix bits for this branch (path from root)
children: [Option<VectorCommitmentNode>; 64]Children nodes (64-way branching)
commitment: Option<Vec<u8>>Cached commitment
size: BigUintTotal size of all children
leaf_count: usizeNumber of leaf nodes under this branch
longest_branch: usizeLength of longest branch path
Implementations§
Source§impl VectorCommitmentBranchNode
impl VectorCommitmentBranchNode
Sourcepub fn get_polynomial(&mut self) -> Vec<u8> ⓘ
pub fn get_polynomial(&mut self) -> Vec<u8> ⓘ
Get the polynomial data for this branch (64 × 64 bytes) This is the same data used for commitment, but returned for proof generation
Sourcepub fn prove(&mut self, index: usize) -> Option<Vec<u8>>
pub fn prove(&mut self, index: usize) -> Option<Vec<u8>>
Generate a KZG proof for a specific child index Returns the proof bytes that can be used to verify the child commitment
Sourcepub fn set_child(&mut self, index: usize, child: VectorCommitmentNode)
pub fn set_child(&mut self, index: usize, child: VectorCommitmentNode)
Set a child at the given index
Sourcepub fn get_child(&self, index: usize) -> Option<&VectorCommitmentNode>
pub fn get_child(&self, index: usize) -> Option<&VectorCommitmentNode>
Get a child at the given index
Sourcepub fn get_child_mut(
&mut self,
index: usize,
) -> Option<&mut VectorCommitmentNode>
pub fn get_child_mut( &mut self, index: usize, ) -> Option<&mut VectorCommitmentNode>
Get a mutable child at the given index
pub fn commit(&mut self, recalculate: bool) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for VectorCommitmentBranchNode
impl Clone for VectorCommitmentBranchNode
Source§fn clone(&self) -> VectorCommitmentBranchNode
fn clone(&self) -> VectorCommitmentBranchNode
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VectorCommitmentBranchNode
impl RefUnwindSafe for VectorCommitmentBranchNode
impl Send for VectorCommitmentBranchNode
impl Sync for VectorCommitmentBranchNode
impl Unpin for VectorCommitmentBranchNode
impl UnwindSafe for VectorCommitmentBranchNode
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)