/** * Creates a new hash-based DRBG instance that uses the given digest as the pseudorandom source. * * @param digest Digest algorithm. * @param length Length in bits of values to be produced by DRBG instance. * * @return New DRGB instance. */ public static SP80090DRBG newRBG(final Digest digest, final int length) { return newRBG(digest, length, randomEntropySource(length)); }
/** * Creates a new DRBG instance. * * @param length Length in bits of values produced by DRBG. * @param domain Domain qualifier. * * @return New DRBG instance. */ private static SP80090DRBG newRBG(final int length, final byte[] domain) { return new HashSP800DRBG( new SHA256Digest(), length, NonceUtil.randomEntropySource(length), domain, NonceUtil.timestampNonce(8)); } }