pub struct HmacSha512(/* private fields */);Expand description
HMAC-SHA512.
Implementations§
Source§impl HmacSha512
impl HmacSha512
Sourcepub fn mac(key: &[u8], data: &[u8]) -> [u8; 64]
pub fn mac(key: &[u8], data: &[u8]) -> [u8; 64]
Computes the HMAC-SHA512 of data as a one-shot operation.
Sourcepub fn new_from_slice(key: &[u8]) -> Self
pub fn new_from_slice(key: &[u8]) -> Self
Creates a new HMAC-SHA512 operation from a variable-length key.
Sourcepub fn verify_slice(self, tag: &[u8]) -> Result<(), InvalidSignatureError>
pub fn verify_slice(self, tag: &[u8]) -> Result<(), InvalidSignatureError>
Checks that the provided tag value matches the computed HMAC value.
Sourcepub fn verify(self, tag: &[u8; 64]) -> Result<(), InvalidSignatureError>
pub fn verify(self, tag: &[u8; 64]) -> Result<(), InvalidSignatureError>
Checks that the provided tag value matches the computed HMAC value.
Sourcepub fn verify_truncated_left(
self,
tag: &[u8],
) -> Result<(), InvalidSignatureError>
pub fn verify_truncated_left( self, tag: &[u8], ) -> Result<(), InvalidSignatureError>
Checks that the provided tag value matches the computed HMAC, truncated to the input tag’s length.
Truncating an HMAC reduces the security of the construction. Callers must ensure tag’s
length matches the desired HMAC length and security level.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HmacSha512
impl RefUnwindSafe for HmacSha512
impl !Send for HmacSha512
impl !Sync for HmacSha512
impl Unpin for HmacSha512
impl UnsafeUnpin for HmacSha512
impl UnwindSafe for HmacSha512
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