class HmacDrbg implements Drbg {

  @Override
  public synchronized void nextBytes(byte[] bytes) {
    int pos = 0;
    while (pos < bytes.length) {
      this.val = this.mac.doFinal(this.val);
      int length = val.length;
      // Ensure that we don't break boundaries
      if (length > bytes.length - pos) {
        length = bytes.length - pos;
      }
      System.arraycopy(val, 0, bytes, pos, length);
      pos += length;
    }
    update(null);
    this.reseedCounter++;
    if (this.reseedCounter >= MAX_RESEED_COUNT) {
      if (this.seeds.isEmpty()) {
        throw new IllegalStateException(
            "No more seeds available. Security guarantees no longer holds. "
                + "Please restart the application using more seeds to continue beyond this point.");
      }
      setSeed(this.seeds.remove(0));
    }
  }

  public  HmacDrbg(byte[]... seeds);
  public  HmacDrbg(Supplier<Mac> macSupplier, byte[]... seeds);

}