Skip to content

Commit

Permalink
ecdsa: rm unnecessary mod n
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 25, 2015
1 parent ec1195b commit 336fcca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ecdsa.js
Expand Up @@ -128,13 +128,13 @@ function verify (curve, hash, signature, Q) {
// 1.4.3 e = H
var e = BigInteger.fromBuffer(hash)

// Compute s^-1
// Compute s^-1 mod n
var sInv = s.modInverse(n)

// 1.4.4 Compute u1 = es^−1 mod n
// u2 = rs^−1 mod n
var u1 = e.multiply(sInv).mod(n)
var u2 = r.multiply(sInv).mod(n)
var u1 = e.multiply(sInv)
var u2 = r.multiply(sInv)

// 1.4.5 Compute R = (xR, yR)
// R = u1G + u2Q
Expand Down

0 comments on commit 336fcca

Please sign in to comment.