rfc6979Nonce
private fn
BigInt rfc6979Nonce(BigInt x, const(ubyte)[] digest,
BigInt q, size_t qLen, size_t qBitLen, HashFactory hashFactory)Generates a deterministic ECDSA nonce k per RFC 6979 Section 3.2.
This function implements the HMAC-DRBG-based deterministic nonce generation algorithm, producing a predictable k from the private key and message hash. This eliminates the need for a random number generator and ensures reproducible signatures.
Parameters
x | The private key scalar. |
digest | The raw hash output H(m). |
q | The curve order n. |
qLen | The byte length of the curve order. |
qBitLen | The bit length of the curve order. |
hashFactory | Factory to create hash instances for HMAC. |
Returns
The deterministic nonce k in [1, q-1].