test_class.file: core/src/test/java/dk/alexandra/fresco/framework/util/TestHmacDrbg.java
test_class.identifier: TestHmacDrbg
test_case.body: @Test(expected = IllegalStateException.class)
    public void testReseedException() throws NoSuchAlgorithmException {
      HmacDrbg m = new HmacDrbg(new byte[]{0x01});
      m.reseedCounter = HmacDrbg.MAX_RESEED_COUNT - 1;
      double max = 2;
      for (double i = 0; i < max; i++) {
        byte[] randBytes1 = new byte[0];
        m.nextBytes(randBytes1);
      }
    }
test_case.class_method_signature: TestHmacDrbg.testReseedException()
test_case.full_signature: @Test(expected = IllegalStateException.class) public void testReseedException()
test_case.identifier: testReseedException
test_case.invocations: nextBytes
test_case.modifiers: @Test(expected = IllegalStateException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReseedException()
focal_class.declarator: logger = LoggerFactory.getLogger(HmacDrbg.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(HmacDrbg.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: DEFAULT_ALGORITHM = "HmacSHA256"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_ALGORITHM = "HmacSHA256";
focal_class.type: String
focal_class.var_name: DEFAULT_ALGORITHM
focal_class.declarator: algorithm
focal_class.modifier: private final
focal_class.original_string: private final String algorithm;
focal_class.type: String
focal_class.var_name: algorithm
focal_class.declarator: mac = null
focal_class.modifier: private
focal_class.original_string: private Mac mac = null;
focal_class.type: Mac
focal_class.var_name: mac
focal_class.declarator: val = null
focal_class.modifier: private
focal_class.original_string: private byte[] val = null;
focal_class.type: byte[]
focal_class.var_name: val
focal_class.declarator: key = null
focal_class.modifier: private
focal_class.original_string: private byte[] key = null;
focal_class.type: byte[]
focal_class.var_name: key
focal_class.declarator: reseedCounter
focal_class.original_string: long reseedCounter;
focal_class.type: long
focal_class.var_name: reseedCounter
focal_class.declarator: seeds
focal_class.modifier: private
focal_class.original_string: private List<byte[]> seeds;
focal_class.type: List<byte[]>
focal_class.var_name: seeds
focal_class.declarator: MAX_RESEED_COUNT = 1L << 48
focal_class.modifier: static final
focal_class.original_string: static final long MAX_RESEED_COUNT = 1L << 48;
focal_class.type: long
focal_class.var_name: MAX_RESEED_COUNT
focal_class.file: core/src/main/java/dk/alexandra/fresco/framework/util/HmacDrbg.java
focal_class.identifier: HmacDrbg
focal_class.interfaces: implements Drbg
focal_class.class_method_signature: HmacDrbg.HmacDrbg(byte[]... seeds)
focal_class.full_signature: public  HmacDrbg(byte[]... seeds)
focal_class.identifier: HmacDrbg
focal_class.modifiers: public
focal_class.parameters: (byte[]... seeds)
focal_class.signature:  HmacDrbg(byte[]... seeds)
focal_class.class_method_signature: HmacDrbg.HmacDrbg(Supplier<Mac> macSupplier, byte[]... seeds)
focal_class.full_signature: public  HmacDrbg(Supplier<Mac> macSupplier, byte[]... seeds)
focal_class.identifier: HmacDrbg
focal_class.modifiers: public
focal_class.parameters: (Supplier<Mac> macSupplier, byte[]... seeds)
focal_class.signature:  HmacDrbg(Supplier<Mac> macSupplier, byte[]... seeds)
focal_class.class_method_signature: HmacDrbg.nextBytes(byte[] bytes)
focal_class.full_signature: @Override public synchronized void nextBytes(byte[] bytes)
focal_class.identifier: nextBytes
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (byte[] bytes)
focal_class.return: void
focal_class.signature: void nextBytes(byte[] bytes)
focal_class.class_method_signature: HmacDrbg.update(byte[] providedData)
focal_class.full_signature: private void update(byte[] providedData)
focal_class.identifier: update
focal_class.modifiers: private
focal_class.parameters: (byte[] providedData)
focal_class.return: void
focal_class.signature: void update(byte[] providedData)
focal_class.class_method_signature: HmacDrbg.initializeMac(byte[] key)
focal_class.full_signature: private void initializeMac(byte[] key)
focal_class.identifier: initializeMac
focal_class.modifiers: private
focal_class.parameters: (byte[] key)
focal_class.return: void
focal_class.signature: void initializeMac(byte[] key)
focal_class.class_method_signature: HmacDrbg.safeInitialize(SecretKey secretKeySpec)
focal_class.full_signature:  void safeInitialize(SecretKey secretKeySpec)
focal_class.identifier: safeInitialize
focal_class.parameters: (SecretKey secretKeySpec)
focal_class.return: void
focal_class.signature: void safeInitialize(SecretKey secretKeySpec)
focal_class.class_method_signature: HmacDrbg.setSeed(byte[] seed)
focal_class.full_signature: private void setSeed(byte[] seed)
focal_class.identifier: setSeed
focal_class.modifiers: private
focal_class.parameters: (byte[] seed)
focal_class.return: void
focal_class.signature: void setSeed(byte[] seed)
focal_method.body: @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));
      }
    }
focal_method.class_method_signature: HmacDrbg.nextBytes(byte[] bytes)
focal_method.full_signature: @Override public synchronized void nextBytes(byte[] bytes)
focal_method.identifier: nextBytes
focal_method.invocations: doFinal arraycopy update isEmpty setSeed remove
focal_method.modifiers: @Override public synchronized
focal_method.parameters: (byte[] bytes)
focal_method.return: void
focal_method.signature: void nextBytes(byte[] bytes)