pub struct CVStack { /* private fields */ }Expand description
Efficient chaining value stack for Blake3 hash computation as described in section 5.1.2 of the Blake3 paper.
Implementations§
Source§impl CVStack
impl CVStack
Sourcepub fn add_chunk_chaining_value(
&mut self,
new_cv: ChainingValue,
is_last_chunk: bool,
)
pub fn add_chunk_chaining_value( &mut self, new_cv: ChainingValue, is_last_chunk: bool, )
Add a new chunk chaining value to the stack.
§Parameters
new_cv: The chaining value of the chunk to add.is_last_chunk: Whether this is the last chunk in the input.
Sourcepub fn finalize(&mut self) -> [u8; 32]
pub fn finalize(&mut self) -> [u8; 32]
Finalize the stack and compute the root hash.
This should only be called after all chunks have been added.
Sourcepub fn total_chunks(&self) -> u64
pub fn total_chunks(&self) -> u64
Get the number of chunks processed so far.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CVStack
impl RefUnwindSafe for CVStack
impl Send for CVStack
impl Sync for CVStack
impl Unpin for CVStack
impl UnwindSafe for CVStack
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