Ejemplo n.º 1
0
    public ECFieldElement multiply(final ECFieldElement b) {
      // Right-to-left comb multiplication in the IntArray
      // Input: Binary polynomials a(z) and b(z) of degree at most m-1
      // Output: c(z) = a(z) * b(z) mod f(z)

      // No check performed here for performance reasons. Instead the
      // elements involved are checked in ECPoint.F2m
      // checkFieldElements(this, b);
      F2m bF2m = (F2m) b;
      IntArray mult = x.multiply(bF2m.x, m);
      mult.reduce(m, new int[] {k1, k2, k3});
      return new F2m(m, k1, k2, k3, mult);
    }
Ejemplo n.º 2
0
 public ECFieldElement square() {
   IntArray squared = x.square(m);
   squared.reduce(m, new int[] {k1, k2, k3});
   return new F2m(m, k1, k2, k3, squared);
 }