Struct MlKemKeyPair

Source
pub struct MlKemKeyPair<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> { /* private fields */ }
Expand description

An ML-KEM key pair

Implementations§

Source§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

Source

pub fn new(sk: [u8; PRIVATE_KEY_SIZE], pk: [u8; PUBLIC_KEY_SIZE]) -> Self

Creates a new MlKemKeyPair.

Source

pub fn from( sk: MlKemPrivateKey<PRIVATE_KEY_SIZE>, pk: MlKemPublicKey<PUBLIC_KEY_SIZE>, ) -> Self

Create a new MlKemKeyPair from the secret and public key.

Source

pub fn public_key(&self) -> &MlKemPublicKey<PUBLIC_KEY_SIZE>

Get a reference to the MlKemPublicKey<PUBLIC_KEY_SIZE>.

Source

pub fn private_key(&self) -> &MlKemPrivateKey<PRIVATE_KEY_SIZE>

Get a reference to the MlKemPrivateKey<PRIVATE_KEY_SIZE>.

Source

pub fn pk(&self) -> &[u8; PUBLIC_KEY_SIZE]

Get a reference to the raw public key bytes.

Source

pub fn sk(&self) -> &[u8; PRIVATE_KEY_SIZE]

Get a reference to the raw private key bytes.

Source

pub fn into_parts( self, ) -> (MlKemPrivateKey<PRIVATE_KEY_SIZE>, MlKemPublicKey<PUBLIC_KEY_SIZE>)

Separate this key into the public and private key.

Auto Trait Implementations§

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> Freeze for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> RefUnwindSafe for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> Send for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> Sync for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> Unpin for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

§

impl<const PRIVATE_KEY_SIZE: usize, const PUBLIC_KEY_SIZE: usize> UnwindSafe for MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.