pub fn verify_threshold_signature(
    signature: &ThresholdEcdsaCombinedSigInternal,
    derivation_path: &DerivationPath,
    hashed_message: &[u8],
    randomness: Randomness,
    presig_transcript: &IDkgTranscriptInternal,
    key_transcript: &IDkgTranscriptInternal,
    algorithm_id: AlgorithmId,
) -> Result<(), ThresholdEcdsaVerifySignatureInternalError> {
    let (curve_type, hash_len) = signature_parameters(algorithm_id)
        .ok_or(ThresholdEcdsaVerifySignatureInternalError::UnsupportedAlgorithm)?;

    if hashed_message.len() != hash_len {
        return Err(ThresholdEcdsaVerifySignatureInternalError::UnsupportedAlgorithm);
    }

    let accept = signature.verify(
        derivation_path,
        hashed_message,
        randomness,
        presig_transcript,
        key_transcript,
        curve_type,
    )?;

    if !accept {
        return Err(ThresholdEcdsaVerifySignatureInternalError::InvalidSignature);
    }

    Ok(())
}
/// Verify a threshold ECDSA signature
///
/// In addition to checking that the ECDSA signature itself is
/// consistent with the provided message and the public key associated
/// with `derivation_path`, this function also verifies that the
/// signature was generated correctly with regards to the provided
/// presignature transcript and randomness.
Verify a threshold ECDSA signature
In addition to checking that the ECDSA signature itself is
consistent with the provided message and the public key associated
with `derivation_path`, this function also verifies that the
signature was generated correctly with regards to the provided
presignature transcript and randomness.
Verify a threshold ECDSA signature In addition to checking that the ECDSA signature itself is consistent with the provided message and the public key associated with ` derivation_path ` this function also verifies that the signature was generated correctly with regards to the provided presignature transcript and randomness .
pub fn verify_threshold_signature(
    signature: &ThresholdEcdsaCombinedSigInternal,
    derivation_path: &DerivationPath,
    hashed_message: &[u8],
    randomness: Randomness,
    presig_transcript: &IDkgTranscriptInternal,
    key_transcript: &IDkgTranscriptInternal,
    algorithm_id: AlgorithmId,
) -> Result<(), ThresholdEcdsaVerifySignatureInternalError> {
    let (curve_type, hash_len) = signature_parameters(algorithm_id)
        .ok_or(ThresholdEcdsaVerifySignatureInternalError::UnsupportedAlgorithm)?;
    if hashed_message.len() != hash_len {
        return Err(ThresholdEcdsaVerifySignatureInternalError::UnsupportedAlgorithm);
    }
    let accept = signature.verify(
        derivation_path,
        hashed_message,
        randomness,
        presig_transcript,
        key_transcript,
        curve_type,
    )?;
    if !accept {
        return Err(ThresholdEcdsaVerifySignatureInternalError::InvalidSignature);
    }
    Ok(())
}
pub fn verify_threshold_signature ( signature : & ThresholdEcdsaCombinedSigInternal , derivation_path : & DerivationPath , hashed_message : & [ u8 ] , randomness : Randomness , presig_transcript : & IDkgTranscriptInternal , key_transcript : & IDkgTranscriptInternal , algorithm_id : AlgorithmId , ) -> Result < ( ) , ThresholdEcdsaVerifySignatureInternalError > { let ( curve_type , hash_len ) = signature_parameters ( algorithm_id ) . ok_or ( ThresholdEcdsaVerifySignatureInternalError :: UnsupportedAlgorithm ) ? ; if hashed_message . len ( ) != hash_len { return Err ( ThresholdEcdsaVerifySignatureInternalError :: UnsupportedAlgorithm ) ; } let accept = signature . verify ( derivation_path , hashed_message , randomness , presig_transcript , key_transcript , curve_type , ) ? ; if ! accept { return Err ( ThresholdEcdsaVerifySignatureInternalError :: InvalidSignature ) ; } Ok ( ( ) ) }
Verify a threshold ECDSA signature
In addition to checking that the ECDSA signature itself is
consistent with the provided message and the public key associated
with `derivation_path`, this function also verifies that the
signature was generated correctly with regards to the provided
presignature transcript and randomness.
Verify a threshold ECDSA signature In addition to checking that the ECDSA signature itself is consistent with the provided message and the public key associated with ` derivation_path ` this function also verifies that the signature was generated correctly with regards to the provided presignature transcript and randomness .
signature
&ThresholdEcdsaCombinedSigInternal
derivation_path
&DerivationPath
hashed_message
&[u8]
randomness
Randomness
presig_transcript
&IDkgTranscriptInternal
key_transcript
&IDkgTranscriptInternal
algorithm_id
AlgorithmId
signature
&ThresholdEcdsaCombinedSigInternal
derivation_path
&DerivationPath
hashed_message
&[u8]
randomness
Randomness
presig_transcript
&IDkgTranscriptInternal
key_transcript
&IDkgTranscriptInternal
algorithm_id
AlgorithmId