diff --git a/src/ecdsa.js b/src/ecdsa.js index f1a2efb..2439add 100644 --- a/src/ecdsa.js +++ b/src/ecdsa.js @@ -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) } diff --git a/src/ecpubkey.js b/src/ecpubkey.js index 0d77819..ecc37bc 100644 --- a/src/ecpubkey.js +++ b/src/ecpubkey.js @@ -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)