pub struct ParallelHash128 { /* private fields */ }Expand description
ParallelHash128 configured with a block size and customization string.
A small convenience wrapper over parallel_hash128 /
parallel_hash128_xof holding the parameters that stay fixed across calls.
Implementations§
Source§impl ParallelHash128
impl ParallelHash128
Sourcepub fn new(block_size: usize, customization: &[u8]) -> Result<Self, CryptoError>
pub fn new(block_size: usize, customization: &[u8]) -> Result<Self, CryptoError>
Create a ParallelHash128 with the given block_size (bytes) and
customization string S.
§Errors
Returns CryptoError::BadInput if block_size is 0.
Sourcepub fn hash(&self, data: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
pub fn hash(&self, data: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
Hash data with fixed output length out.len() bytes.
§Errors
Propagates errors from parallel_hash128.
Sourcepub fn hash_xof(&self, data: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
pub fn hash_xof(&self, data: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
Hash data in XOF mode, producing out.len() bytes.
§Errors
Propagates errors from parallel_hash128_xof.
Trait Implementations§
Source§impl Clone for ParallelHash128
impl Clone for ParallelHash128
Source§fn clone(&self) -> ParallelHash128
fn clone(&self) -> ParallelHash128
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§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 ParallelHash128
impl RefUnwindSafe for ParallelHash128
impl Send for ParallelHash128
impl Sync for ParallelHash128
impl Unpin for ParallelHash128
impl UnsafeUnpin for ParallelHash128
impl UnwindSafe for ParallelHash128
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