]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/rsa/rsa_lib.c
RSA security bits calculation
authorPauli <paul.dale@oracle.com>
Thu, 4 Oct 2018 23:19:30 +0000 (09:19 +1000)
committerPauli <paul.dale@oracle.com>
Mon, 22 Oct 2018 22:01:48 +0000 (08:01 +1000)
commit97b0b713fbeb74d7531fe88a2362250c6324655f
treed46adba14dcdc37a77216340110dd560afe0fd38
parent5b4cb385c18a5bb4e118e300f1c746bf7c2a5628
RSA security bits calculation

NIST has updated their guidelines in appendix D of SP 800-56B rev2 (draft)
providing a formula for the number of security bits it terms of the length
of the RSA key.

This is an implementation of this formula using fixed point arithmetic.
For integers 1 .. 100,000 it rounds down to the next smaller 8 bit strength
270 times.  It never errs to the high side.  None of the rounded values occur
near any of the commonly selected lengths.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7352)
crypto/rsa/rsa_lib.c
test/rsa_test.c