pub fn pop_data_should_match(seed: Randomness, dkg_id: IDkgId, sender: &[u8]) {
        let mut rng = ChaChaRng::from_seed(seed.get());
        let secret_key = EphemeralSecretKey::random(&mut rng);

        let left = create_pop_data(&mut rng, dkg_id, &secret_key, sender);
        let right = {
            let pop_bytes = EphemeralPopBytes::from(&left.pop);
            verification_pop_data(dkg_id, sender, (left.public_key_bytes, pop_bytes))
                .expect("Verification failed")
        };

        if left != right {
            panic!("Pop data does not match:\n\n{:#?}\n\n{:#?}", left, right);
        }
    }
/// By design, it is hard to determine why a PoP verification has failed.
/// It is constituted of hashes and if a hash does not match it should
/// not be possible to determine from the hash output which of the
/// inputs to the hash are different.  That is great, but makes problems
/// hard to debug. Here we compare the intermediate values so that we
/// can diagnose problems easily.
By design, it is hard to determine why a PoP verification has failed.
It is constituted of hashes and if a hash does not match it should
not be possible to determine from the hash output which of the
inputs to the hash are different.  That is great, but makes problems
hard to debug. Here we compare the intermediate values so that we
can diagnose problems easily.
By design it is hard to determine why a PoP verification has failed . It is constituted of hashes and if a hash does not match it should not be possible to determine from the hash output which of the inputs to the hash are different . That is great but makes problems hard to debug . Here we compare the intermediate values so that we can diagnose problems easily .
pub fn pop_data_should_match(seed: Randomness, dkg_id: IDkgId, sender: &[u8]) {
        let mut rng = ChaChaRng::from_seed(seed.get());
        let secret_key = EphemeralSecretKey::random(&mut rng);
        let left = create_pop_data(&mut rng, dkg_id, &secret_key, sender);
        let right = {
            let pop_bytes = EphemeralPopBytes::from(&left.pop);
            verification_pop_data(dkg_id, sender, (left.public_key_bytes, pop_bytes))
                .expect("Verification failed")
        };
        if left != right {
            panic!("Pop data does not match:\n\n{:#?}\n\n{:#?}", left, right);
        }
    }
pub fn pop_data_should_match ( seed : Randomness , dkg_id : IDkgId , sender : & [ u8 ] ) { let mut rng = ChaChaRng :: from_seed ( seed . get ( ) ) ; let secret_key = EphemeralSecretKey :: random ( & mut rng ) ; let left = create_pop_data ( & mut rng , dkg_id , & secret_key , sender ) ; let right = { let pop_bytes = EphemeralPopBytes :: from ( & left . pop ) ; verification_pop_data ( dkg_id , sender , ( left . public_key_bytes , pop_bytes ) ) . expect ( " " ) } ; if left != right { panic ! ( " \n \n \n \n " left right ) ; } }
By design, it is hard to determine why a PoP verification has failed.
By design it is hard to determine why a PoP verification has failed .
seed
Randomness
dkg_id
IDkgId
sender
&[u8]
seed
Randomness
dkg_id
IDkgId
sender
&[u8]