diff --git a/CaptfEncoder-V1/src/app/thirdparty/node-forge/lib/jsbn.js b/CaptfEncoder-V1/src/app/thirdparty/node-forge/lib/jsbn.js index 11f965c..8adefdb 100644 --- a/CaptfEncoder-V1/src/app/thirdparty/node-forge/lib/jsbn.js +++ b/CaptfEncoder-V1/src/app/thirdparty/node-forge/lib/jsbn.js @@ -987,6 +987,7 @@ function barrettRevert(x) { return x; } //x = x mod m (HAC 14.42) function barrettReduce(x) { +if (x.s < 0) { throw Error("Barrett reduction on negative input"); } x.drShiftTo(this.m.t-1,this.r2); if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);