Struct Blake3
pub struct Blake3 { /* private fields */ }Expand description
Streaming BLAKE3 hasher / XOF.
Feed input with update; finalize with
finalize (32 bytes) or
finalize_xof (arbitrary length). BLAKE3 spec
§2.3.
Implementations§
§impl Blake3
impl Blake3
pub fn new_keyed(key: &[u8; 32]) -> Blake3
pub fn new_keyed(key: &[u8; 32]) -> Blake3
Keyed BLAKE3 (keyed_hash) — a PRF / MAC over a 32-byte key.
The key replaces the IV as the chaining state. BLAKE3 spec §2.1.
pub fn new_derive_key(context: &str) -> Blake3
pub fn new_derive_key(context: &str) -> Blake3
derive_key KDF context phase. The context string is hashed under
the DERIVE_KEY_CONTEXT flag; the resulting 32-byte value becomes
the key for the DERIVE_KEY_MATERIAL phase (fed via update).
BLAKE3 spec §2.1 / §5.
pub fn finalize_xof(&self, seek: u64, out: &mut [u8])
pub fn finalize_xof(&self, seek: u64, out: &mut [u8])
Write out.len() bytes of XOF output starting at byte offset
seek. Each root re-compression yields one 64-byte output block; a
seek that does not fall on a block boundary is handled by skipping
the leading bytes of the first block. BLAKE3 spec §2.3.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Blake3
impl RefUnwindSafe for Blake3
impl Send for Blake3
impl Sync for Blake3
impl Unpin for Blake3
impl UnsafeUnpin for Blake3
impl UnwindSafe for Blake3
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Hasher for Twhere
T: Digest,
impl<T> Hasher for Twhere
T: Digest,
Source§const OUTPUT_LEN: usize = const OUTPUT_LEN: usize = <T as tessera::Digest>::OUTPUT_LEN;
const OUTPUT_LEN: usize = const OUTPUT_LEN: usize = <T as tessera::Digest>::OUTPUT_LEN;
Output size in bytes.
Source§const BLOCK_LEN: usize = const BLOCK_LEN: usize = <T as tessera::Digest>::BLOCK_LEN;
const BLOCK_LEN: usize = const BLOCK_LEN: usize = <T as tessera::Digest>::BLOCK_LEN;
Block size in bytes (for HMAC computation).
Source§fn finalize_into(self, out: &mut [u8])
fn finalize_into(self, out: &mut [u8])
Finalize into a caller-provided buffer (no allocation).