pub enum HmacAlgorithm {
HmacSha3_256,
HmacSha3_512,
}Expand description
High-level HMAC selector
Variants§
Implementations§
Source§impl HmacAlgorithm
impl HmacAlgorithm
Sourcepub fn mac(&self, key: &[u8], data: &[u8]) -> PqcResult<Vec<u8>>
pub fn mac(&self, key: &[u8], data: &[u8]) -> PqcResult<Vec<u8>>
Compute HMAC of data
§Errors
Returns an error if the key has invalid length or HMAC computation fails
Sourcepub fn verify(&self, key: &[u8], data: &[u8], tag: &[u8]) -> PqcResult<()>
pub fn verify(&self, key: &[u8], data: &[u8], tag: &[u8]) -> PqcResult<()>
Verify HMAC tag (constant-time)
§Errors
Returns an error if verification fails or the tag is invalid
Sourcepub fn output_size(&self) -> usize
pub fn output_size(&self) -> usize
Get the output size in bytes
Trait Implementations§
Source§impl Clone for HmacAlgorithm
impl Clone for HmacAlgorithm
Source§fn clone(&self) -> HmacAlgorithm
fn clone(&self) -> HmacAlgorithm
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 moreimpl Copy for HmacAlgorithm
Source§impl Debug for HmacAlgorithm
impl Debug for HmacAlgorithm
impl Eq for HmacAlgorithm
Source§impl PartialEq for HmacAlgorithm
impl PartialEq for HmacAlgorithm
Source§fn eq(&self, other: &HmacAlgorithm) -> bool
fn eq(&self, other: &HmacAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HmacAlgorithm
Auto Trait Implementations§
impl Freeze for HmacAlgorithm
impl RefUnwindSafe for HmacAlgorithm
impl Send for HmacAlgorithm
impl Sync for HmacAlgorithm
impl Unpin for HmacAlgorithm
impl UnsafeUnpin for HmacAlgorithm
impl UnwindSafe for HmacAlgorithm
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