pub struct DecapsulationKey { /* private fields */ }Expand description
Validated ML-KEM-512 decapsulation (private) key. Automatically zeroized on drop.
Implementations§
Source§impl DecapsulationKey
impl DecapsulationKey
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Parses and validates a decapsulation key per FIPS 203, Section 7.3
(exact length + coefficient bounds + constant-time H(ek) hash check).
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates this decapsulation key in place per FIPS 203, Section 7.3 without creating a stack copy of the key material.
Sourcepub const fn expose_bytes(&self) -> &[u8; 1632]
pub const fn expose_bytes(&self) -> &[u8; 1632]
Explicitly borrows the underlying secret key bytes.
Sourcepub const fn zeroed() -> Self
pub const fn zeroed() -> Self
Returns an uninitialized all-zero placeholder decapsulation key for in-place heap initialization without stack-to-heap secret moves.
Uninitialized (or subsequently zeroized) placeholder keys are rejected by
DecapsulationKey::validate, [Kem::decaps], and decaps_into with
[Error::InvalidDecapsulationKey] until populated by keygen_into.
Trait Implementations§
Source§impl Debug for DecapsulationKey
impl Debug for DecapsulationKey
Auto Trait Implementations§
impl Freeze for DecapsulationKey
impl RefUnwindSafe for DecapsulationKey
impl Send for DecapsulationKey
impl Sync for DecapsulationKey
impl Unpin for DecapsulationKey
impl UnsafeUnpin for DecapsulationKey
impl UnwindSafe for DecapsulationKey
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