Lines Matching refs:mod
504 // (public) this mod a
515 if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
531 // xy == 1 (mod m)
535 // x[y(2-xy)] == 1 (mod m^2)
536 // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
544 var y = x&3; // y == 1/x mod 2^2
545 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
546 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
547 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
548 // last step - calculate inverse mod DV directly;
550 y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits
565 // xR mod m
574 // x/R mod m
582 // x = x/R mod m (HAC 14.32)
588 // faster way of calculating u0 = x[i]*mp mod DV
602 // r = "x^2/R mod m"; x != r
605 // r = "xy/R mod m"; x,y != r
663 BigInteger.prototype.mod = bnMod;
1067 if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
1074 // x = x mod m (HAC 14.42)
1085 // r = x^2 mod m; x != r
1088 // r = x*y mod m; x,y != r
1520 // Perform raw public operation on "x": return x^e (mod n)
1619 this.dmp1 = this.d.mod(p1);
1620 this.dmq1 = this.d.mod(q1);
1627 // Perform raw private operation on "x": return x^d (mod n)
1633 var xp = x.mod(this.p).modPow(this.dmp1, this.p);
1634 var xq = x.mod(this.q).modPow(this.dmq1, this.q);
1638 return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);