#[non_exhaustive]pub struct MlKem1024DecapKey(/* private fields */);Expand description
Secret decapsulation key. Zeroized on drop.
Implementations§
Source§impl MlKem1024DecapKey
impl MlKem1024DecapKey
Sourcepub fn from_bytes(bytes: [u8; 3168]) -> Self
pub fn from_bytes(bytes: [u8; 3168]) -> Self
Construct from raw bytes.
Sourcepub fn try_from_slice(bytes: &[u8]) -> Result<Self, KyberLibError>
pub fn try_from_slice(bytes: &[u8]) -> Result<Self, KyberLibError>
Construct from a borrowed slice, validating the length
and the FIPS 203 §7.3 hash check (the stored H(ek)
must match the embedded encapsulation key).
§Errors
KyberLibError::InvalidLength on length mismatch;
KyberLibError::InvalidKey if the hash check fails.
Source§impl MlKem1024DecapKey
impl MlKem1024DecapKey
Sourcepub fn decapsulate(&self, ct: &MlKem1024Ciphertext) -> SharedSecret
pub fn decapsulate(&self, ct: &MlKem1024Ciphertext) -> SharedSecret
Decapsulate a ciphertext under this ML-KEM-1024 secret key. Implicit-rejection per FIPS 203 §6.3 — never panics, never branches on validity.
Trait Implementations§
Source§impl Clone for MlKem1024DecapKey
impl Clone for MlKem1024DecapKey
Source§fn clone(&self) -> MlKem1024DecapKey
fn clone(&self) -> MlKem1024DecapKey
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 MlKem1024DecapKey
impl Debug for MlKem1024DecapKey
Source§impl Drop for MlKem1024DecapKey
impl Drop for MlKem1024DecapKey
impl Eq for MlKem1024DecapKey
Source§impl PartialEq for MlKem1024DecapKey
impl PartialEq for MlKem1024DecapKey
impl StructuralPartialEq for MlKem1024DecapKey
Auto Trait Implementations§
impl Freeze for MlKem1024DecapKey
impl RefUnwindSafe for MlKem1024DecapKey
impl Send for MlKem1024DecapKey
impl Sync for MlKem1024DecapKey
impl Unpin for MlKem1024DecapKey
impl UnsafeUnpin for MlKem1024DecapKey
impl UnwindSafe for MlKem1024DecapKey
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