pub struct SntrupKem<P: SntrupParams>(/* private fields */);Expand description
Streamlined NTRU Prime Key Encapsulation Mechanism parameterized by parameter set.
Zero-sized marker type providing generate_key.
Use the type aliases Sntrup653,
Sntrup761, Sntrup857,
Sntrup953, Sntrup1013,
Sntrup1277.
Implementations§
Source§impl<P: SntrupParams> SntrupKem<P>
impl<P: SntrupParams> SntrupKem<P>
Sourcepub fn generate_key(
rng: &mut impl CryptoRng,
) -> (EncapsulationKey<P>, DecapsulationKey<P>)
pub fn generate_key( rng: &mut impl CryptoRng, ) -> (EncapsulationKey<P>, DecapsulationKey<P>)
Generate a Streamlined NTRU Prime key pair.
Sourcepub fn generate_key_deterministic(
seed: &[u8; 32],
) -> (EncapsulationKey<P>, DecapsulationKey<P>)
pub fn generate_key_deterministic( seed: &[u8; 32], ) -> (EncapsulationKey<P>, DecapsulationKey<P>)
Generate a key pair deterministically from a 32-byte seed.
The seed is expanded via ChaCha20Rng to derive the full key pair. Identical seeds always produce identical key pairs.
Trait Implementations§
impl<P: Copy + SntrupParams> Copy for SntrupKem<P>
Auto Trait Implementations§
impl<P> Freeze for SntrupKem<P>
impl<P> RefUnwindSafe for SntrupKem<P>where
P: RefUnwindSafe,
impl<P> Send for SntrupKem<P>where
P: Send,
impl<P> Sync for SntrupKem<P>where
P: Sync,
impl<P> Unpin for SntrupKem<P>where
P: Unpin,
impl<P> UnsafeUnpin for SntrupKem<P>
impl<P> UnwindSafe for SntrupKem<P>where
P: UnwindSafe,
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