FieldElementF2m extends FieldElement implements Serializable { @Override public FieldElement mult(FieldElement f) { BigInteger thisData = this.getData(); BigInteger fData = f.getData(); BigInteger tmp = new BigInteger("0"); for (int i = 0; i < fData.bitLength(); i++) { if (fData.testBit(i)) { tmp = tmp.xor(thisData.shiftLeft(i)); } } tmp = this.reduce(tmp); return new FieldElementF2m(tmp, this.getModulus()); } FieldElementF2m(BigInteger data, BigInteger modulus); private  FieldElementF2m(); @Override FieldElement add(FieldElement f); @Override FieldElement mult(FieldElement f); @Override FieldElement addInv(); @Override FieldElement multInv();  }
@Test public void testMult() { FieldElementF2m tmp = (FieldElementF2m) p1.mult(neutral); assertEquals(p1, tmp); tmp = (FieldElementF2m) p1.mult(p2); FieldElementF2m result = new FieldElementF2m(new BigInteger("110", 2), modulus); assertEquals(result, tmp); tmp = (FieldElementF2m) p1.mult(p1.multInv()); assertEquals(neutral, tmp); tmp = (FieldElementF2m) p4.mult(p5); assertEquals(result, tmp); }