pub struct Hasher { /* private fields */ }Expand description
An incremental hash under a profile. It is not Clone, and Debug names its algorithm only.
Implementations§
Source§impl Hasher
impl Hasher
Sourcepub fn new(a: &Admitted, h: HashAlgorithm) -> Result<Hasher, CryptoError>
pub fn new(a: &Admitted, h: HashAlgorithm) -> Result<Hasher, CryptoError>
A hasher for h. Refuses, in order, a hash a’s profile does not admit or its module line
lacks (Admitted::admit_hash) and one this backend does not implement
(CryptoError::Unavailable). Panics only if the module fails to initialise the digest
context.
Sourcepub fn algorithm(&self) -> HashAlgorithm
pub fn algorithm(&self) -> HashAlgorithm
The algorithm.
Sourcepub fn update(&mut self, data: &[u8])
pub fn update(&mut self, data: &[u8])
Feeds data. Panics only if the module’s digest context fails, or if the bytes fed in
total pass u64::MAX, where aws-lc-rs stops. A SHA-256 hasher fed 2^61 bytes or more, past
FIPS 180-4’s limit, then gives a non-conforming digest from finish: the module’s bit count
wraps silently.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hasher
impl RefUnwindSafe for Hasher
impl Send for Hasher
impl Sync for Hasher
impl Unpin for Hasher
impl UnsafeUnpin for Hasher
impl UnwindSafe for Hasher
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