FieldElementFp extends FieldElement implements Serializable { @Override public FieldElement mult(FieldElement f) { BigInteger tmp = this.getData().multiply(f.getData()); tmp = tmp.mod(this.getModulus()); return new FieldElementFp(tmp, this.getModulus()); } FieldElementFp(BigInteger data, BigInteger modulus); private  FieldElementFp(); @Override FieldElement add(FieldElement f); @Override FieldElement mult(FieldElement f); @Override FieldElement addInv(); @Override FieldElement multInv();  }
@Test public void testMult() { FieldElementFp tmp = (FieldElementFp) e2.mult(e4); FieldElementFp result = new FieldElementFp(new BigInteger("72"), modulus); assertEquals(result, tmp); tmp = (FieldElementFp) e1.mult(e2); result = new FieldElementFp(new BigInteger("12"), modulus); assertEquals(result, tmp); result = new FieldElementFp(new BigInteger("1368"), modulus); assertEquals(result, tmp); }