ecdsa/ecpubkey: rectify #364 artifacts
This commit is contained in:
parent
7513e73f74
commit
8aa4f9ecc9
2 changed files with 4 additions and 3 deletions
|
@ -146,7 +146,7 @@ function verifyRaw (curve, e, signature, Q) {
|
|||
if (r.signum() <= 0 || r.compareTo(n) >= 0) return false
|
||||
if (s.signum() <= 0 || s.compareTo(n) >= 0) return false
|
||||
|
||||
// c = s^-1 mod n
|
||||
// c = s^-1 mod n
|
||||
var c = s.modInverse(n)
|
||||
|
||||
// 1.4.4 Compute u1 = es^−1 mod n
|
||||
|
@ -161,7 +161,7 @@ function verifyRaw (curve, e, signature, Q) {
|
|||
// 1.4.5 (cont.) Enforce R is not at infinity
|
||||
if (curve.isInfinity(R)) return false
|
||||
|
||||
// 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
|
||||
// 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
|
||||
return v.equals(r)
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,9 @@ var ecurve = require('ecurve')
|
|||
var secp256k1 = ecurve.getCurveByName('secp256k1')
|
||||
|
||||
function ECPubKey (Q, compressed) {
|
||||
if (compressed === undefined)
|
||||
if (compressed === undefined) {
|
||||
compressed = true
|
||||
}
|
||||
|
||||
typeForce('Point', Q)
|
||||
typeForce('Boolean', compressed)
|
||||
|
|
Loading…
Reference in a new issue