pub struct MlKemEncryptor;Expand description
ML-KEM-1024 key-encapsulation adapter.
Implements the Encryptor port using the ml-kem crate (NIST FIPS 203).
Each call seeds a fresh ChaCha20Rng from the OS, ensuring forward
secrecy between calls.
Trait Implementations§
Source§impl Debug for MlKemEncryptor
impl Debug for MlKemEncryptor
Source§impl Default for MlKemEncryptor
impl Default for MlKemEncryptor
Source§fn default() -> MlKemEncryptor
fn default() -> MlKemEncryptor
Returns the “default value” for a type. Read more
Source§impl Encryptor for MlKemEncryptor
impl Encryptor for MlKemEncryptor
Source§fn generate_keypair(&self) -> Result<KeyPair, CryptoError>
fn generate_keypair(&self) -> Result<KeyPair, CryptoError>
Generate a fresh key pair. Read more
Source§fn encapsulate(&self, public_key: &[u8]) -> Result<(Bytes, Bytes), CryptoError>
fn encapsulate(&self, public_key: &[u8]) -> Result<(Bytes, Bytes), CryptoError>
Encapsulate a shared secret using the recipient’s public key. Read more
Source§fn decapsulate(
&self,
secret_key: &[u8],
ciphertext: &[u8],
) -> Result<Bytes, CryptoError>
fn decapsulate( &self, secret_key: &[u8], ciphertext: &[u8], ) -> Result<Bytes, CryptoError>
Decapsulate a shared secret using the holder’s secret key. Read more
Auto Trait Implementations§
impl Freeze for MlKemEncryptor
impl RefUnwindSafe for MlKemEncryptor
impl Send for MlKemEncryptor
impl Sync for MlKemEncryptor
impl Unpin for MlKemEncryptor
impl UnsafeUnpin for MlKemEncryptor
impl UnwindSafe for MlKemEncryptor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more