-
Notifications
You must be signed in to change notification settings - Fork 0
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
FIPS 186 compliant mode where message-dependent pseudorandom values are used as ‘additional input’? #6
Comments
I believe Hedged ECDSA as described in draft-irtf-cfrg-det-sigs-with-noise-03 is already FIPS 186-5 compliant. It's using HMAC_DRBG consistently with SP 800-90Ar1, with Z as entropy (which has length sufficient to provide the requested DRBG security strength for the ECDSA key size, double that in fact), no nonce (as allowed by SP 800-90Ar1, Sections 8.6.7 and 9.1), and a Alternatively, one could argue that It then uses this cryptographically strong DRBG to generate the nonce according to FIPS 186-5, Appendix A.3.2, "Per-Message Secret Number Generation of Private Keys by Rejection Sampling". RFC 6979 checks 0 < x < q, while Appendix A.4.2 checks 0 <= x < q-1 and then returns x + 1 (which is way more annoying to implement), but note that Appendix A.3.2 says "Convert returned_bits to the (non-negative) integer k using the procedure in Appendix A.4.2 or an equivalent process" (emphasis mine). Are there concerns about the compliance of the current version? I actually landed here by first rederiving the exact same scheme (except for the |
Ah, actually, more evidence from SP 800-90Ar1, Section 8.6.7 in support of just calling Z entropy+nonce.
This is very reasonable, especially for ECDSA nonce generation, because this use case is susceptible to birthday bounds. This is explicitly called out.
Given P-256, P-384, and P-521 require a security strength of 128, 192, and 256 respectively per SP 800-57 Part 1 Rev. 5, Section 5.6.1.1, the Z length of 256, 384, and 528 respectively is always greater than 3/2 security_strength. Also, SHA-256 or better is sufficient for all those security strengths per SP 800-57 Part 1 Rev. 5, Section 5.6.1.2. From SP 800-90Ar1, Section 10.1:
|
Thanks @FiloSottile,
FIPS 186-5 also says:
But, compared to RFC 6979, FIPS 186-5 act slightly different on returned_bits by shifting with +1 as you note, and RFC 6979 also checks that k does not result in an r value that is 0. While these things are irrelevant to security and the latter will never happen in practice, the two processes seem to not be equivalent by the given definition. Any thoughts on these things? |
Our argument was that bits from the DRBG are not an input parameter of Appendix A.3.2 (because they are not deterministic and the DRBG is not rigidly specified, and indeed they are not listed as inputs), so when Appendix A.3.2 says "The following procedure or its equivalent" we can apply the RFC 6979 process to produce an "Integer in the interval [1, n–1]" from an abstract DRBG. Note that [0, n-2]+1 and [1, n-1] are strictly equivalent, we don't rely on the negligible chance of hitting 0. Moreover, these are appendixes that use "may", not "shall". We linked our lab to this issue, and they were satisfied. |
#6 Described how Hedged ECDSA maps to HMAC_DRBG with reference to RFC 6979.
People have suggested a FIPS 186 compliant mode where message-dependent pseudorandom values are used as ‘additional input’ in the random number generation for randomized ECDSA [FIPS 186]. Such a mode could compliment the current hedged construction based on Deterministic ECDSA [RFC 6979].
https://blogs.cisco.com/security/fips-and-deterministic-ecdsa-achieving-robust-security-and-conformance
The text was updated successfully, but these errors were encountered: