#[repr(u8)]pub enum PublicKey {
X25519(PublicKey),
P256(PublicKey),
MlKem512(MlKemPublicKey<libcrux_ml_kem::::mlkem512::MlKem512PublicKey::{constant#0}>),
MlKem768(MlKemPublicKey<libcrux_ml_kem::::mlkem768::MlKem768PublicKey::{constant#0}>),
X25519MlKem768Draft00(X25519MlKem768Draft00PublicKey),
XWingKemDraft06(XWingKemDraft06PublicKey),
MlKem1024(MlKemPublicKey<libcrux_ml_kem::::mlkem1024::MlKem1024PublicKey::{constant#0}>),
}Expand description
A KEM public key.
Variants§
X25519(PublicKey)
P256(PublicKey)
MlKem512(MlKemPublicKey<libcrux_ml_kem::::mlkem512::MlKem512PublicKey::{constant#0}>)
MlKem768(MlKemPublicKey<libcrux_ml_kem::::mlkem768::MlKem768PublicKey::{constant#0}>)
X25519MlKem768Draft00(X25519MlKem768Draft00PublicKey)
XWingKemDraft06(XWingKemDraft06PublicKey)
MlKem1024(MlKemPublicKey<libcrux_ml_kem::::mlkem1024::MlKem1024PublicKey::{constant#0}>)
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn encapsulate(&self, rng: &mut impl CryptoRng) -> Result<(Ss, Ct), Error>
pub fn encapsulate(&self, rng: &mut impl CryptoRng) -> Result<(Ss, Ct), Error>
Encapsulate a shared secret to the provided pk and return the (Key, Enc) tuple.
Trait Implementations§
Source§impl Deserialize for PublicKey
impl Deserialize for PublicKey
Source§fn tls_deserialize<R>(bytes: &mut R) -> Result<PublicKey, Error>where
R: Read,
fn tls_deserialize<R>(bytes: &mut R) -> Result<PublicKey, Error>where
R: Read,
This function deserializes the
bytes from the provided a std::io::Read
and returns the populated struct. Read moreSource§impl Serialize for &PublicKey
impl Serialize for &PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more