macro_rules! derive_nonce_rng {
    (
        nonce_gen => $nonce_gen:expr,
        secret => $secret:expr,
        public => [$($public:expr),+],
        seedable_rng => $rng:ty$(,)?
    ) => { ... };
}
Expand description

Macro to derive a rng for producing multiple nonces.

This works like derive_nonce except that it produces an rng with the output rather than a scalar.

§Examples

use secp256kfun::{Scalar, derive_nonce_rng, Tag, nonce};
use sha2::Sha256;
let secret_scalar = Scalar::random(&mut rand::thread_rng());
let nonce_gen = nonce::Deterministic::<Sha256>::default().tag(b"my-protocol");
let mut rng = derive_nonce_rng!(
    nonce_gen => nonce_gen,
    secret => &secret_scalar,
    public => [b"public-inputs-to-the-algorithm".as_ref()],
    seedable_rng => rand::rngs::StdRng
);
let r1 = Scalar::random(&mut rng);
let r2 = Scalar::random(&mut rng);