arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
miden-crypto/src/rand/mod.rs
src/rand/mod.rsRaw
 1//! Pseudo-random element generation.
 2
 3pub use winter_crypto::{RandomCoin, RandomCoinError};
 4
 5use crate::{Felt, Word, ZERO};
 6
 7mod rpo;
 8
 9/// Pseudo-random element generator.
10///
11/// An instance can be used to draw, uniformly at random, basefield elements as well as `Word`s.
12pub trait FeltRng {
13    /// Draw, uniformly at random, a basefield element.
14    fn draw_element(&mut self) -> Felt;
15
16    /// Draw, uniformly at random, a `Word`.
17    fn draw_word(&mut self) -> Word;
18}