/// Verifies an individual or combined signature against the provided public
/// key.
// TODO(DFN-1408): Optimize signature verification by combining the miller
// loops inside the pairings, thus performing only a single final
// exponentiation.
Verifies an individual or combined signature against the provided public
key.
TODO(DFN-1408): Optimize signature verification by combining the miller
loops inside the pairings, thus performing only a single final
exponentiation.
Verifies an individual or combined signature against the provided public key . TODO ( DFN - 1408 ) : Optimize signature verification by combining the miller loops inside the pairings thus performing only a single final exponentiation .
fn verify(message: &[u8], signature: Signature, public_key: PublicKey) -> Result<(), ()> {
    let point = hash_message_to_g1(message);
    if Bls12::pairing(&signature.into(), &G2Affine::generator())
        == Bls12::pairing(&point.into(), &public_key.0.into())
    {
        Ok(())
    } else {
        Err(())
    }
}
fn verify ( message : & [ u8 ] , signature : Signature , public_key : PublicKey ) -> Result < ( ) , ( ) > { let point = hash_message_to_g1 ( message ) ; if Bls12 :: pairing ( & signature . into ( ) , & G2Affine :: generator ( ) ) == Bls12 :: pairing ( & point . into ( ) , & public_key . 0 . into ( ) ) { Ok ( ( ) ) } else { Err ( ( ) ) } }
Verifies an individual or combined signature against the provided public
key.
Verifies an individual or combined signature against the provided public key .
message
&[u8]
signature
Signature
public_key
PublicKey