pub(crate) fn generate_random<R: RngCore + CryptoRng>(rng: &mut R) -> Self {
        let sk = G::random_scalar(rng);
        let sk_bytes = G::scalar_as_bytes(&sk);
        let pk = G::base_point().mult_by_slice(&sk_bytes);
        Self {
            pk: Key(pk.to_arr().to_vec()),
            sk: Key(sk_bytes.to_vec()),
            _g: PhantomData,
        }
    }
/// Generating a random key pair given a cryptographic rng
Generating a random key pair given a cryptographic rng
Generating a random key pair given a cryptographic rng
pub(crate) fn generate_random<R: RngCore + CryptoRng>(rng: &mut R) -> Self {
        let sk = G::random_scalar(rng);
        let sk_bytes = G::scalar_as_bytes(&sk);
        let pk = G::base_point().mult_by_slice(&sk_bytes);
        Self {
            pk: Key(pk.to_arr().to_vec()),
            sk: Key(sk_bytes.to_vec()),
            _g: PhantomData,
        }
    }
pub ( crate ) fn generate_random < R : RngCore + CryptoRng > ( rng : & mut R ) -> Self { let sk = G :: random_scalar ( rng ) ; let sk_bytes = G :: scalar_as_bytes ( & sk ) ; let pk = G :: base_point ( ) . mult_by_slice ( & sk_bytes ) ; Self { pk : Key ( pk . to_arr ( ) . to_vec ( ) ) , sk : Key ( sk_bytes . to_vec ( ) ) , _g : PhantomData , } }
Generating a random key pair given a cryptographic rng
Generating a random key pair given a cryptographic rng
rng
&mut R
rng
&mut R