/** * Returns x times the inverse of y mod p. * * @param x an element of the field * @param y an element of the field * @return x / y mod p */ public Integer divide(int x, int y) { Integer inv = ModMath.inverse(y, p); if (inv != null) return ModMath.multiply(x, inv, p); return null; }
public int multiply(int x, int y) { return ModMath.multiply(x, y, p); }