pub trait KEMPublicKey<const PK_LEN: usize>:
PartialEq
+ Eq
+ Clone
+ Debug
+ Display
+ Sized {
// Required methods
fn encode(&self) -> [u8; PK_LEN];
fn encode_out(&self, out: &mut [u8; PK_LEN]) -> usize;
fn from_bytes(bytes: &[u8]) -> Result<Self, KEMError>;
}Expand description
A public key for a KEM algorithm, often denoted “pk”.
Required Methods§
Sourcefn encode_out(&self, out: &mut [u8; PK_LEN]) -> usize
fn encode_out(&self, out: &mut [u8; PK_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.