/** * Constructor from a base radix represention of a BigInteger. * * @param encoding a String BigInteger of base radix. * @param radix the radix to use. */ public TestRandomBigInteger(String encoding, int radix) { super(new FixedSecureRandom.Source[] { new FixedSecureRandom.BigInteger(BigIntegers.asUnsignedByteArray(new java.math.BigInteger(encoding, radix))) }); }
/** * Constructor which ensures encoding will produce a BigInteger from a request from the passed in bitLength. * * @param bitLength bit length for the BigInteger data request. * @param encoding bytes making up the encoding. */ public TestRandomBigInteger(int bitLength, byte[] encoding) { super(new FixedSecureRandom.Source[] { new FixedSecureRandom.BigInteger(bitLength, encoding) }); } }
/** * Constructor based on a byte array. * * @param encoding a 2's complement representation of the BigInteger. */ public TestRandomBigInteger(byte[] encoding) { super(new FixedSecureRandom.Source[] { new FixedSecureRandom.BigInteger(encoding) }); }