pub struct ClassicalMcElieceRng { /* private fields */ }Expand description
Classical McEliece compatible RNG
This RNG provides the same interface as the original AesState but uses
libQ’s standard RNG infrastructure instead of AES-based generation.
Implementations§
Source§impl ClassicalMcElieceRng
impl ClassicalMcElieceRng
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new secure RNG using system entropy
Random output is drawn with getrandom::fill. The classical-mceliece crate feature
enables the getrandom dependency so non-test builds always have OS entropy available
(including wasm_js on wasm32-unknown-unknown when configured in the dependency graph).
Sourcepub fn new_deterministic(seed: u64) -> Self
pub fn new_deterministic(seed: u64) -> Self
Create a new deterministic RNG for testing
This creates an RNG that produces deterministic output based on the seed. This is useful for testing and reproducible key generation.
Sourcepub fn new_deterministic_from_bytes(seed_bytes: &[u8]) -> Self
pub fn new_deterministic_from_bytes(seed_bytes: &[u8]) -> Self
Create a new deterministic RNG from byte array
This creates an RNG that produces deterministic output based on the byte array. The bytes are hashed to create a 64-bit seed.
Sourcepub fn randombytes_init(&mut self, entropy_input: [u8; 48])
pub fn randombytes_init(&mut self, entropy_input: [u8; 48])
Initialize the RNG with entropy (for deterministic mode)
This method is provided for compatibility with the original AesState interface.
In deterministic mode, it updates the internal state.
In secure mode, it’s a no-op as the RNG uses system entropy.
Trait Implementations§
Source§impl Clone for ClassicalMcElieceRng
impl Clone for ClassicalMcElieceRng
Source§fn clone(&self) -> ClassicalMcElieceRng
fn clone(&self) -> ClassicalMcElieceRng
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClassicalMcElieceRng
impl Debug for ClassicalMcElieceRng
Source§impl Default for ClassicalMcElieceRng
impl Default for ClassicalMcElieceRng
Source§impl Display for ClassicalMcElieceRng
impl Display for ClassicalMcElieceRng
Source§impl PartialEq for ClassicalMcElieceRng
impl PartialEq for ClassicalMcElieceRng
Source§fn eq(&self, other: &ClassicalMcElieceRng) -> bool
fn eq(&self, other: &ClassicalMcElieceRng) -> bool
self and other values to be equal, and is used by ==.Source§impl TryRng for ClassicalMcElieceRng
impl TryRng for ClassicalMcElieceRng
Source§type Error = Infallible
type Error = Infallible
impl Eq for ClassicalMcElieceRng
impl StructuralPartialEq for ClassicalMcElieceRng
impl TryCryptoRng for ClassicalMcElieceRng
Auto Trait Implementations§
impl Freeze for ClassicalMcElieceRng
impl RefUnwindSafe for ClassicalMcElieceRng
impl Send for ClassicalMcElieceRng
impl Sync for ClassicalMcElieceRng
impl Unpin for ClassicalMcElieceRng
impl UnsafeUnpin for ClassicalMcElieceRng
impl UnwindSafe for ClassicalMcElieceRng
Blanket Implementations§
Source§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read more