Trace of x^2 is same as for x
@@ -68,6 +68,16 @@ public static void implPrintNonZeroTraceBits(X9ECParameters x9)
*/
{
for (int i = 0; i < m; ++i)
+ {
+ if (0 == (i & 1) && 0 != i)
+ {
+ if (nonZeroTraceBits.contains(Integers.valueOf(i >>> 1)))
+ {
+ nonZeroTraceBits.add(Integers.valueOf(i));
+ System.out.print(" " + i);
+ }
+ }
+ else
{
BigInteger zi = ONE.shiftLeft(i);
ECFieldElement fe = c.fromBigInteger(zi);
@@ -78,6 +88,7 @@ public static void implPrintNonZeroTraceBits(X9ECParameters x9)
System.out.print(" " + i);
}
}
+ }
System.out.println();
}
