mirror of
https://github.com/hanzoai/elliptic.git
synced 2026-09-23 23:51:03 +00:00
6.3.2
This commit is contained in:
Vendored
+14
-5
@@ -56,8 +56,12 @@
|
||||
}
|
||||
|
||||
BN.isBN = function isBN (num) {
|
||||
if (num instanceof BN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return num !== null && typeof num === 'object' &&
|
||||
num.constructor.name === 'BN' && Array.isArray(num.words);
|
||||
num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
|
||||
};
|
||||
|
||||
BN.max = function max (left, right) {
|
||||
@@ -2098,6 +2102,10 @@
|
||||
|
||||
assert(this.negative === 0, 'imaskn works only with positive numbers');
|
||||
|
||||
if (this.length <= s) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (r !== 0) {
|
||||
s++;
|
||||
}
|
||||
@@ -5797,12 +5805,13 @@ EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
|
||||
else
|
||||
r = this.curve.pointFromX(r, isYOdd);
|
||||
|
||||
var eNeg = n.sub(e);
|
||||
var rInv = signature.r.invm(n);
|
||||
var s1 = n.sub(e).mul(rInv).umod(n);
|
||||
var s2 = s.mul(rInv).umod(n);
|
||||
|
||||
// 1.6.1 Compute Q = r^-1 (sR - eG)
|
||||
// Q = r^-1 (sR + -eG)
|
||||
var rInv = signature.r.invm(n);
|
||||
return this.g.mulAdd(eNeg, r, s).mul(rInv);
|
||||
return this.g.mulAdd(s1, r, s2);
|
||||
};
|
||||
|
||||
EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
|
||||
@@ -8646,7 +8655,7 @@ if (typeof Object.create === 'function') {
|
||||
},{}],26:[function(require,module,exports){
|
||||
module.exports={
|
||||
"name": "elliptic",
|
||||
"version": "6.3.1",
|
||||
"version": "6.3.2",
|
||||
"description": "EC cryptography",
|
||||
"main": "lib/elliptic.js",
|
||||
"files": [
|
||||
|
||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "elliptic",
|
||||
"version": "6.3.1",
|
||||
"version": "6.3.2",
|
||||
"description": "EC cryptography",
|
||||
"main": "lib/elliptic.js",
|
||||
"files": [
|
||||
|
||||
Reference in New Issue
Block a user