MersennePrimeFieldDefinition implements FieldDefinition { @Override public BigInteger getModulus() { return modulus.getPrime(); } MersennePrimeFieldDefinition(int bitLength, int constant); @Override FieldElement createElement(long value); @Override FieldElement createElement(String value); @Override FieldElement createElement(BigInteger value); @Override BigInteger getModulus(); @Override int getBitLength(); @Override StrictBitVector convertToBitVector(FieldElement fieldElement); @Override BigInteger convertToUnsigned(FieldElement value); @Override BigInteger convertToSigned(BigInteger asUnsigned); @Override byte[] serialize(FieldElement fieldElement); @Override byte[] serialize(List<FieldElement> fieldElements); @Override FieldElement deserialize(byte[] bytes); @Override List<FieldElement> deserializeList(byte[] bytes);  }
@Test public void getModulus() { testValues(3, 3); testValues(20, 1); testValues(4, 2); testValues(3, 3); testValues(31, 37); }