#[non_exhaustive]pub struct MlKem512DecapKey(/* private fields */);Expand description
Secret decapsulation key. Zeroized on drop.
Implementations§
Source§impl MlKem512DecapKey
impl MlKem512DecapKey
Sourcepub fn from_bytes(bytes: [u8; 1632]) -> Self
pub fn from_bytes(bytes: [u8; 1632]) -> 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 MlKem512DecapKey
impl MlKem512DecapKey
Sourcepub fn decapsulate(&self, ct: &MlKem512Ciphertext) -> SharedSecret
pub fn decapsulate(&self, ct: &MlKem512Ciphertext) -> SharedSecret
Decapsulate a ciphertext under this ML-KEM-512 secret key. Implicit-rejection per FIPS 203 §6.3 — never panics, never branches on validity.
Trait Implementations§
Source§impl Clone for MlKem512DecapKey
impl Clone for MlKem512DecapKey
Source§fn clone(&self) -> MlKem512DecapKey
fn clone(&self) -> MlKem512DecapKey
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 MlKem512DecapKey
impl Debug for MlKem512DecapKey
Source§impl Drop for MlKem512DecapKey
impl Drop for MlKem512DecapKey
impl Eq for MlKem512DecapKey
Source§impl PartialEq for MlKem512DecapKey
impl PartialEq for MlKem512DecapKey
impl StructuralPartialEq for MlKem512DecapKey
Auto Trait Implementations§
impl Freeze for MlKem512DecapKey
impl RefUnwindSafe for MlKem512DecapKey
impl Send for MlKem512DecapKey
impl Sync for MlKem512DecapKey
impl Unpin for MlKem512DecapKey
impl UnsafeUnpin for MlKem512DecapKey
impl UnwindSafe for MlKem512DecapKey
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