@Test
public void testFromDerivedSeed() throws NoSuchAlgorithmException {

  // Note this test is implementation specific and may fail if we change how the seed is hashed
  MessageDigest md = MessageDigest.getInstance(AesCtrDrbgFactory.HASH_ALGORITHM);
  Drbg drbgA = AesCtrDrbgFactory.fromDerivedSeed((byte) 0x01, (byte) 0x02);
  byte[] seed = md.digest(new byte[] { 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02 });
  assertEquals(AesCtrDrbg.SEED_LENGTH, seed.length);
  Drbg drbgB = new AesCtrDrbg(seed);
  byte[] bytesA = new byte[10000];
  byte[] bytesB = new byte[10000];
  drbgA.nextBytes(bytesA);
  drbgB.nextBytes(bytesB);
  assertArrayEquals(bytesA, bytesB);
}