Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashDRBG output length should be 1..hash_digest_size #808

Closed
smuellerDD opened this issue Mar 11, 2020 · 9 comments
Closed

hashDRBG output length should be 1..hash_digest_size #808

smuellerDD opened this issue Mar 11, 2020 · 9 comments
Assignees

Comments

@smuellerDD
Copy link
Contributor

environment
Demo

testSessionId
75723

vsId

Algorithm registration
162340, 162341

Expected behavior
Test vector to be generated

Additional context

[ {
  "acvVersion" : "1.0"
}, {
  "vsId" : 162341,
  "status" : "error during vector generation",
  "message" : "failed to generate tests for: 162341"
} ]
@celic
Copy link
Collaborator

celic commented Mar 11, 2020

The error we see is

"AdditionalInformation": "Invalid Returned Bits Modulus supplied: 2048.  Values were not a multiple of 384"

The server requires that for HashDRBG, the output is in whole segments of digests. So the output of a HashDRBG with SHA2-384 must be a multiple of 384 bits.

@smuellerDD
Copy link
Contributor Author

smuellerDD commented Mar 11, 2020 via email

@celic
Copy link
Collaborator

celic commented Mar 11, 2020 via email

@smuellerDD
Copy link
Contributor Author

smuellerDD commented Mar 12, 2020 via email

@celic
Copy link
Collaborator

celic commented Mar 12, 2020

You are correct. While the output length is specified in SP800-90A as the output length of the underlying hash function, the output can be truncated to a specific amount of bits. The other portion of the DRBG output is just dropped, NOT used for a future value. Was this needed for an implementation currently going through validation?

@smuellerDD
Copy link
Contributor Author

smuellerDD commented Mar 12, 2020 via email

@celic
Copy link
Collaborator

celic commented Mar 12, 2020

OK. This might not be an immediate fix for us but will be on our radar. Thanks for the information.

@celic celic changed the title DRBG generatiion fails hashDRBG output length should be 1..hash_digest_size Mar 12, 2020
@smuellerDD
Copy link
Contributor Author

I am not sure the new heading is correct - the DRBG spec defines the capability of generating 1 ... 2^19 bits in one generate function.

@Kritner
Copy link
Contributor

Kritner commented Sep 30, 2020

this change is now on production https://github.com/usnistgov/ACVP-Server/releases/tag/v1.1.0.12

@Kritner Kritner closed this as completed Sep 30, 2020
celic pushed a commit to usnistgov/ACVP-Server that referenced this issue Jan 7, 2022
… underlying cipher

- output bit length needs to be mod 8
- minimum output length of the output length of the underlying cipher
- maximum output length of 4096
- usnistgov/ACVP#808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants