use of java.math.BigInteger in project wycheproof by google.
the class DhTest method openJdk1024.
// The default parameters returned for 1024 bit DH keys from OpenJdk as defined in
// openjdk7/releases/v6/trunk/jdk/src/share/classes/sun/security/provider/ParameterCache.java
// I.e., these are the same parameters as used for DSA.
public DHParameterSpec openJdk1024() {
final BigInteger p = new BigInteger("fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669" + "455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b7" + "6b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb" + "83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7", 16);
final BigInteger unusedQ = new BigInteger("9760508f15230bccb292b982a2eb840bf0581cf5", 16);
final BigInteger g = new BigInteger("f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d078267" + "5159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e1" + "3c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243b" + "cca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a", 16);
return new DHParameterSpec(p, g);
}
use of java.math.BigInteger in project hazelcast by hazelcast.
the class MultiMapMaxAggregationTest method testBigIntegerMaxWithExtractor.
@Test
public void testBigIntegerMaxWithExtractor() throws Exception {
Value<BigInteger>[] values = buildValues(new ValueProvider<BigInteger>() {
@Override
public BigInteger provideRandom(Random random) {
return BigInteger.valueOf(10000L + random(1000, 2000));
}
});
BigInteger expectation = BigInteger.ZERO;
for (int i = 0; i < values.length; i++) {
Value<BigInteger> value = values[i];
expectation = i == 0 ? value.value : expectation.max(value.value);
}
Aggregation<String, BigInteger, BigInteger> aggregation = Aggregations.bigIntegerMax();
BigInteger result = testMaxWithExtractor(values, aggregation);
assertEquals(expectation, result);
}
use of java.math.BigInteger in project hazelcast by hazelcast.
the class MultiMapMinAggregationTest method testBigIntegerMin.
@Test
public void testBigIntegerMin() throws Exception {
BigInteger[] values = buildPlainValues(new ValueProvider<BigInteger>() {
@Override
public BigInteger provideRandom(Random random) {
return BigInteger.valueOf(10000L + random(1000, 2000));
}
}, BigInteger.class);
BigInteger expectation = BigInteger.ZERO;
for (int i = 0; i < values.length; i++) {
BigInteger value = values[i];
expectation = i == 0 ? value : expectation.min(value);
}
Aggregation<String, BigInteger, BigInteger> aggregation = Aggregations.bigIntegerMin();
BigInteger result = testMin(values, aggregation);
assertEquals(expectation, result);
}
use of java.math.BigInteger in project hazelcast by hazelcast.
the class MultiMapSumAggregationTest method testBigIntegerSum.
@Test
public void testBigIntegerSum() throws Exception {
BigInteger[] values = buildPlainValues(new ValueProvider<BigInteger>() {
@Override
public BigInteger provideRandom(Random random) {
return BigInteger.valueOf(10000L + random(1000, 2000));
}
}, BigInteger.class);
BigInteger expectation = BigInteger.ZERO;
for (int i = 0; i < values.length; i++) {
expectation = expectation.add(values[i]);
}
Aggregation<String, BigInteger, BigInteger> aggregation = Aggregations.bigIntegerSum();
BigInteger result = testSum(values, aggregation);
assertEquals(expectation, result);
}
use of java.math.BigInteger in project hazelcast by hazelcast.
the class MapMinAggregationTest method testBigIntegerMin.
@Test
public void testBigIntegerMin() throws Exception {
BigInteger[] values = buildPlainValues(new ValueProvider<BigInteger>() {
@Override
public BigInteger provideRandom(Random random) {
return BigInteger.valueOf(10000L + random(1000, 2000));
}
}, BigInteger.class);
BigInteger expectation = BigInteger.ZERO;
for (int i = 0; i < values.length; i++) {
BigInteger value = values[i];
expectation = i == 0 ? value : expectation.min(value);
}
Aggregation<String, BigInteger, BigInteger> aggregation = Aggregations.bigIntegerMin();
BigInteger result = testMin(values, aggregation);
assertEquals(expectation, result);
}
Aggregations