public static BigInteger getModulus(EllipticCurve curve) throws GeneralSecurityException {
    ECField field = curve.getField();
    if (field instanceof ECFieldFp) {
      return ((ECFieldFp) field).getP();
    } else {
      throw new GeneralSecurityException("Only curves over prime order fields are supported");
    }
  }
Returns the modulus of the field used by the curve specified in ecParams.

@param curve must be a prime order elliptic curve
@return the order of the finite field over which curve is defined.
java_src/src/main/java/com/google/crypto/tink/internal/EllipticCurvesUtil.java