pub fn new<R>(rng: &mut R) -> Self
    where
        R: CryptoRng + RngCore,
    {
        fn random_nonzero_bytes<R>(rng: &mut R) -> [u8; 64]
        where
            R: CryptoRng + RngCore,
        {
            let mut bytes = [0; 64];
            loop {
                rng.fill_bytes(&mut bytes);
                if bytes != [0; 64] {
                    return bytes;
                }
            }
        }

        // The values of 'hiding' and 'binding' must be non-zero so that commitments are not the
        // identity.
        let hiding = Scalar::from_bytes_wide(&random_nonzero_bytes(rng));
        let binding = Scalar::from_bytes_wide(&random_nonzero_bytes(rng));

        Self { hiding, binding }
    }
/// Generates a new signing nonce.
///
/// Each participant generates signing nonces before performing a signing
/// operation.
Generates a new signing nonce.
Each participant generates signing nonces before performing a signing
operation.
Generates a new signing nonce . Each participant generates signing nonces before performing a signing operation .
pub fn new<R>(rng: &mut R) -> Self
    where
        R: CryptoRng + RngCore,
    {
        fn random_nonzero_bytes<R>(rng: &mut R) -> [u8; 64]
        where
            R: CryptoRng + RngCore,
        {
            let mut bytes = [0; 64];
            loop {
                rng.fill_bytes(&mut bytes);
                if bytes != [0; 64] {
                    return bytes;
                }
            }
        }
        // The values of 'hiding' and 'binding' must be non-zero so that commitments are not the
        // identity.
        let hiding = Scalar::from_bytes_wide(&random_nonzero_bytes(rng));
        let binding = Scalar::from_bytes_wide(&random_nonzero_bytes(rng));
        Self { hiding, binding }
    }
pub fn new < R > ( rng : & mut R ) -> Self where R : CryptoRng + RngCore , { fn random_nonzero_bytes < R > ( rng : & mut R ) -> [ u8 ; 64 ] where R : CryptoRng + RngCore , { let mut bytes = [ 0 ; 64 ] ; loop { rng . fill_bytes ( & mut bytes ) ; if bytes != [ 0 ; 64 ] { return bytes ; } } } // The values of 'hiding' and 'binding' must be non-zero so that commitments are not the // identity. let hiding = Scalar :: from_bytes_wide ( & random_nonzero_bytes ( rng ) ) ; let binding = Scalar :: from_bytes_wide ( & random_nonzero_bytes ( rng ) ) ; Self { hiding , binding } }
Generates a new signing nonce.
Generates a new signing nonce .
rng
&mut R