#[non_exhaustive]pub enum AeadAlgorithm {
Aes128Gcm,
Aes256Gcm,
Chacha20Poly1305,
}Expand description
An authenticated-encryption algorithm outside TLS (RFC 5116), with a 96-bit nonce and a 128-bit
tag. TLS record protection is CipherSuite.
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.
Aes128Gcm
AES-128 in Galois/Counter Mode (FIPS 197, SP 800-38D).
Aes256Gcm
AES-256 in Galois/Counter Mode (FIPS 197, SP 800-38D).
Chacha20Poly1305
ChaCha20-Poly1305 (RFC 8439).
Implementations§
Source§impl AeadAlgorithm
impl AeadAlgorithm
Sourcepub const ALL: &'static [AeadAlgorithm]
pub const ALL: &'static [AeadAlgorithm]
Every AEAD algorithm.
Sourcepub const fn max_plaintext_len(self) -> u64
pub const fn max_plaintext_len(self) -> u64
The longest plaintext one seal takes, in bytes. AES-GCM: 2^36 − 32, SP 800-38D §5.2.1.1 (p. 8), len(P) ≤ 2^39 − 256 bits. ChaCha20-Poly1305: RFC 8439 §2.8 gives 274,877,906,880 and the module refuses that length, so the bound is one byte below it.
Trait Implementations§
Source§impl Clone for AeadAlgorithm
impl Clone for AeadAlgorithm
impl Copy for AeadAlgorithm
Source§impl Debug for AeadAlgorithm
impl Debug for AeadAlgorithm
Source§impl Display for AeadAlgorithm
impl Display for AeadAlgorithm
impl Eq for AeadAlgorithm
Source§impl FromStr for AeadAlgorithm
impl FromStr for AeadAlgorithm
Source§impl Hash for AeadAlgorithm
impl Hash for AeadAlgorithm
Source§impl PartialEq for AeadAlgorithm
impl PartialEq for AeadAlgorithm
impl StructuralPartialEq for AeadAlgorithm
Auto Trait Implementations§
impl Freeze for AeadAlgorithm
impl RefUnwindSafe for AeadAlgorithm
impl Send for AeadAlgorithm
impl Sync for AeadAlgorithm
impl Unpin for AeadAlgorithm
impl UnsafeUnpin for AeadAlgorithm
impl UnwindSafe for AeadAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more