Skip to main content

KEMPrivateKey

Trait KEMPrivateKey 

Source
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§

Source

fn encode(&self) -> [u8; SK_LEN]

Write it out to bytes in its standard encoding.

Source

fn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize

Write it out to bytes in its standard encoding.

Source

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".

Implementors§