# Using NIST SP 800 - 90Ar1 Test Vectors for HMAC_DRBG with Reseeding and AdditionalInput

I'm trying to test my HMAC-DRBG implementation, but I do not understand how the AdditionalInput paramter should be used. From one test case (pr-false):

[SHA-256]
[PredictionResistance = False]
[EntropyInputLen = 256]
[NonceLen = 128]
[PersonalizationStringLen = 0]
[ReturnedBitsLen = 1024]

COUNT = 0
EntropyInput = 05ac9fc4c62a02e3f90840da5616218c6de5743d66b8e0fbf833759c5928b53d
Nonce = 2b89a17904922ed8f017a63044848545
PersonalizationString =
EntropyInputReseed = 2791126b8b52ee1fd9392a0a13e0083bed4186dc649b739607ac70ec8dcecf9b


So I would basically instantiate my DRBG with EntropyInput and Nonce.

HmacDrbg drbg = new HmacDrbg(new DrbgParameter(macFactory,
entropyInput,
nonce,
new byte[0]));


Then before generating output, I would reseed the DRBG with EntropyInputReseed and AdditionalInputReseed

drbg.requestReseed(entropyInputReseed,additionalInputReseed);


But what should I do with the other 2 AdditionalInput inputs? The spec seems to only specify the reseed mechanic that takes AdditionalInput?

The other two AdditionalInput are to be used with the Generate function.

Page 47 of the spec describes it.

Step 2 of the algorithm performs:

 If additional_input ≠ Null then (Key, V) = HMAC_DRBG_Update (additional_input, Key, V)


Now, you might wonder why there are two strings AdditionalInput. Well, as described in the test spec there are two calls to the generate function for each test vector, so you have two additional inputs. Note that only the second output of the generate is printed in the test vector.

• So the spec basically expects that a caller can update the additional_input" internal state at any point (without updating the seed with entropy_input)? Oct 9 '17 at 16:38
• Never mind, the generate takes a additionalInput Oct 9 '17 at 20:30