fn create_pop_data<'a, R: Rng + CryptoRng>(
    rng: &mut R,
    dkg_id: IDkgId,
    secret_key: &EphemeralSecretKey,
    sender: &'a [u8],
) -> PopData<'a> {
    let public_key = EphemeralPublicKey::from(secret_key);
    let public_key_bytes = EphemeralPublicKeyBytes::from(&public_key);

    // The plain Schnorr pop would require rewinding in the security proof to
    // ensure we can properly simulate dealings with dishonest receivers. The
    // following element allows to implement a "strong DH"-oracle-type
    // computation in the reduction to CDH.

    // spec_h == spec: H is a hash over the inputs, so effectively it captures what
    // the PoP is making a proof about.
    let h_digest = HDigest::<'a> {
        dkg_id,
        public_key_bytes,
        sender,
    };
    let spec_h: EphemeralPublicKey = h_digest.hash_to_secp256k1();
    let spec_ext: EphemeralPublicKey = spec_h.clone() * secret_key;

    // r is a random value, a nonce.
    let r: EphemeralSecretKey = EphemeralSecretKey::random(rng);
    let c_digest = {
        let spec_t = EphemeralPublicKey::from(&r);
        let spec_u: EphemeralPublicKey = spec_h.clone() * &r;
        ChallengeDigest::<'a> {
            dkg_id,
            h_bytes: EphemeralPublicKeyBytes::from(&spec_h),
            public_key_bytes,
            ext_bytes: EphemeralPublicKeyBytes::from(&spec_ext),
            t_bytes: EphemeralPublicKeyBytes::from(&spec_t),
            u_bytes: EphemeralPublicKeyBytes::from(&spec_u),
            sender,
        }
    };
    let spec_c: EphemeralSecretKey = c_digest.hash_to_secret_key();
    let spec_s = spec_c.clone() * secret_key + &r;
    let pop = EphemeralPop {
        spec_ext,
        spec_c,
        spec_s,
    };
    PopData {
        public_key_bytes,
        pop,
        h_digest,
        c_digest,
    }
}
/// Creates an ephemeral PoP and significant intermediate values.
Creates an ephemeral PoP and significant intermediate values.
Creates an ephemeral PoP and significant intermediate values .
fn create_pop_data<'a, R: Rng + CryptoRng>(
    rng: &mut R,
    dkg_id: IDkgId,
    secret_key: &EphemeralSecretKey,
    sender: &'a [u8],
) -> PopData<'a> {
    let public_key = EphemeralPublicKey::from(secret_key);
    let public_key_bytes = EphemeralPublicKeyBytes::from(&public_key);
    // The plain Schnorr pop would require rewinding in the security proof to
    // ensure we can properly simulate dealings with dishonest receivers. The
    // following element allows to implement a "strong DH"-oracle-type
    // computation in the reduction to CDH.
    // spec_h == spec: H is a hash over the inputs, so effectively it captures what
    // the PoP is making a proof about.
    let h_digest = HDigest::<'a> {
        dkg_id,
        public_key_bytes,
        sender,
    };
    let spec_h: EphemeralPublicKey = h_digest.hash_to_secp256k1();
    let spec_ext: EphemeralPublicKey = spec_h.clone() * secret_key;
    // r is a random value, a nonce.
    let r: EphemeralSecretKey = EphemeralSecretKey::random(rng);
    let c_digest = {
        let spec_t = EphemeralPublicKey::from(&r);
        let spec_u: EphemeralPublicKey = spec_h.clone() * &r;
        ChallengeDigest::<'a> {
            dkg_id,
            h_bytes: EphemeralPublicKeyBytes::from(&spec_h),
            public_key_bytes,
            ext_bytes: EphemeralPublicKeyBytes::from(&spec_ext),
            t_bytes: EphemeralPublicKeyBytes::from(&spec_t),
            u_bytes: EphemeralPublicKeyBytes::from(&spec_u),
            sender,
        }
    };
    let spec_c: EphemeralSecretKey = c_digest.hash_to_secret_key();
    let spec_s = spec_c.clone() * secret_key + &r;
    let pop = EphemeralPop {
        spec_ext,
        spec_c,
        spec_s,
    };
    PopData {
        public_key_bytes,
        pop,
        h_digest,
        c_digest,
    }
}
fn create_pop_data < ' a , R : Rng + CryptoRng > ( rng : & mut R , dkg_id : IDkgId , secret_key : & EphemeralSecretKey , sender : & ' a [ u8 ] , ) -> PopData < ' a > { let public_key = EphemeralPublicKey :: from ( secret_key ) ; let public_key_bytes = EphemeralPublicKeyBytes :: from ( & public_key ) ; // The plain Schnorr pop would require rewinding in the security proof to // ensure we can properly simulate dealings with dishonest receivers. The // following element allows to implement a "strong DH"-oracle-type // computation in the reduction to CDH. // spec_h == spec: H is a hash over the inputs, so effectively it captures what // the PoP is making a proof about. let h_digest = HDigest :: < ' a > { dkg_id , public_key_bytes , sender , } ; let spec_h : EphemeralPublicKey = h_digest . hash_to_secp256k1 ( ) ; let spec_ext : EphemeralPublicKey = spec_h . clone ( ) * secret_key ; // r is a random value, a nonce. let r : EphemeralSecretKey = EphemeralSecretKey :: random ( rng ) ; let c_digest = { let spec_t = EphemeralPublicKey :: from ( & r ) ; let spec_u : EphemeralPublicKey = spec_h . clone ( ) * & r ; ChallengeDigest :: < ' a > { dkg_id , h_bytes : EphemeralPublicKeyBytes :: from ( & spec_h ) , public_key_bytes , ext_bytes : EphemeralPublicKeyBytes :: from ( & spec_ext ) , t_bytes : EphemeralPublicKeyBytes :: from ( & spec_t ) , u_bytes : EphemeralPublicKeyBytes :: from ( & spec_u ) , sender , } } ; let spec_c : EphemeralSecretKey = c_digest . hash_to_secret_key ( ) ; let spec_s = spec_c . clone ( ) * secret_key + & r ; let pop = EphemeralPop { spec_ext , spec_c , spec_s , } ; PopData { public_key_bytes , pop , h_digest , c_digest , } }
Creates an ephemeral PoP and significant intermediate values.
Creates an ephemeral PoP and significant intermediate values .
rng
&mut R
dkg_id
IDkgId
secret_key
&EphemeralSecretKey
sender
&'a [u8]
rng
&mut R
dkg_id
IDkgId
secret_key
&EphemeralSecretKey
sender
&'a [u8]