pub enum KemAlgorithm {
MlKem512,
MlKem768,
MlKem1024,
X25519,
}Expand description
KEM algorithms supported
Variants§
MlKem512
ML-KEM-512 (NIST Level 1 - 128-bit security)
MlKem768
ML-KEM-768 (NIST Level 3 - 192-bit security) - RECOMMENDED DEFAULT
MlKem1024
ML-KEM-1024 (NIST Level 5 - 256-bit security)
X25519
Classic X25519 for compatibility
Implementations§
Source§impl KemAlgorithm
impl KemAlgorithm
Sourcepub fn encap_key_size(&self) -> usize
pub fn encap_key_size(&self) -> usize
Get the encapsulation key size in bytes
Sourcepub fn ciphertext_size(&self) -> usize
pub fn ciphertext_size(&self) -> usize
Get the ciphertext size in bytes
Get the shared secret size (always 32 bytes for ML-KEM)
Trait Implementations§
Source§impl Clone for KemAlgorithm
impl Clone for KemAlgorithm
Source§fn clone(&self) -> KemAlgorithm
fn clone(&self) -> KemAlgorithm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KemAlgorithm
impl Debug for KemAlgorithm
Source§impl Default for KemAlgorithm
impl Default for KemAlgorithm
Source§impl<'de> Deserialize<'de> for KemAlgorithm
impl<'de> Deserialize<'de> for KemAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for KemAlgorithm
impl PartialEq for KemAlgorithm
Source§fn eq(&self, other: &KemAlgorithm) -> bool
fn eq(&self, other: &KemAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for KemAlgorithm
impl Serialize for KemAlgorithm
impl Copy for KemAlgorithm
impl Eq for KemAlgorithm
impl StructuralPartialEq for KemAlgorithm
Auto Trait Implementations§
impl Freeze for KemAlgorithm
impl RefUnwindSafe for KemAlgorithm
impl Send for KemAlgorithm
impl Sync for KemAlgorithm
impl Unpin for KemAlgorithm
impl UnsafeUnpin for KemAlgorithm
impl UnwindSafe for KemAlgorithm
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