Comparing version 0.1.5 to 0.1.6
@@ -354,2 +354,5 @@ var assert = require('assert'); | ||
if (this.cmp(0) === 0 || num.cmp(0) === 0) | ||
return new BN(0); | ||
var result = new BN(null); | ||
@@ -399,2 +402,5 @@ result.sign = ((num.sign ? 1 : 0) ^ (this.sign ? 1 : 0)) ? true : false; | ||
BN.prototype.sqr = function sqr() { | ||
if (this.cmp(0) === 0) | ||
return new BN(0); | ||
var res = new BN(null); | ||
@@ -870,2 +876,8 @@ res.words = new Array(2 * this.length); | ||
var mont = this.mont; | ||
if (this.cmp(0) === 0 || num.cmp(0) === 0) { | ||
var res = new BN(0); | ||
res.mont = mont; | ||
return res; | ||
} | ||
var t = this.mul(num); | ||
@@ -872,0 +884,0 @@ var c = t.mul(mont.minv).imask(mont.shift).mul(mont.m); |
{ | ||
"name": "bn.js", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Big number implementation in pure javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/bn.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30020
965