public FieldElement sub(FieldElement fe) { BigInteger result = this.elem.subtract(fe.bigIntegerValue()); result = result.mod(MOD); if (result.compareTo(BigInteger.ZERO) < 0) { result.add(MOD); } return new FieldElement(result, MOD); }
public FieldElement mult(FieldElement fe) { BigInteger result = this.elem.multiply(fe.bigIntegerValue()); result = result.mod(MOD); return new FieldElement(result, MOD); }