pub trait KEMPrivateKey<const SK_LEN: usize>:
PartialEq
+ Eq
+ Clone
+ Sized {
// Required methods
fn encode(&self) -> [u8; SK_LEN];
fn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize;
fn from_bytes(bytes: &[u8]) -> Result<Self, KEMError>;
}Expand description
A private key for a KEM algorithm, often denoted “sk” (for “secret key”).
Required Methods§
Sourcefn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize
fn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize
Write it out to bytes in its standard encoding. The entire output buffer is zeroized before the encoding is written.
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self, KEMError>
fn from_bytes(bytes: &[u8]) -> Result<Self, KEMError>
Read it in from bytes in its standard encoding.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.