public FieldElement inverse(FieldElement x) { try { BigIntegerFieldElement _x = validateOtherElement(x); return new BigIntegerFieldElement(_x.getValue().modInverse(modulo), this); } catch (ArithmeticException ex) { throw new FieldException(ex); } }
public FieldElement multiply(FieldElement x, FieldElement y) { BigIntegerFieldElement _x = validateOtherElement(x); BigIntegerFieldElement _y = validateOtherElement(y); return new BigIntegerFieldElement(_x.getValue().multiply(_y.getValue()), this); }
public FieldElement negative(FieldElement x) { BigIntegerFieldElement _x = validateOtherElement(x); return new BigIntegerFieldElement(_x.getValue().negate(), this); }
public int compare(FieldElement x, FieldElement y) { BigIntegerFieldElement _x = validateOtherElement(x); BigIntegerFieldElement _y = validateOtherElement(y); return _x.compareTo(_y); }
public FieldElement pow(FieldElement x, long exp) { BigIntegerFieldElement _x = validateOtherElement(x); BigInteger _exp = BigInteger.valueOf(exp); return new BigIntegerFieldElement(_x.getValue().modPow(_exp, modulo), this); }
public FieldElement pow(FieldElement x, BigInteger exp) { BigIntegerFieldElement _x = validateOtherElement(x); return new BigIntegerFieldElement(_x.getValue().modPow(exp, modulo), this); }