pub fn check(&self, keys: &[PublicKeyPoP]) -> Result<(), AtmsError> {
        let akey2: Registration<H> = Registration::new(keys)?;
        if self == &akey2.to_avk() {
            return Ok(());
        }
        Err(AtmsError::InvalidAggregation)
    }
/// In order to verify the correctness of a key aggregation, one simply recomputes the aggregation
/// for a given set, and checks that it matches the expected value.
/// # Error
/// The function returns `AtmsError::InvalidPoP` if one of the proofs of possession is invalid,
/// and `AtmsError::RegisterExistingKey` if the input tuple contains a repeated key.
///
/// # Example
/// ```
/// # use atms::multi_sig::{PublicKeyPoP, SigningKey};
/// # use atms::aggregation::Registration;
/// # use atms::AtmsError;
/// # use blake2::Blake2b;
/// # use rand_core::OsRng;
/// # fn main() -> Result<(), AtmsError> {
/// let n = 10; // nr of eligible signers
/// let threshold: usize = n - ((n - 1) / 3);
/// let mut rng = OsRng;
///
/// let mut keyspop: Vec<PublicKeyPoP> = Vec::with_capacity(n);
/// for _ in 0..n {
///     let sk = SigningKey::gen(&mut rng);
///     let pkpop = PublicKeyPoP::from(&sk);
///     keyspop.push(pkpop);
/// }
///
/// let atms_registration = Registration::<Blake2b>::new(&keyspop)?;
/// assert!(atms_registration.to_avk().check(&keyspop).is_ok());
/// # Ok(())
/// # }
/// ```
In order to verify the correctness of a key aggregation, one simply recomputes the aggregation
for a given set, and checks that it matches the expected value.
In order to verify the correctness of a key aggregation one simply recomputes the aggregation for a given set and checks that it matches the expected value .
pub fn check(&self, keys: &[PublicKeyPoP]) -> Result<(), AtmsError> {
        let akey2: Registration<H> = Registration::new(keys)?;
        if self == &akey2.to_avk() {
            return Ok(());
        }
        Err(AtmsError::InvalidAggregation)
    }
pub fn check ( & self , keys : & [ PublicKeyPoP ] ) -> Result < ( ) , AtmsError > { let akey2 : Registration < H > = Registration :: new ( keys ) ? ; if self == & akey2 . to_avk ( ) { return Ok ( ( ) ) ; } Err ( AtmsError :: InvalidAggregation ) }
In order to verify the correctness of a key aggregation, one simply recomputes the aggregation
for a given set, and checks that it matches the expected value.
In order to verify the correctness of a key aggregation one simply recomputes the aggregation for a given set and checks that it matches the expected value .
&self
keys
&[PublicKeyPoP]
error
The function returns `AtmsError::InvalidPoP` if one of the proofs of possession is invalid,
and `AtmsError::RegisterExistingKey` if the input tuple contains a repeated key.
The function returns ` AtmsError :: InvalidPoP ` if one of the proofs of possession is invalid and ` AtmsError :: RegisterExistingKey ` if the input tuple contains a repeated key .
example
None
use atms::multi_sig::{publickeypop, signingkey};
None
use atms::aggregation::registration;
None
use atms::atmserror;
None
use blake2::blake2b;
None
use rand_core::osrng;
None
fn main() -> result<(), atmserror> {
let n = 10; // nr of eligible signers
let threshold: usize = n - ((n - 1) / 3);
let mut rng = OsRng.

let mut keyspop: Vec = Vec::with_capacity(n);
for _ in 0..n {
let sk = SigningKey::gen(&mut rng);
let pkpop = PublicKeyPoP::from(&sk);
keyspop.push(pkpop);
}

let atms_registration = Registration::::new(&keyspop)?;
assert!(atms_registration.to_avk().check(&keyspop).is_ok()).
let n = 10 ; // nr of eligible signers let threshold : usize = n - (( n - 1 ) / 3 ) ; let mut rng = OsRng . let mut keyspop : Vec = Vec :: with_capacity ( n ) ; for _ in 0 .. n { let sk = SigningKey :: gen ( &mut rng ) ; let pkpop = PublicKeyPoP :: from ( &sk ) ; keyspop . push ( pkpop ) ; } let atms_registration = Registration :::: new ( &keyspop ) ? ; assert! ( atms_registration . to_avk () . check ( &keyspop ) . is_ok () ) .
ok(())
None
}
None