pub fn verify_combined(
    message: &[u8],
    signature: CombinedSignatureBytes,
    public_keys: &[PublicKeyBytes],
) -> Result<(), CryptoError> {
    let public_keys: Result<Vec<PublicKey>, CryptoError> =
        public_keys.iter().cloned().map(|x| x.try_into()).collect();
    if crypto::verify_combined_message_signature(message, signature.try_into()?, &public_keys?[..])
    {
        Ok(())
    } else {
        Err(CryptoError::SignatureVerification {
            algorithm: AlgorithmId::MultiBls12_381,
            public_key_bytes: Vec::new(),
            sig_bytes: signature.0.to_vec(),
            internal_error: "Verification of multisignature failed".to_string(),
        })
    }
}
/// Verifies a combined multisignature over the given `message` using the given
/// array of `public_keys`.
///
/// # Errors
/// * `CryptoError::MalformedSignature` if the `signature` cannot be parsed as a
///   G1 point.
/// * `CryptoError::MalformedPublicKey` if any of the `public_keys` cannot be
///   parsed as a valid G2 point.
/// * `CryptoError::SignatureVerification` if verification of the signature
///   fails.
Verifies a combined multisignature over the given `message` using the given
array of `public_keys`.
Verifies a combined multisignature over the given ` message ` using the given array of ` public_keys ` .
pub fn verify_combined(
    message: &[u8],
    signature: CombinedSignatureBytes,
    public_keys: &[PublicKeyBytes],
) -> Result<(), CryptoError> {
    let public_keys: Result<Vec<PublicKey>, CryptoError> =
        public_keys.iter().cloned().map(|x| x.try_into()).collect();
    if crypto::verify_combined_message_signature(message, signature.try_into()?, &public_keys?[..])
    {
        Ok(())
    } else {
        Err(CryptoError::SignatureVerification {
            algorithm: AlgorithmId::MultiBls12_381,
            public_key_bytes: Vec::new(),
            sig_bytes: signature.0.to_vec(),
            internal_error: "Verification of multisignature failed".to_string(),
        })
    }
}
pub fn verify_combined ( message : & [ u8 ] , signature : CombinedSignatureBytes , public_keys : & [ PublicKeyBytes ] , ) -> Result < ( ) , CryptoError > { let public_keys : Result < Vec < PublicKey > , CryptoError > = public_keys . iter ( ) . cloned ( ) . map ( | x | x . try_into ( ) ) . collect ( ) ; if crypto :: verify_combined_message_signature ( message , signature . try_into ( ) ? , & public_keys ? [ .. ] ) { Ok ( ( ) ) } else { Err ( CryptoError :: SignatureVerification { algorithm : AlgorithmId :: MultiBls12_381 , public_key_bytes : Vec :: new ( ) , sig_bytes : signature . 0 . to_vec ( ) , internal_error : " " . to_string ( ) , } ) } }
Verifies a combined multisignature over the given `message` using the given
array of `public_keys`.
Verifies a combined multisignature over the given ` message ` using the given array of ` public_keys ` .
message
&[u8]
signature
CombinedSignatureBytes
public_keys
&[PublicKeyBytes]
message
&[u8]
signature
CombinedSignatureBytes
public_keys
&[PublicKeyBytes]
errors
`CryptoError::MalformedSignature` if the `signature` cannot be parsed as a
G1 point.
`CryptoError::MalformedPublicKey` if any of the `public_keys` cannot be
parsed as a valid G2 point.
`CryptoError::SignatureVerification` if verification of the signature
fails.
` CryptoError :: MalformedSignature ` if the ` signature ` cannot be parsed as a G1 point . ` CryptoError :: MalformedPublicKey ` if any of the ` public_keys ` cannot be parsed as a valid G2 point . ` CryptoError :: SignatureVerification ` if verification of the signature fails .