pub struct Kopis512PublicKey(/* private fields */);Expand description
A public key for this KEM
Implementations§
Source§impl Kopis512PublicKey
impl Kopis512PublicKey
Sourcepub const SERIALIZED_LEN: usize = KemPublicKey<KOPIS512_L>::SERIALIZED_LEN
pub const SERIALIZED_LEN: usize = KemPublicKey<KOPIS512_L>::SERIALIZED_LEN
The length of the public key when serialized to bytes
Sourcepub fn serialize(&self, out_buf: &mut [u8; 672])
pub fn serialize(&self, out_buf: &mut [u8; 672])
Serializes this public key into out_buf, of length Self::SERIALIZED_LEN
Sourcepub fn from_bytes(bytes: &[u8; 672]) -> Self
pub fn from_bytes(bytes: &[u8; 672]) -> Self
Deserializes a public key from bytes, of length Self::SERIALIZED_LEN
Source§impl Kopis512PublicKey
impl Kopis512PublicKey
Sourcepub fn encapsulate(
&self,
rng: &mut impl CryptoRng,
) -> (Kopis512Ciphertext, SharedSecret)
pub fn encapsulate( &self, rng: &mut impl CryptoRng, ) -> (Kopis512Ciphertext, SharedSecret)
Encapsulates a fresh shared secret
Sourcepub fn encapsulate_deterministic(
&self,
randomness: &[u8; 32],
) -> (Kopis512Ciphertext, SharedSecret)
pub fn encapsulate_deterministic( &self, randomness: &[u8; 32], ) -> (Kopis512Ciphertext, SharedSecret)
Encapsulates a shared secret using the given 32-byte randomness. This is
deterministic given randomness, and is primarily useful for testing and
known-answer test (KAT) vectors.
Auto Trait Implementations§
impl Freeze for Kopis512PublicKey
impl RefUnwindSafe for Kopis512PublicKey
impl Send for Kopis512PublicKey
impl Sync for Kopis512PublicKey
impl Unpin for Kopis512PublicKey
impl UnsafeUnpin for Kopis512PublicKey
impl UnwindSafe for Kopis512PublicKey
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