Skip to main content

fresh_k

Function fresh_k 

Source
pub fn fresh_k() -> Scalar
Expand description

Draws a fresh canonical Scalar from the thread-local CSPRNG suitable for the per-signature k nonce.

The Schnorr binding requires k to be drawn from a cryptographic RNG and used at most once per signature; see PrivateKey::sign for the full contract. The 40-byte draw is reduced modulo the curve order, so the returned scalar is always canonical.