You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This class behaves as a HMAC-based deterministic random bit generator (DRBG). It implements a deterministic random number generator using SHA256HMAC HASH function. It takes an initial entropy and nonce when instantiated for seeding purpose.
832
+
HMAC-DRBG used **only** for deterministic ECDSA nonce generation.
833
+
834
+
This implementation follows the RFC 6979-style HMAC-DRBG construction for secp256k1
835
+
and is wired internally into the ECDSA signing code. It is **not forward-secure**
836
+
and MUST NOT be used as a general-purpose DRBG, key generator, or randomness source.
837
+
838
+
Security note:
839
+
- Intended scope: internal ECDSA nonce generation with fixed-size inputs.
840
+
- Out-of-scope: generic randomness, long-lived session keys, or any context
Copy file name to clipboardExpand all lines: src/primitives/DRBG.ts
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,18 @@ import { SHA256HMAC } from './Hash.js'
2
2
import{toHex,toArray}from'./utils.js'
3
3
4
4
/**
5
-
* This class behaves as a HMAC-based deterministic random bit generator (DRBG). It implements a deterministic random number generator using SHA256HMAC HASH function. It takes an initial entropy and nonce when instantiated for seeding purpose.
5
+
* HMAC-DRBG used **only** for deterministic ECDSA nonce generation.
6
+
*
7
+
* This implementation follows the RFC 6979-style HMAC-DRBG construction for secp256k1
8
+
* and is wired internally into the ECDSA signing code. It is **not forward-secure**
9
+
* and MUST NOT be used as a general-purpose DRBG, key generator, or randomness source.
0 commit comments