[][src]Enum asuran_core::repository::hmac::HMAC

pub enum HMAC {
    SHA256,
    Blake2b,
    Blake2bp,
    Blake3,
    SHA3,
}

Tag for the HMAC algorithim used by a particular Chunk

Variants

SHA256
Blake2b
Blake2bp
Blake3
SHA3

Methods

impl HMAC[src]

pub fn mac(self, data: &[u8], key: &Key) -> Vec<u8>[src]

Produces an HMAC tag using the section of the key material reserved for integrity verification.

Panics

Will panic if the user has selected an algorithm for which support has not been compiled in.

pub fn id(self, data: &[u8], key: &Key) -> Vec<u8>[src]

Produces an HMAC tag using the section of the key material reserved for ChunkID generation.

Panics

Will panic if the user has selected an algorithm for which support has not been compiled in.

pub fn verify_hmac(self, input_mac: &[u8], data: &[u8], key: &Key) -> bool[src]

Produces an HMAC for the supplied data, using the portion of the supplied key reserved for integrity verification, and the algorithm specified by the variant of self, and verifies it against the supplied HMAC, using constant time comparisons where possible.

Panics

Panics if the user has selected an algorithm for which support has not been compiled in.

Trait Implementations

impl Clone for HMAC[src]

impl Copy for HMAC[src]

impl Debug for HMAC[src]

impl<'de> Deserialize<'de> for HMAC[src]

impl Eq for HMAC[src]

impl PartialEq<HMAC> for HMAC[src]

impl Serialize for HMAC[src]

impl StructuralEq for HMAC[src]

impl StructuralPartialEq for HMAC[src]

Auto Trait Implementations

impl RefUnwindSafe for HMAC

impl Send for HMAC

impl Sync for HMAC

impl Unpin for HMAC

impl UnwindSafe for HMAC

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,