Exemple #1
0
 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);
 }
Exemple #2
0
 public FieldElement mult(FieldElement fe) {
   BigInteger result = this.elem.multiply(fe.bigIntegerValue());
   result = result.mod(MOD);
   return new FieldElement(result, MOD);
 }