pub struct MlKem768Impl { /* private fields */ }
Expand description
ML-KEM-768 implementation using aws-lc-rs
Implementations§
Source§impl MlKem768Impl
impl MlKem768Impl
Sourcepub fn cleanup_cache(&self, max_age: Duration)
pub fn cleanup_cache(&self, max_age: Duration)
Clean up old entries from key cache
This should be called periodically to prevent memory leaks. Removes entries older than the specified duration.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Get the current size of the key cache
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear all entries from the key cache
Trait Implementations§
Source§impl Clone for MlKem768Impl
impl Clone for MlKem768Impl
Source§impl MlKemOperations for MlKem768Impl
Available on crate feature aws-lc-rs
only.
impl MlKemOperations for MlKem768Impl
Available on crate feature
aws-lc-rs
only.Source§fn generate_keypair(&self) -> PqcResult<(MlKemPublicKey, MlKemSecretKey)>
fn generate_keypair(&self) -> PqcResult<(MlKemPublicKey, MlKemSecretKey)>
Generate a new ML-KEM keypair
Source§fn encapsulate(
&self,
public_key: &MlKemPublicKey,
) -> PqcResult<(MlKemCiphertext, SharedSecret)>
fn encapsulate( &self, public_key: &MlKemPublicKey, ) -> PqcResult<(MlKemCiphertext, SharedSecret)>
Encapsulate a shared secret
Source§fn decapsulate(
&self,
secret_key: &MlKemSecretKey,
ciphertext: &MlKemCiphertext,
) -> PqcResult<SharedSecret>
fn decapsulate( &self, secret_key: &MlKemSecretKey, ciphertext: &MlKemCiphertext, ) -> PqcResult<SharedSecret>
Decapsulate a shared secret
Auto Trait Implementations§
impl Freeze for MlKem768Impl
impl RefUnwindSafe for MlKem768Impl
impl Send for MlKem768Impl
impl Sync for MlKem768Impl
impl Unpin for MlKem768Impl
impl UnwindSafe for MlKem768Impl
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