pub struct IncrementalVerifier { /* private fields */ }
Expand description
An incremental verifier that can consume a stream of proofs and content and verify the integrity of the content using a blake3 root hash.
Implementations§
Source§impl IncrementalVerifier
impl IncrementalVerifier
Sourcepub fn new(root_hash: [u8; 32], starting_block: usize) -> Self
pub fn new(root_hash: [u8; 32], starting_block: usize) -> Self
Create a new incremental verifier that verifies an stream of proofs and content against the provided root hash.
The starting_block
determines where the content stream will start from.
Sourcepub fn verify_hash(
&mut self,
hash: &[u8; 32],
) -> Result<(), IncrementalVerifierError>
pub fn verify_hash( &mut self, hash: &[u8; 32], ) -> Result<(), IncrementalVerifierError>
Verify the new block of data only by providing its hash, you should be aware of what mode you have finalized the block at.
Sourcepub fn verify(
&mut self,
block: BlockHasher,
) -> Result<(), IncrementalVerifierError>
pub fn verify( &mut self, block: BlockHasher, ) -> Result<(), IncrementalVerifierError>
Verify the new block.
Sourcepub fn feed_proof(
&mut self,
proof: &[u8],
) -> Result<(), IncrementalVerifierError>
pub fn feed_proof( &mut self, proof: &[u8], ) -> Result<(), IncrementalVerifierError>
Feed some new proof to the verifier which it can use to expand its internal blake3 tree.
Trait Implementations§
Source§impl Drop for IncrementalVerifier
impl Drop for IncrementalVerifier
impl Send for IncrementalVerifier
Auto Trait Implementations§
impl Freeze for IncrementalVerifier
impl RefUnwindSafe for IncrementalVerifier
impl !Sync for IncrementalVerifier
impl Unpin for IncrementalVerifier
impl UnwindSafe for IncrementalVerifier
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