/// Verifies that a threshold secret key is consistent with the given public
/// coefficients.
///
/// # Returns
/// true iff the threshold secret key is consistent, i.e. if the public key
/// corresponding to the secret key is on the polynomial defined by the public
/// coefficients.
Verifies that a threshold secret key is consistent with the given public
coefficients.
Verifies that a threshold secret key is consistent with the given public coefficients .
pub fn secret_key_is_consistent(
    secret: SecretKey,
    public_coefficients: &PublicCoefficients,
    index: NodeIndex,
) -> bool {
    // According to the public coefficients:
    let x = x_for_index(index);
    let mut y = public_coefficients.evaluate_at(&x);
    // According to the secret share:
    let neg_secret = secret.neg();
    let neg_pub = G2Projective::generator() * neg_secret;
    // Compare:
    y.add_assign(&neg_pub);
    bool::from(y.is_identity())
}
pub fn secret_key_is_consistent ( secret : SecretKey , public_coefficients : & PublicCoefficients , index : NodeIndex , ) -> bool { // According to the public coefficients: let x = x_for_index ( index ) ; let mut y = public_coefficients . evaluate_at ( & x ) ; // According to the secret share: let neg_secret = secret . neg ( ) ; let neg_pub = G2Projective :: generator ( ) * neg_secret ; // Compare: y . add_assign ( & neg_pub ) ; bool :: from ( y . is_identity ( ) ) }
Verifies that a threshold secret key is consistent with the given public
coefficients.
Verifies that a threshold secret key is consistent with the given public coefficients .
true iff the threshold secret key is consistent, i.e. if the public key
corresponding to the secret key is on the polynomial defined by the public
coefficients.
true iff the threshold secret key is consistent i . e . if the public key corresponding to the secret key is on the polynomial defined by the public coefficients .
secret
SecretKey
public_coefficients
&PublicCoefficients
index
NodeIndex