pub trait RandomGenerator<T> {
// Required method
fn generate_random() -> Result<T, Box<dyn Error>>;
}
Expand description
Defines a trait for generating random values of a given type.
This trait is intended to abstract the generation of random values
for different types, providing a uniform interface.
Generates a random value of type T.
A Result containing the random value of type T, or an error
if the generation fails.
Returns an error if the random value generation fails.
Generates a random BigUint.
A Result containing the random BigUint, or an error if the generation fails.
Returns an error if the conversion from bytes to BigUint fails.
Generates a random Fq.
A Result containing the random Fq, or an error if the generation fails.
Returns an error if the conversion from bytes to Fq fails.
Generates a random Fp.
A Result containing the random Fp, or an error if the generation fails.
Returns an error if the conversion from bytes to Fp fails.
Generates a random Ep.
A Result containing the random Ep, or an error if the generation fails.
Returns an error if the conversion from bytes to Ep fails.
Generates a random Scalar.
A Result containing the random Scalar, or an error if the generation fails.
Returns an error if the conversion from bytes to Scalar fails.
Generates a random RistrettoPoint.
A Result containing the random RistrettoPoint, or an error if the generation fails.
Returns an error if the conversion from bytes to RistrettoPoint fails.
Generates a random Fq.
A Result containing the random Fq, or an error if the generation fails.
Returns an error if the conversion from bytes to Fq fails.