ecdsa: fix interval comment
Actual range as per the RFC is [1, q - 1], the code adheres to this.
This commit is contained in:
parent
08876fc065
commit
ab55417d6d
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ function deterministicGenerateK(curve, hash, d) {
|
||||||
|
|
||||||
var T = BigInteger.fromBuffer(v)
|
var T = BigInteger.fromBuffer(v)
|
||||||
|
|
||||||
// Step H3, repeat until T is within the interval [0, n - 1]
|
// Step H3, repeat until T is within the interval [1, n - 1]
|
||||||
while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0)) {
|
while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0)) {
|
||||||
k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0])]), k)
|
k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0])]), k)
|
||||||
v = crypto.HmacSHA256(v, k)
|
v = crypto.HmacSHA256(v, k)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue