Move AsRef implementation for hmac::Tag.

This commit is contained in:
Brian Smith 2019-04-04 14:36:48 -10:00
parent 9f80946c13
commit 287e541812

View File

@ -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`.