|
|
@ -1,4 +1,3 @@ |
|
|
|
(function (exports) { |
|
|
|
"use strict"; |
|
|
|
|
|
|
|
// Utils
|
|
|
@ -39,7 +38,7 @@ |
|
|
|
this._init(number || 0, base || 10, endian || "be"); |
|
|
|
} |
|
|
|
} |
|
|
|
exports.BN = BN; |
|
|
|
self.BN = BN; |
|
|
|
|
|
|
|
BN.BN = BN; |
|
|
|
BN.wordSize = 26; |
|
|
@ -452,10 +451,10 @@ |
|
|
|
|
|
|
|
var groupBases = [ |
|
|
|
0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, |
|
|
|
43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, |
|
|
|
16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, 6436343, |
|
|
|
7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, |
|
|
|
28629151, 33554432, 39135393, 45435424, 52521875, 60466176, |
|
|
|
43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, |
|
|
|
24137569, 34012224, 47045881, 64000000, 4084101, 5153632, 6436343, 7962624, |
|
|
|
9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, |
|
|
|
39135393, 45435424, 52521875, 60466176, |
|
|
|
]; |
|
|
|
|
|
|
|
BN.prototype.toString = function toString(base, padding) { |
|
|
@ -2380,8 +2379,7 @@ |
|
|
|
|
|
|
|
for (var j = m - 1; j >= 0; j--) { |
|
|
|
var qj = |
|
|
|
(a.words[b.length + j] | 0) * 0x4000000 + |
|
|
|
(a.words[b.length + j - 1] | 0); |
|
|
|
(a.words[b.length + j] | 0) * 0x4000000 + (a.words[b.length + j - 1] | 0); |
|
|
|
|
|
|
|
// NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
|
|
|
|
// (0x7ffffff)
|
|
|
@ -3542,4 +3540,3 @@ |
|
|
|
var res = this.imod(a._invmp(this.m).mul(this.r2)); |
|
|
|
return res._forceRed(this); |
|
|
|
}; |
|
|
|
})(self); |
|
|
|