pub fn random_with_constant<R: CryptoRng + RngCore>(
        constant: EccScalar,
        num_coefficients: usize,
        rng: &mut R,
    ) -> ThresholdEcdsaResult<Self> {
        if num_coefficients == 0 {
            return Err(ThresholdEcdsaError::InvalidArguments(
                "Cannot have degree=0 polynomial with given constant".to_string(),
            ));
        }

        let curve = constant.curve_type();
        let mut coefficients = Vec::with_capacity(num_coefficients);

        coefficients.push(constant);

        for _ in 1..num_coefficients {
            coefficients.push(EccScalar::random(curve, rng)?)
        }

        Self::new(curve, coefficients)
    }
/// Creates a random polynomial with the specified number of coefficients,
/// one of which is the specified constant
Creates a random polynomial with the specified number of coefficients,
one of which is the specified constant
Creates a random polynomial with the specified number of coefficients one of which is the specified constant
pub fn random_with_constant<R: CryptoRng + RngCore>(
        constant: EccScalar,
        num_coefficients: usize,
        rng: &mut R,
    ) -> ThresholdEcdsaResult<Self> {
        if num_coefficients == 0 {
            return Err(ThresholdEcdsaError::InvalidArguments(
                "Cannot have degree=0 polynomial with given constant".to_string(),
            ));
        }
        let curve = constant.curve_type();
        let mut coefficients = Vec::with_capacity(num_coefficients);
        coefficients.push(constant);
        for _ in 1..num_coefficients {
            coefficients.push(EccScalar::random(curve, rng)?)
        }
        Self::new(curve, coefficients)
    }
pub fn random_with_constant < R : CryptoRng + RngCore > ( constant : EccScalar , num_coefficients : usize , rng : & mut R , ) -> ThresholdEcdsaResult < Self > { if num_coefficients == 0 { return Err ( ThresholdEcdsaError :: InvalidArguments ( " " . to_string ( ) , ) ) ; } let curve = constant . curve_type ( ) ; let mut coefficients = Vec :: with_capacity ( num_coefficients ) ; coefficients . push ( constant ) ; for _ in 1 .. num_coefficients { coefficients . push ( EccScalar :: random ( curve , rng ) ? ) } Self :: new ( curve , coefficients ) }
Creates a random polynomial with the specified number of coefficients,
one of which is the specified constant
Creates a random polynomial with the specified number of coefficients one of which is the specified constant
constant
EccScalar
num_coefficients
usize
rng
&mut R
constant
EccScalar
num_coefficients
usize
rng
&mut R