pub struct EncryptionRandomGenerator<G: ByteRandomGenerator> { /* private fields */ }Expand description
A random number generator which can be used to encrypt messages.
Implementations§
Source§impl<G: ByteRandomGenerator> EncryptionRandomGenerator<G>
impl<G: ByteRandomGenerator> EncryptionRandomGenerator<G>
Sourcepub fn new<S: Seeder + ?Sized>(
seed: impl Into<SeedKind>,
seeder: &mut S,
) -> Self
pub fn new<S: Seeder + ?Sized>( seed: impl Into<SeedKind>, seeder: &mut S, ) -> Self
Create a new EncryptionRandomGenerator, using the provided Seed or XofSeed
to seed the public mask generator and using the provided Seeder to privately seed the
noise generator.
Sourcepub fn remaining_bytes(&self) -> Option<usize>
pub fn remaining_bytes(&self) -> Option<usize>
Return the number of remaining bytes for the mask generator, if the generator is bounded.
pub fn noise_generator_mut(&mut self) -> &mut NoiseRandomGenerator<G>
pub fn mask_generator_mut(&mut self) -> &mut MaskRandomGenerator<G>
pub fn try_fork_from_config( &mut self, fork_config: EncryptionRandomGeneratorForkConfig, ) -> Result<impl Iterator<Item = Self>, ForkError>
Source§impl<G: ParallelByteRandomGenerator> EncryptionRandomGenerator<G>
impl<G: ParallelByteRandomGenerator> EncryptionRandomGenerator<G>
pub fn par_try_fork_from_config( &mut self, fork_config: EncryptionRandomGeneratorForkConfig, ) -> Result<impl IndexedParallelIterator<Item = Self>, ForkError>
Auto Trait Implementations§
impl<G> Freeze for EncryptionRandomGenerator<G>where
G: Freeze,
impl<G> RefUnwindSafe for EncryptionRandomGenerator<G>where
G: RefUnwindSafe,
impl<G> Send for EncryptionRandomGenerator<G>where
G: Send,
impl<G> Sync for EncryptionRandomGenerator<G>where
G: Sync,
impl<G> Unpin for EncryptionRandomGenerator<G>where
G: Unpin,
impl<G> UnwindSafe for EncryptionRandomGenerator<G>where
G: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more