Move AsRef
implementation for hmac::Tag
.
This commit is contained in:
parent
9f80946c13
commit
287e541812
10
src/hmac.rs
10
src/hmac.rs
@ -135,6 +135,11 @@ pub type Signature = Tag;
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Tag(digest::Digest);
|
||||
|
||||
impl AsRef<[u8]> for Tag {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &[u8] { self.0.as_ref() }
|
||||
}
|
||||
|
||||
/// A key to use for HMAC signing.
|
||||
pub struct Key {
|
||||
ctx_prototype: Context,
|
||||
@ -158,11 +163,6 @@ impl core::fmt::Debug for Key {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for Tag {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &[u8] { self.0.as_ref() }
|
||||
}
|
||||
|
||||
impl Key {
|
||||
/// Generate an HMAC signing key using the given digest algorithm with a
|
||||
/// random value generated from `rng`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user