pub fn fill_rpool_secp256k1(
    mut own_dh_secrets: Vec<Secp256k1Scalar>,
    other_dh_publics: &[Secp256k1Point],
    paillier_pk: &EncryptionKey,
) -> Result<(), ()> {
    if own_dh_secrets.len() != other_dh_publics.len() {
        return Err(());
    }
    // sequentially for wasm, else parallel
    #[cfg(feature = "wasm")]
    for i in 0..own_dh_secrets.len() {
        if let Ok(r) = other_dh_publics[i].scalar_mul(&own_dh_secrets[i].fe) {
            RPOOL_SECP256K1.push((r.to_bigint(), (Utc::now(), own_dh_secrets[i].to_bigint())));
        }
    }
    #[cfg(not(feature = "wasm"))]
    (0..own_dh_secrets.len()).into_par_iter().for_each(|i| {
        if let Ok(r) = other_dh_publics[i].scalar_mul(&own_dh_secrets[i].fe) {
            RPOOL_SECP256K1.push((r.to_bigint(), (Utc::now(), own_dh_secrets[i].to_bigint())));
        };
    });
    for i in &mut own_dh_secrets {
        i.zeroize();
    }
    fill_pool_paillier(own_dh_secrets.len(), paillier_pk);
    Ok(())
}
/// fill pool of random and nonce values for secp256k1 as well as random values for Paillier
fill pool of random and nonce values for secp256k1 as well as random values for Paillier
fill pool of random and nonce values for secp256k1 as well as random values for Paillier
pub fn fill_rpool_secp256k1(
    mut own_dh_secrets: Vec<Secp256k1Scalar>,
    other_dh_publics: &[Secp256k1Point],
    paillier_pk: &EncryptionKey,
) -> Result<(), ()> {
    if own_dh_secrets.len() != other_dh_publics.len() {
        return Err(());
    }
    // sequentially for wasm, else parallel
    #[cfg(feature = "wasm")]
    for i in 0..own_dh_secrets.len() {
        if let Ok(r) = other_dh_publics[i].scalar_mul(&own_dh_secrets[i].fe) {
            RPOOL_SECP256K1.push((r.to_bigint(), (Utc::now(), own_dh_secrets[i].to_bigint())));
        }
    }
    #[cfg(not(feature = "wasm"))]
    (0..own_dh_secrets.len()).into_par_iter().for_each(|i| {
        if let Ok(r) = other_dh_publics[i].scalar_mul(&own_dh_secrets[i].fe) {
            RPOOL_SECP256K1.push((r.to_bigint(), (Utc::now(), own_dh_secrets[i].to_bigint())));
        };
    });
    for i in &mut own_dh_secrets {
        i.zeroize();
    }
    fill_pool_paillier(own_dh_secrets.len(), paillier_pk);
    Ok(())
}
pub fn fill_rpool_secp256k1 ( mut own_dh_secrets : Vec < Secp256k1Scalar > , other_dh_publics : & [ Secp256k1Point ] , paillier_pk : & EncryptionKey , ) -> Result < ( ) , ( ) > { if own_dh_secrets . len ( ) != other_dh_publics . len ( ) { return Err ( ( ) ) ; } // sequentially for wasm, else parallel # [ cfg ( feature " " ) ] for i in 0 .. own_dh_secrets . len ( ) { if let Ok ( r ) = other_dh_publics [ i ] . scalar_mul ( & own_dh_secrets [ i ] . fe ) { RPOOL_SECP256K1 . push ( ( r . to_bigint ( ) , ( Utc :: now ( ) , own_dh_secrets [ i ] . to_bigint ( ) ) ) ) ; } } # [ cfg ( not ( feature " " ) ) ] ( 0 .. own_dh_secrets . len ( ) ) . into_par_iter ( ) . for_each ( | i | { if let Ok ( r ) = other_dh_publics [ i ] . scalar_mul ( & own_dh_secrets [ i ] . fe ) { RPOOL_SECP256K1 . push ( ( r . to_bigint ( ) , ( Utc :: now ( ) , own_dh_secrets [ i ] . to_bigint ( ) ) ) ) ; } ; } ) ; for i in & mut own_dh_secrets { i . zeroize ( ) ; } fill_pool_paillier ( own_dh_secrets . len ( ) , paillier_pk ) ; Ok ( ( ) ) }
fill pool of random and nonce values for secp256k1 as well as random values for Paillier
fill pool of random and nonce values for secp256k1 as well as random values for Paillier
own_dh_secrets
Vec<Secp256k1Scalar>
other_dh_publics
&[Secp256k1Point]
paillier_pk
&EncryptionKey