Skip to main content

RandomWith

Trait RandomWith 

Source
pub trait RandomWith<D: Clone>: Sized {
    // Required method
    fn random_with(rng: impl CryptoRngCore, data: D) -> Self;

    // Provided methods
    fn random_n_with<Container: FromIterator<Self>>(
        rng: impl CryptoRngCore,
        size: usize,
        data: D,
    ) -> Container { ... }
    fn random_n_with_each<Container: FromIterator<Self>>(
        rng: impl CryptoRngCore,
        all_data: impl IntoExactSizeIterator<Item = D>,
    ) -> Container { ... }
}
Expand description

A trait for getting a random value for a type alongside some data.

Required Methods§

Source

fn random_with(rng: impl CryptoRngCore, data: D) -> Self

Provided Methods§

Source

fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, data: D, ) -> Container

Source

fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_data: impl IntoExactSizeIterator<Item = D>, ) -> Container

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<F: FieldExtension> RandomWith<usize> for Vec<Vec<GlobalFieldKey<F>>>

Source§

fn random_with(rng: impl CryptoRngCore, n_parties: usize) -> Self

Generates n_parties vectors of n_parties - 1 global keys each.

Implementors§

Source§

impl<C: Curve> RandomWith<(usize, Point<C>)> for PointShare<C>

Source§

impl<C: Curve> RandomWith<(Point<C>, Vec<GlobalFieldKey<<C as Curve>::Scalar>>)> for PointShare<C>

Source§

impl<C: Curve> RandomWith<(Point<C>, Vec<Vec<GlobalFieldKey<<C as Curve>::Scalar>>>)> for PointShare<C>

Source§

impl<C: Curve> RandomWith<usize> for PointShare<C>

Source§

impl<C: Curve> RandomWith<Point<C>> for PointShare<C>

Source§

impl<C: Curve> RandomWith<GlobalFieldKey<<C as Curve>::Scalar>> for CurveKey<C>

Source§

impl<C: Curve> RandomWith<Vec<GlobalFieldKey<<C as Curve>::Scalar>>> for PointShare<C>

Source§

impl<C: Curve, M: Positive> RandomWith<(usize, HeapArray<Point<C>, M>)> for PointShares<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<(HeapArray<Point<C>, M>, Vec<GlobalFieldKey<<C as Curve>::Scalar>>)> for PointShares<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<(HeapArray<Point<C>, M>, Vec<Vec<GlobalFieldKey<<C as Curve>::Scalar>>>)> for PointShares<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<usize> for PointShares<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<GlobalFieldKey<<C as Curve>::Scalar>> for CurveKeys<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<HeapArray<Point<C>, M>> for PointShares<C, M>

Source§

impl<C: Curve, M: Positive> RandomWith<Vec<GlobalFieldKey<<C as Curve>::Scalar>>> for PointShares<C, M>

Source§

impl<F: FieldExtension> RandomWith<(usize, SubfieldElement<F>)> for FieldShare<F>

Source§

impl<F: FieldExtension> RandomWith<(SubfieldElement<F>, Vec<GlobalFieldKey<F>>)> for FieldShare<F>

Source§

impl<F: FieldExtension> RandomWith<(SubfieldElement<F>, Vec<Vec<GlobalFieldKey<F>>>)> for FieldShare<F>

Source§

impl<F: FieldExtension> RandomWith<usize> for FieldShare<F>

Source§

impl<F: FieldExtension> RandomWith<SubfieldElement<F>> for FieldShare<F>

Source§

impl<F: FieldExtension> RandomWith<GlobalFieldKey<F>> for FieldShareKey<F>

Source§

impl<F: FieldExtension> RandomWith<Vec<GlobalFieldKey<F>>> for FieldShare<F>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<(usize, HeapArray<SubfieldElement<F>, M>)> for FieldShares<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<(HeapArray<SubfieldElement<F>, M>, Vec<GlobalFieldKey<F>>)> for FieldShares<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<(HeapArray<SubfieldElement<F>, M>, Vec<Vec<GlobalFieldKey<F>>>)> for FieldShares<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<usize> for FieldShares<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<GlobalFieldKey<F>> for FieldShareKeys<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<HeapArray<SubfieldElement<F>, M>> for FieldShares<F, M>

Source§

impl<F: FieldExtension, M: Positive> RandomWith<Vec<GlobalFieldKey<F>>> for FieldShares<F, M>