Skip to main content

Algorithm

Enum Algorithm 

Source
pub enum Algorithm {
Show 17 variants HmacSha1, HmacSha256, HmacSha384, HmacSha512, HmacSha3_256, HmacSha3_384, HmacSha3_512, HmacRipemd160, CmacAes128, CmacAes192, CmacAes256, CmacTripleDes, Kmac128, Kmac256, GmacAes128, GmacAes192, GmacAes256,
}
Expand description

MAC algorithm selector.

Variants§

§

HmacSha1

HMAC-SHA-1 (RFC 2104, FIPS 198-1). 20-byte tag. Legacy.

§

HmacSha256

HMAC-SHA-256. 32-byte tag.

§

HmacSha384

HMAC-SHA-384. 48-byte tag.

§

HmacSha512

HMAC-SHA-512. 64-byte tag.

§

HmacSha3_256

HMAC-SHA3-256. 32-byte tag.

§

HmacSha3_384

HMAC-SHA3-384. 48-byte tag.

§

HmacSha3_512

HMAC-SHA3-512. 64-byte tag.

§

HmacRipemd160

HMAC-RIPEMD-160. 20-byte tag. Legacy.

§

CmacAes128

CMAC-AES-128 (NIST SP 800-38B, RFC 4493). 16-byte tag, 16-byte key.

§

CmacAes192

CMAC-AES-192. 16-byte tag, 24-byte key.

§

CmacAes256

CMAC-AES-256. 16-byte tag, 32-byte key.

§

CmacTripleDes

CMAC-TripleDES (NIST SP 800-38B). 8-byte tag, 24-byte key. Legacy.

§

Kmac128

KMAC128 (FIPS SP 800-185). Default tag = 32 bytes (256 bits).

§

Kmac256

KMAC256 (FIPS SP 800-185). Default tag = 64 bytes (512 bits).

§

GmacAes128

GMAC-AES-128 (NIST SP 800-38D, GCM with empty plaintext). 16-byte tag. Requires a 12-byte unique nonce per message.

§

GmacAes192

GMAC-AES-192. 16-byte tag. Requires a 12-byte unique nonce per message.

§

GmacAes256

GMAC-AES-256. 16-byte tag. Requires a 12-byte unique nonce per message.

Trait Implementations§

Source§

impl Clone for Algorithm

Source§

fn clone(&self) -> Algorithm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Algorithm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Algorithm

Source§

fn eq(&self, other: &Algorithm) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Algorithm

Source§

impl Eq for Algorithm

Source§

impl StructuralPartialEq for Algorithm

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.