#[non_exhaustive]pub enum CipherSuite {
Aes128CtrHmacSha256_80,
Aes128CtrHmacSha256_64,
Aes128CtrHmacSha256_32,
Aes128GcmSha256_128,
Aes256GcmSha512_128,
Aes256CtrHmacSha512_80,
Aes256CtrHmacSha512_64,
Aes256CtrHmacSha512_32,
}Expand description
An SFrame cipher suite: the hash used for key derivation and the AEAD used for the frames.
The first five are the suites of RFC 9605 section 4.5. The three Aes256CtrHmacSha512
suites are the AES-256 counterparts of the AES-CTR construction that RFC 10079 registers
(IANA “SFrame Cipher Suites” values 0x0006 to 0x0008, section 4.2), which the W3C Encoded
Transform API lists in SFrameCipherSuite. The sizes below are the registry’s columns as
RFC 10079 section 4.1 adds them (Nh, Nka, Nk, Nn, Nt).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Aes128CtrHmacSha256_80
AES_128_CTR_HMAC_SHA256_80 (0x0001): AES-128-CTR with HMAC-SHA256, 80-bit tag.
Aes128CtrHmacSha256_64
AES_128_CTR_HMAC_SHA256_64 (0x0002): AES-128-CTR with HMAC-SHA256, 64-bit tag.
Aes128CtrHmacSha256_32
AES_128_CTR_HMAC_SHA256_32 (0x0003): AES-128-CTR with HMAC-SHA256, 32-bit tag.
Aes128GcmSha256_128
AES_128_GCM_SHA256_128 (0x0004): AES-128-GCM, keys derived with SHA-256.
Aes256GcmSha512_128
AES_256_GCM_SHA512_128 (0x0005): AES-256-GCM, keys derived with SHA-512.
Aes256CtrHmacSha512_80
AES_256_CTR_HMAC_SHA512_80 (0x0006): AES-256-CTR with HMAC-SHA512, 80-bit tag.
Aes256CtrHmacSha512_64
AES_256_CTR_HMAC_SHA512_64 (0x0007): AES-256-CTR with HMAC-SHA512, 64-bit tag.
Aes256CtrHmacSha512_32
AES_256_CTR_HMAC_SHA512_32 (0x0008): AES-256-CTR with HMAC-SHA512, 32-bit tag.
Implementations§
Source§impl CipherSuite
impl CipherSuite
Sourcepub const ALL: [CipherSuite; 8]
pub const ALL: [CipherSuite; 8]
Every suite this crate implements, in registry order.
Sourcepub const fn id(self) -> u16
pub const fn id(self) -> u16
The suite’s value in the IANA “SFrame Cipher Suites” registry (RFC 9605 section 8.1). It is part of the key derivation labels.
Sourcepub const fn from_id(id: u16) -> Option<Self>
pub const fn from_id(id: u16) -> Option<Self>
The suite with this registry value, if this crate implements it. 0x0000 is reserved and 0xF000 to 0xFFFF are for private use: neither names a suite.
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The suite’s registered name, which is also its SFrameCipherSuite value in the W3C
Encoded Transform API.
Sourcepub const fn hash_len(self) -> usize
pub const fn hash_len(self) -> usize
Hash.Nh: the output size in bytes of the suite’s hash function.
Sourcepub const fn aes_ctr_key_len(self) -> Option<usize>
pub const fn aes_ctr_key_len(self) -> Option<usize>
AEAD.Nka: the AES key size in bytes of a suite built on AES-CTR with HMAC; None for
the GCM suites.