pub fn keygen(
    seed: Randomness,
    threshold: NumberOfNodes,
    share_indices: &[bool],
) -> Result<(PublicCoefficients, Vec<Option<SecretKey>>), InvalidArgumentError> {
    verify_keygen_args(threshold, share_indices)?;
    let mut rng = ChaChaRng::from_seed(seed.get());
    let polynomial = Polynomial::random(threshold.get() as usize, &mut rng);
    Ok(keygen_from_polynomial(polynomial, share_indices))
}
/// Generates keys for a (t,n)-threshold signature scheme.
///
/// At least `t=threshold` contributions out of `n` are required to combine
/// the individual signatures.
///
/// The API supports dealing the n shares to a subset of N>=n actors by using a
/// vector to indicate which of the N actors should receive shares.
///
/// The `n` individual secret keys consist of the evaluation of a
/// random polynomial of length `threshold` (degree `threshold-1`) at a fixed
/// set of points. The public key consists of the group elements `C_i=[c_i]*G`
/// resulting from the scalar multiplication of the base point `G` with the
/// coefficients `c_i` of the polynomial. We denote them as
/// "public_coefficients".
///
/// # Arguments
/// * `seed` - randomness used to seed the PRNG for generating the polynomial.
///   It must be treated as a secret.
/// * `threshold` - the minimum number of individual signatures that can be
///   combined into a valid threshold signature.
/// * `share_indices` - a vector with one entry per receiver.  The entry is true
///   iff the receiver is eligible to receive a threshold key.
///
/// # Errors
/// * `InvalidArgumentError` if
///   - The number of share indices is too large to be stored as type
///     `NumberOfNodes`.
///   - The number of eligible receivers is below the threshold; under these
///     circumstances the receivers could never generate a valid threshold key.
Generates keys for a (t,n)-threshold signature scheme.
At least `t=threshold` contributions out of `n` are required to combine
the individual signatures.

The API supports dealing the n shares to a subset of N>=n actors by using a
vector to indicate which of the N actors should receive shares.


Generates keys for a ( t n ) - threshold signature scheme . At least ` t = threshold ` contributions out of ` n ` are required to combine the individual signatures . The API supports dealing the n shares to a subset of N > = n actors by using a vector to indicate which of the N actors should receive shares .
pub fn keygen(
    seed: Randomness,
    threshold: NumberOfNodes,
    share_indices: &[bool],
) -> Result<(PublicCoefficients, Vec<Option<SecretKey>>), InvalidArgumentError> {
    verify_keygen_args(threshold, share_indices)?;
    let mut rng = ChaChaRng::from_seed(seed.get());
    let polynomial = Polynomial::random(threshold.get() as usize, &mut rng);
    Ok(keygen_from_polynomial(polynomial, share_indices))
}
pub fn keygen ( seed : Randomness , threshold : NumberOfNodes , share_indices : & [ bool ] , ) -> Result < ( PublicCoefficients , Vec < Option < SecretKey > > ) , InvalidArgumentError > { verify_keygen_args ( threshold , share_indices ) ? ; let mut rng = ChaChaRng :: from_seed ( seed . get ( ) ) ; let polynomial = Polynomial :: random ( threshold . get ( ) as usize , & mut rng ) ; Ok ( keygen_from_polynomial ( polynomial , share_indices ) ) }
Generates keys for a (t,n)-threshold signature scheme.
Generates keys for a ( t n ) - threshold signature scheme .
seed
Randomness
threshold
NumberOfNodes
share_indices
&[bool]
seed
Randomness
threshold
NumberOfNodes
share_indices
&[bool]
errors
`InvalidArgumentError` if
The number of share indices is too large to be stored as type
`NumberOfNodes`.
The number of eligible receivers is below the threshold; under these
circumstances the receivers could never generate a valid threshold key.
` InvalidArgumentError ` if The number of share indices is too large to be stored as type ` NumberOfNodes ` . The number of eligible receivers is below the threshold ; under these circumstances the receivers could never generate a valid threshold key .