Enum coset::iana::Algorithm

source ·
#[non_exhaustive]
pub enum Algorithm {
Show 65 variants RS1 = -65_535, WalnutDSA = -260, RS512 = -259, RS384 = -258, RS256 = -257, ES256K = -47, HSS_LMS = -46, SHAKE256 = -45, SHA_512 = -44, SHA_384 = -43, RSAES_OAEP_SHA_512 = -42, RSAES_OAEP_SHA_256 = -41, RSAES_OAEP_RFC_8017_default = -40, PS512 = -39, PS384 = -38, PS256 = -37, ES512 = -36, ES384 = -35, ECDH_SS_A256KW = -34, ECDH_SS_A192KW = -33, ECDH_SS_A128KW = -32, ECDH_ES_A256KW = -31, ECDH_ES_A192KW = -30, ECDH_ES_A128KW = -29, ECDH_SS_HKDF_512 = -28, ECDH_SS_HKDF_256 = -27, ECDH_ES_HKDF_512 = -26, ECDH_ES_HKDF_256 = -25, SHAKE128 = -18, SHA_512_256 = -17, SHA_256 = -16, SHA_256_64 = -15, SHA_1 = -14, Direct_HKDF_AES_256 = -13, Direct_HKDF_AES_128 = -12, Direct_HKDF_SHA_512 = -11, Direct_HKDF_SHA_256 = -10, EdDSA = -8, ES256 = -7, Direct = -6, A256KW = -5, A192KW = -4, A128KW = -3, Reserved = 0, A128GCM = 1, A192GCM = 2, A256GCM = 3, HMAC_256_64 = 4, HMAC_256_256 = 5, HMAC_384_384 = 6, HMAC_512_512 = 7, AES_CCM_16_64_128 = 10, AES_CCM_16_64_256 = 11, AES_CCM_64_64_128 = 12, AES_CCM_64_64_256 = 13, AES_MAC_128_64 = 14, AES_MAC_256_64 = 15, ChaCha20Poly1305 = 24, AES_MAC_128_128 = 25, AES_MAC_256_128 = 26, AES_CCM_16_128_128 = 30, AES_CCM_16_128_256 = 31, AES_CCM_64_128_128 = 32, AES_CCM_64_128_256 = 33, IV_GENERATION = 34,
}
Expand description

IANA-registered COSE algorithms.

From IANA registry https://www.iana.org/assignments/cose/cose.xhtml#algorithms as of 2021-03-19.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

RS1 = -65_535

RSASSA-PKCS1-v1_5 using SHA-1

§

WalnutDSA = -260

WalnutDSA signature

§

RS512 = -259

RSASSA-PKCS1-v1_5 using SHA-512

§

RS384 = -258

RSASSA-PKCS1-v1_5 using SHA-384

§

RS256 = -257

RSASSA-PKCS1-v1_5 using SHA-256

§

ES256K = -47

ECDSA using secp256k1 curve and SHA-256

§

HSS_LMS = -46

HSS/LMS hash-based digital signature

§

SHAKE256 = -45

SHAKE-256 512-bit Hash Value

§

SHA_512 = -44

SHA-2 512-bit Hash

§

SHA_384 = -43

SHA-2 384-bit Hash

§

RSAES_OAEP_SHA_512 = -42

RSAES-OAEP w/ SHA-512

§

RSAES_OAEP_SHA_256 = -41

RSAES-OAEP w/ SHA-256

§

RSAES_OAEP_RFC_8017_default = -40

RSAES-OAEP w/ SHA-1

§

PS512 = -39

RSASSA-PSS w/ SHA-512

§

PS384 = -38

RSASSA-PSS_SHA-384

§

PS256 = -37

RSASSA-PSS w/ SHA-256

§

ES512 = -36

ECDSA w/ SHA-512

§

ES384 = -35

ECDSA w/ SHA-384

§

ECDH_SS_A256KW = -34

ECDH SS w/ Concat KDF and AES Key Wrap w/ 256-bit key

§

ECDH_SS_A192KW = -33

ECDH SS w/ Concat KDF and AES Key Wrap w/ 192-bit key

§

ECDH_SS_A128KW = -32

ECDH SS w/ Concat KDF and AES Key Wrap w/ 128-bit key

§

ECDH_ES_A256KW = -31

ECDH ES w/ Concat KDF and AES Key Wrap w/ 256-bit key

§

ECDH_ES_A192KW = -30

ECDH ES w/ Concat KDF and AES Key Wrap w/ 192-bit key

§

ECDH_ES_A128KW = -29

ECDH ES w/ Concat KDF and AES Key Wrap w/ 128-bit key

§

ECDH_SS_HKDF_512 = -28

ECDH SS w/ HKDF - generate key directly

§

ECDH_SS_HKDF_256 = -27

ECDH SS w/ HKDF - generate key directly

§

ECDH_ES_HKDF_512 = -26

ECDH ES w/ HKDF - generate key directly

§

ECDH_ES_HKDF_256 = -25

ECDH ES w/ HKDF - generate key directly

§

SHAKE128 = -18

SHAKE-128 256-bit Hash Value

§

SHA_512_256 = -17

SHA-2 512-bit Hash truncated to 256-bits

§

SHA_256 = -16

SHA-2 256-bit Hash

§

SHA_256_64 = -15

SHA-2 256-bit Hash truncated to 64-bits

§

SHA_1 = -14

SHA-1 Hash

§

Direct_HKDF_AES_256 = -13

Shared secret w/ AES-MAC 256-bit key

§

Direct_HKDF_AES_128 = -12

Shared secret w/ AES-MAC 128-bit key

§

Direct_HKDF_SHA_512 = -11

Shared secret w/ HKDF and SHA-512

§

Direct_HKDF_SHA_256 = -10

Shared secret w/ HKDF and SHA-256

§

EdDSA = -8

EdDSA

§

ES256 = -7

ECDSA w/ SHA-256

§

Direct = -6

Direct use of CEK

§

A256KW = -5

AES Key Wrap w/ 256-bit key

§

A192KW = -4

AES Key Wrap w/ 192-bit key

§

A128KW = -3

AES Key Wrap w/ 128-bit key

§

Reserved = 0

Reserved

§

A128GCM = 1

AES-GCM mode w/ 128-bit key, 128-bit tag

§

A192GCM = 2

AES-GCM mode w/ 192-bit key, 128-bit tag

§

A256GCM = 3

AES-GCM mode w/ 256-bit key, 128-bit tag

§

HMAC_256_64 = 4

HMAC w/ SHA-256 truncated to 64 bits

§

HMAC_256_256 = 5

HMAC w/ SHA-256

§

HMAC_384_384 = 6

HMAC w/ SHA-384

§

HMAC_512_512 = 7

HMAC w/ SHA-512

§

AES_CCM_16_64_128 = 10

AES-CCM mode 128-bit key, 64-bit tag, 13-byte nonce

§

AES_CCM_16_64_256 = 11

AES-CCM mode 256-bit key, 64-bit tag, 13-byte nonce

§

AES_CCM_64_64_128 = 12

AES-CCM mode 128-bit key, 64-bit tag, 7-byte nonce

§

AES_CCM_64_64_256 = 13

AES-CCM mode 256-bit key, 64-bit tag, 7-byte nonce

§

AES_MAC_128_64 = 14

AES-MAC 128-bit key, 64-bit tag

§

AES_MAC_256_64 = 15

AES-MAC 256-bit key, 64-bit tag

§

ChaCha20Poly1305 = 24

ChaCha20/Poly1305 w/ 256-bit key, 128-bit tag

§

AES_MAC_128_128 = 25

AES-MAC 128-bit key, 128-bit tag

§

AES_MAC_256_128 = 26

AES-MAC 256-bit key, 128-bit tag

§

AES_CCM_16_128_128 = 30

AES-CCM mode 128-bit key, 128-bit tag, 13-byte nonce

§

AES_CCM_16_128_256 = 31

AES-CCM mode 256-bit key, 128-bit tag, 13-byte nonce

§

AES_CCM_64_128_128 = 32

AES-CCM mode 128-bit key, 128-bit tag, 7-byte nonce

§

AES_CCM_64_128_256 = 33

AES-CCM mode 256-bit key, 128-bit tag, 7-byte nonce

§

IV_GENERATION = 34

For doing IV generation for symmetric algorithms.

Trait Implementations§

source§

impl Clone for Algorithm

source§

fn clone(&self) -> Algorithm

Returns a copy 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 EnumI64 for Algorithm

source§

fn from_i64(i: i64) -> Option<Self>

source§

fn to_i64(&self) -> i64

source§

impl Ord for Algorithm

source§

fn cmp(&self, other: &Algorithm) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Algorithm

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Algorithm

source§

fn partial_cmp(&self, other: &Algorithm) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl WithPrivateRange for Algorithm

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> 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,

§

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>,

§

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>,

§

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.