pub trait KEMPrivateKey<const SK_LEN: usize>:
PartialEq
+ Eq
+ Clone
+ Secret
+ 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.
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".