fn verify_share_is_bad(
    dkg_id: IDkgId,
    complaint: &CLibComplaint,
    receiver_public_key: &EphemeralPublicKey,
    receiver_index: NodeIndex,
    dealer_public_key: &EphemeralPublicKey,
    public_coefficients: &PublicCoefficients,
    dealt_share: EncryptedShare,
) -> Result<(), DkgVerifyResponseError> {
    let share: ThresholdSecretKey = dh::decrypt_share(
        dkg_id,
        dealer_public_key,
        receiver_public_key,
        complaint.diffie_hellman.clone(),
        dealt_share,
    );
    if secret_key_is_consistent(share, public_coefficients, receiver_index) {
        Err(DkgVerifyResponseError::InvalidResponseError(
            InvalidArgumentError {
                message: "CLibComplaint is about a valid message".to_string(),
            },
        ))
    } else {
        Ok(())
    }
}
/// Verifies that the secret share is inconsistent with the public coefficients
Verifies that the secret share is inconsistent with the public coefficients
Verifies that the secret share is inconsistent with the public coefficients
fn verify_share_is_bad(
    dkg_id: IDkgId,
    complaint: &CLibComplaint,
    receiver_public_key: &EphemeralPublicKey,
    receiver_index: NodeIndex,
    dealer_public_key: &EphemeralPublicKey,
    public_coefficients: &PublicCoefficients,
    dealt_share: EncryptedShare,
) -> Result<(), DkgVerifyResponseError> {
    let share: ThresholdSecretKey = dh::decrypt_share(
        dkg_id,
        dealer_public_key,
        receiver_public_key,
        complaint.diffie_hellman.clone(),
        dealt_share,
    );
    if secret_key_is_consistent(share, public_coefficients, receiver_index) {
        Err(DkgVerifyResponseError::InvalidResponseError(
            InvalidArgumentError {
                message: "CLibComplaint is about a valid message".to_string(),
            },
        ))
    } else {
        Ok(())
    }
}
fn verify_share_is_bad ( dkg_id : IDkgId , complaint : & CLibComplaint , receiver_public_key : & EphemeralPublicKey , receiver_index : NodeIndex , dealer_public_key : & EphemeralPublicKey , public_coefficients : & PublicCoefficients , dealt_share : EncryptedShare , ) -> Result < ( ) , DkgVerifyResponseError > { let share : ThresholdSecretKey = dh :: decrypt_share ( dkg_id , dealer_public_key , receiver_public_key , complaint . diffie_hellman . clone ( ) , dealt_share , ) ; if secret_key_is_consistent ( share , public_coefficients , receiver_index ) { Err ( DkgVerifyResponseError :: InvalidResponseError ( InvalidArgumentError { message : " " . to_string ( ) , } , ) ) } else { Ok ( ( ) ) } }
Verifies that the secret share is inconsistent with the public coefficients
Verifies that the secret share is inconsistent with the public coefficients
dkg_id
IDkgId
complaint
&CLibComplaint
receiver_public_key
&EphemeralPublicKey
receiver_index
NodeIndex
dealer_public_key
&EphemeralPublicKey
public_coefficients
&PublicCoefficients
dealt_share
EncryptedShare
dkg_id
IDkgId
complaint
&CLibComplaint
receiver_public_key
&EphemeralPublicKey
receiver_index
NodeIndex
dealer_public_key
&EphemeralPublicKey
public_coefficients
&PublicCoefficients
dealt_share
EncryptedShare