#[non_exhaustive]pub enum Algorithm {
ChaCha20Poly1305,
Aes256Gcm,
}Available on crate features
aead-chacha20 or aead-aes-gcm only.Expand description
Supported AEAD algorithms.
The enum is #[non_exhaustive]. New algorithms are added in minor
releases; downstream match sites must include a wildcard arm.
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.
ChaCha20Poly1305
ChaCha20-Poly1305 (RFC 8439). The default. Fast in software, post-quantum-safe at 256-bit symmetric strength, no timing-side-channel risk on platforms without constant-time hardware AES.
Aes256Gcm
AES-256-GCM (NIST SP 800-38D). Hardware-accelerated on every modern x86 CPU (AES-NI + CLMUL) and on ARMv8 with the crypto extensions. Pick this when you need interop with TLS / JWE / spec’d protocols or when running on AES-accelerated hardware.
Implementations§
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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