#[non_exhaustive]#[repr(u8)]pub enum CryptoId {
None = 0,
ChaCha20Poly1305 = 1,
Aes256Gcm = 2,
}Expand description
Names the AEAD cipher an entry’s payload was sealed with, if any.
Stored in the high nibble of an entry’s first byte. Any id other than
None also means the header carries a 12-byte nonce
and a 16-byte authentication tag between the length varint and the
payload; both built-in ciphers share that shape.
#[non_exhaustive]: this list has already grown from two variants to
three, so match it with a wildcard arm that reports
Error::UnknownCrypto rather than one that treats an unrecognized
cipher as no cipher at all.
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.
None = 0
The payload is not encrypted, and the header carries no nonce or tag.
ChaCha20Poly1305 = 1
ChaCha20-Poly1305 (RFC 8439), the default cipher.
Aes256Gcm = 2
AES-256-GCM, available where hardware acceleration makes it the faster choice.
Implementations§
Trait Implementations§
impl Copy for CryptoId
impl Eq for CryptoId
impl StructuralPartialEq for CryptoId
Auto Trait Implementations§
impl Freeze for CryptoId
impl RefUnwindSafe for CryptoId
impl Send for CryptoId
impl Sync for CryptoId
impl Unpin for CryptoId
impl UnsafeUnpin for CryptoId
impl UnwindSafe for CryptoId
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