@Test void powIntTest() { assertEquals(ONE, ROOT.pow(0)); assertEquals(ROOT, ROOT.pow(1)); assertEquals(ONE, ROOT.pow(8)); assertEquals(ROOT, ROOT.pow(9)); assertEquals(ONE, ROOT.pow(9872)); assertEquals(ROOT, ROOT.pow(9873)); }
FP2Immutable pow(int exponent) { if (exponent == 0) return ONE; if (exponent == 1) return this; if (exponent == 2) return this.sqr(); FP2 res = new FP2(1); FP2 tmp = new FP2(fp2); while (exponent > 0) { if ((exponent & 1) == 1) { res.mul(tmp); } tmp.sqr(); exponent >>>= 1; } return new FP2Immutable(res); }
FP2Immutable { FP2Immutable pow(int exponent) { if (exponent == 0) return ONE; if (exponent == 1) return this; if (exponent == 2) return this.sqr(); FP2 res = new FP2(1); FP2 tmp = new FP2(fp2); while (exponent > 0) { if ((exponent & 1) == 1) { res.mul(tmp); } tmp.sqr(); exponent >>>= 1; } return new FP2Immutable(res); } }
FP2Immutable { FP2Immutable pow(int exponent) { if (exponent == 0) return ONE; if (exponent == 1) return this; if (exponent == 2) return this.sqr(); FP2 res = new FP2(1); FP2 tmp = new FP2(fp2); while (exponent > 0) { if ((exponent & 1) == 1) { res.mul(tmp); } tmp.sqr(); exponent >>>= 1; } return new FP2Immutable(res); } FP2Immutable(FP2Immutable fp2Immutable);   FP2Immutable(FP2 fp2);   FP2Immutable(FP fpA, FP fpB);   FP2Immutable(BIG big1, BIG big2);   FP2Immutable(int c);   FP2Immutable(String hex1, String hex2); }
FP2Immutable { FP2Immutable pow(int exponent) { if (exponent == 0) return ONE; if (exponent == 1) return this; if (exponent == 2) return this.sqr(); FP2 res = new FP2(1); FP2 tmp = new FP2(fp2); while (exponent > 0) { if ((exponent & 1) == 1) { res.mul(tmp); } tmp.sqr(); exponent >>>= 1; } return new FP2Immutable(res); } FP2Immutable(FP2Immutable fp2Immutable);   FP2Immutable(FP2 fp2);   FP2Immutable(FP fpA, FP fpB);   FP2Immutable(BIG big1, BIG big2);   FP2Immutable(int c);   FP2Immutable(String hex1, String hex2); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
FP2Immutable { FP2Immutable pow(int exponent) { if (exponent == 0) return ONE; if (exponent == 1) return this; if (exponent == 2) return this.sqr(); FP2 res = new FP2(1); FP2 tmp = new FP2(fp2); while (exponent > 0) { if ((exponent & 1) == 1) { res.mul(tmp); } tmp.sqr(); exponent >>>= 1; } return new FP2Immutable(res); } FP2Immutable(FP2Immutable fp2Immutable);   FP2Immutable(FP2 fp2);   FP2Immutable(FP fpA, FP fpB);   FP2Immutable(BIG big1, BIG big2);   FP2Immutable(int c);   FP2Immutable(String hex1, String hex2); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }