pub struct HmacSha384;Expand description
HMAC-SHA-384 message authentication code (48-byte tag).
Implementations§
Source§impl HmacSha384
impl HmacSha384
Sourcepub const OUTPUT_LEN: usize = 48
pub const OUTPUT_LEN: usize = 48
Tag length in bytes.
Sourcepub fn new_keyed(key: &[u8]) -> Result<HmacSha384Keyed, CryptoError>
pub fn new_keyed(key: &[u8]) -> Result<HmacSha384Keyed, CryptoError>
Create a pre-keyed HMAC-SHA-384 instance that implements StreamingMac.
Sourcepub fn mac_truncated(
&self,
key: &[u8],
msg: &[u8],
out: &mut [u8],
) -> Result<(), CryptoError>
pub fn mac_truncated( &self, key: &[u8], msg: &[u8], out: &mut [u8], ) -> Result<(), CryptoError>
Compute a truncated HMAC-SHA-384 tag.
Writes the first out.len() bytes of the full 48-byte HMAC into out.
Returns CryptoError::BadInput if out.len() < 16.
Sourcepub fn verify_truncated(
&self,
key: &[u8],
msg: &[u8],
tag: &[u8],
) -> Result<(), CryptoError>
pub fn verify_truncated( &self, key: &[u8], msg: &[u8], tag: &[u8], ) -> Result<(), CryptoError>
Verify a truncated HMAC-SHA-384 tag in constant time.
Returns CryptoError::BadInput if tag.len() < 16, or
CryptoError::InvalidTag on mismatch.
Trait Implementations§
Source§impl Clone for HmacSha384
impl Clone for HmacSha384
Source§fn clone(&self) -> HmacSha384
fn clone(&self) -> HmacSha384
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 HmacSha384
Source§impl Debug for HmacSha384
impl Debug for HmacSha384
Source§impl Default for HmacSha384
impl Default for HmacSha384
Source§fn default() -> HmacSha384
fn default() -> HmacSha384
Returns the “default value” for a type. Read more
Source§impl Mac for HmacSha384
impl Mac for HmacSha384
Source§fn key_len(&self) -> usize
fn key_len(&self) -> usize
Required key length in bytes (the minimum acceptable for this MAC). Read more
Source§fn output_len(&self) -> usize
fn output_len(&self) -> usize
Output tag length in bytes.
Source§fn min_key_len(&self) -> usize
fn min_key_len(&self) -> usize
Minimum recommended key length in bytes. Read more
Source§fn mac(&self, key: &[u8], msg: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
fn mac(&self, key: &[u8], msg: &[u8], out: &mut [u8]) -> Result<(), CryptoError>
Compute a MAC tag for
msg under key and write it into out.Source§fn verify(&self, key: &[u8], msg: &[u8], tag: &[u8]) -> Result<(), CryptoError>
fn verify(&self, key: &[u8], msg: &[u8], tag: &[u8]) -> Result<(), CryptoError>
Verify a MAC tag in constant time. Read more
Source§fn mac_to_vec(&self, key: &[u8], msg: &[u8]) -> Result<Vec<u8>, CryptoError>
fn mac_to_vec(&self, key: &[u8], msg: &[u8]) -> Result<Vec<u8>, CryptoError>
Convenience: compute MAC and return the tag as a
Vec<u8>.Auto Trait Implementations§
impl Freeze for HmacSha384
impl RefUnwindSafe for HmacSha384
impl Send for HmacSha384
impl Sync for HmacSha384
impl Unpin for HmacSha384
impl UnsafeUnpin for HmacSha384
impl UnwindSafe for HmacSha384
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