
* chore: update crate version to v0.9.0 * chore: remove deprecated re-exports * chore: remove Box re-export * feat: implement pure-Rust keygen and signing for RpoFalcon512 (#285) * feat: add reproducible builds (#296) * fix: address a few issues for migrating Miden VM (#298) * feat: add RngCore supertrait for FeltRng (#299) --------- Co-authored-by: Al-Kindi-0 <82364884+Al-Kindi-0@users.noreply.github.com> Co-authored-by: Paul-Henry Kajfasz <42912740+phklive@users.noreply.github.com>
21 lines
622 B
Rust
21 lines
622 B
Rust
//! Pseudo-random element generation.
|
|
|
|
use rand::RngCore;
|
|
pub use winter_crypto::{DefaultRandomCoin as WinterRandomCoin, RandomCoin, RandomCoinError};
|
|
pub use winter_utils::Randomizable;
|
|
|
|
use crate::{Felt, FieldElement, Word, ZERO};
|
|
|
|
mod rpo;
|
|
pub use rpo::RpoRandomCoin;
|
|
|
|
/// Pseudo-random element generator.
|
|
///
|
|
/// An instance can be used to draw, uniformly at random, base field elements as well as [Word]s.
|
|
pub trait FeltRng: RngCore {
|
|
/// Draw, uniformly at random, a base field element.
|
|
fn draw_element(&mut self) -> Felt;
|
|
|
|
/// Draw, uniformly at random, a [Word].
|
|
fn draw_word(&mut self) -> Word;
|
|
}
|