pub fn verify<B: AsRef<[u8]>>(&self, data: &[(PublicKey, B)]) -> Choice {
        if self.is_invalid().unwrap_u8() == 1 {
            return Choice::from(0u8);
        }

        #[cfg(not(any(feature = "alloc", feature = "std")))]
        fn core_aggregate_verify<B: AsRef<[u8]>>(
            sig: &G1Projective,
            data: &[(PublicKey, B)],
        ) -> Choice {
            use bls12_381_plus::{pairing, Gt};

            let mut res = Gt::identity();
            for (key, msg) in data {
                if key.is_invalid().unwrap_u8() == 1 {
                    return Choice::from(0u8);
                }
                let a = Signature::hash_msg(msg.as_ref());
                res += pairing(&a.to_affine(), &key.0.to_affine());
            }
            res += pairing(&sig.to_affine(), &G2Affine::generator().neg());
            res.is_identity()
        }
        #[cfg(any(feature = "alloc"))]
        fn core_aggregate_verify<B: AsRef<[u8]>>(
            sig: &G1Projective,
            data: &[(PublicKey, B)],
        ) -> Choice {
            use alloc::vec::Vec;
            use bls12_381_plus::{multi_miller_loop, G2Prepared};

            if data.iter().any(|(k, _)| k.is_invalid().unwrap_u8() == 1) {
                return Choice::from(0u8);
            }

            let mut data = data
                .iter()
                .map(|(key, m)| {
                    (
                        Signature::hash_msg(m.as_ref()).to_affine(),
                        G2Prepared::from(key.0.to_affine()),
                    )
                })
                .collect::<Vec<(G1Affine, G2Prepared)>>();

            data.push((
                sig.to_affine(),
                G2Prepared::from(G2Affine::generator().neg()),
            ));
            // appease borrow checker
            let t = data
                .iter()
                .map(|(p1, p2)| (p1, p2))
                .collect::<Vec<(&G1Affine, &G2Prepared)>>();
            multi_miller_loop(t.as_slice())
                .final_exponentiation()
                .is_identity()
        }
        core_aggregate_verify(&self.0, data)
    }
/// Verify this multi signature is over `msg` with the multi public key
Verify this multi signature is over `msg` with the multi public key
Verify this multi signature is over ` msg ` with the multi public key
pub fn verify<B: AsRef<[u8]>>(&self, data: &[(PublicKey, B)]) -> Choice {
        if self.is_invalid().unwrap_u8() == 1 {
            return Choice::from(0u8);
        }
        #[cfg(not(any(feature = "alloc", feature = "std")))]
        fn core_aggregate_verify<B: AsRef<[u8]>>(
            sig: &G1Projective,
            data: &[(PublicKey, B)],
        ) -> Choice {
            use bls12_381_plus::{pairing, Gt};
            let mut res = Gt::identity();
            for (key, msg) in data {
                if key.is_invalid().unwrap_u8() == 1 {
                    return Choice::from(0u8);
                }
                let a = Signature::hash_msg(msg.as_ref());
                res += pairing(&a.to_affine(), &key.0.to_affine());
            }
            res += pairing(&sig.to_affine(), &G2Affine::generator().neg());
            res.is_identity()
        }
        #[cfg(any(feature = "alloc"))]
        fn core_aggregate_verify<B: AsRef<[u8]>>(
            sig: &G1Projective,
            data: &[(PublicKey, B)],
        ) -> Choice {
            use alloc::vec::Vec;
            use bls12_381_plus::{multi_miller_loop, G2Prepared};
            if data.iter().any(|(k, _)| k.is_invalid().unwrap_u8() == 1) {
                return Choice::from(0u8);
            }
            let mut data = data
                .iter()
                .map(|(key, m)| {
                    (
                        Signature::hash_msg(m.as_ref()).to_affine(),
                        G2Prepared::from(key.0.to_affine()),
                    )
                })
                .collect::<Vec<(G1Affine, G2Prepared)>>();
            data.push((
                sig.to_affine(),
                G2Prepared::from(G2Affine::generator().neg()),
            ));
            // appease borrow checker
            let t = data
                .iter()
                .map(|(p1, p2)| (p1, p2))
                .collect::<Vec<(&G1Affine, &G2Prepared)>>();
            multi_miller_loop(t.as_slice())
                .final_exponentiation()
                .is_identity()
        }
        core_aggregate_verify(&self.0, data)
    }
pub fn verify < B : AsRef < [ u8 ] > > ( & self , data : & [ ( PublicKey , B ) ] ) -> Choice { if self . is_invalid ( ) . unwrap_u8 ( ) == 1 { return Choice :: from ( 0u8 ) ; } # [ cfg ( not ( any ( feature " " feature " " ) ) ) ] fn core_aggregate_verify < B : AsRef < [ u8 ] > > ( sig : & G1Projective , data : & [ ( PublicKey , B ) ] , ) -> Choice { use bls12_381_plus :: { pairing , Gt } ; let mut res = Gt :: identity ( ) ; for ( key , msg ) in data { if key . is_invalid ( ) . unwrap_u8 ( ) == 1 { return Choice :: from ( 0u8 ) ; } let a = Signature :: hash_msg ( msg . as_ref ( ) ) ; res += pairing ( & a . to_affine ( ) , & key . 0 . to_affine ( ) ) ; } res += pairing ( & sig . to_affine ( ) , & G2Affine :: generator ( ) . neg ( ) ) ; res . is_identity ( ) } # [ cfg ( any ( feature " " ) ) ] fn core_aggregate_verify < B : AsRef < [ u8 ] > > ( sig : & G1Projective , data : & [ ( PublicKey , B ) ] , ) -> Choice { use alloc :: vec :: Vec ; use bls12_381_plus :: { multi_miller_loop , G2Prepared } ; if data . iter ( ) . any ( | ( k , _ ) | k . is_invalid ( ) . unwrap_u8 ( ) == 1 ) { return Choice :: from ( 0u8 ) ; } let mut data = data . iter ( ) . map ( | ( key , m ) | { ( Signature :: hash_msg ( m . as_ref ( ) ) . to_affine ( ) , G2Prepared :: from ( key . 0 . to_affine ( ) ) , ) } ) . collect :: < Vec < ( G1Affine , G2Prepared ) > > ( ) ; data . push ( ( sig . to_affine ( ) , G2Prepared :: from ( G2Affine :: generator ( ) . neg ( ) ) , ) ) ; // appease borrow checker let t = data . iter ( ) . map ( | ( p1 , p2 ) | ( p1 , p2 ) ) . collect :: < Vec < ( & G1Affine , & G2Prepared ) > > ( ) ; multi_miller_loop ( t . as_slice ( ) ) . final_exponentiation ( ) . is_identity ( ) } core_aggregate_verify ( & self . 0 , data ) }
Verify this multi signature is over `msg` with the multi public key
Verify this multi signature is over ` msg ` with the multi public key
&self
data
&[(PublicKey, B)]