src/main/java/at/favre/tools/dice/rnd/HmacDrbg.java
private void hmacDrbgGenerate(byte[] out, int start, int count, byte[] additionalInput) {
        // 3. temp = Null.
        int bytesWritten = 0;
        // 4. While (len (temp) < requested_number_of_bits) do:
        while (bytesWritten < count) {
            // 4.1 V = HMAC (Key, V).
            value = hmac.doFinal(value);
            // 4.2 temp = temp || V.
            // 5. returned_bits = Leftmost requested_number_of_bits of temp
            int bytesToWrite = Math.min(count - bytesWritten, getSecurityStrengthBytes());
            System.arraycopy(value, 0, out, start + bytesWritten, bytesToWrite);
            bytesWritten += bytesToWrite;
        }

        // 6. (Key, V) = HMAC_DRBG_Update (additional_input, Key, V).
        hmacDrbgUpdate(additionalInput);
    }
/**
     * HMAC_DRBG Generate Process
     * <p>
     * See: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf 10.1.2.5
     *
     * @param out             target byte array to write random bytes
     * @param start           where to start to write in out
     * @param count           how many bytes from start
     * @param additionalInput The additional input string received from the consuming application. Note that the length of the additional_input string may be zero or null
     */


@param out             target byte array to write random bytes
@param start           where to start to write in out
@param count           how many bytes from start
@param additionalInput The additional input string received from the consuming application. Note that the length of the additional_input string may be zero or null
@param out target byte array to write random bytes @param start where to start to write in out @param count how many bytes from start @param additionalInput The additional input string received from the consuming application . Note that the length of the additional_input string may be zero or null
private void hmacDrbgGenerate(byte[] out, int start, int count, byte[] additionalInput) {
        int bytesWritten = 0;
        while (bytesWritten < count) {
            value = hmac.doFinal(value);
            int bytesToWrite = Math.min(count - bytesWritten, getSecurityStrengthBytes());
            System.arraycopy(value, 0, out, start + bytesWritten, bytesToWrite);
            bytesWritten += bytesToWrite;
        }
        hmacDrbgUpdate(additionalInput);
    }
private void hmacDrbgGenerate ( byte [ ] out , int start , int count , byte [ ] additionalInput ) { int bytesWritten = 0 ; while ( bytesWritten < count ) { value = hmac . doFinal ( value ) ; int bytesToWrite = Math . min ( count - bytesWritten , getSecurityStrengthBytes ( ) ) ; System . arraycopy ( value , 0 , out , start + bytesWritten , bytesToWrite ) ; bytesWritten += bytesToWrite ; } hmacDrbgUpdate ( additionalInput ) ; }
HMAC_DRBG Generate Process
 <p>
 See: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf 10.1.2.5
HMAC_DRBG Generate Process <p > See : http : // nvlpubs . nist . gov / nistpubs / SpecialPublications / NIST . SP . 800 - 90Ar1 . pdf 10 . 1 . 2 . 5
// 3. temp = Null. // 4. While (len (temp) < requested_number_of_bits) do: // 4.1 V = HMAC (Key, V). // 4.2 temp = temp || V. // 5. returned_bits = Leftmost requested_number_of_bits of temp // 6. (Key, V) = HMAC_DRBG_Update (additional_input, Key, V).