RSA generation: Use more bits of 1/sqrt(2)
authorKurt Roeckx <kurt@roeckx.be>
Wed, 23 Oct 2019 20:10:54 +0000 (22:10 +0200)
committerKurt Roeckx <kurt@roeckx.be>
Sat, 9 Nov 2019 15:01:54 +0000 (16:01 +0100)
commitfd4a6e7d1e51ad53f70ae75317da36418cae6458
treef46f15a916a7927f74355c6fde558d8e7fb4bdd6
parentdb5cf86535b305378308c58c52596994e1ece1e6
RSA generation: Use more bits of 1/sqrt(2)

The old version always sets the top 2 bits, so the most significate byte
of the primes was always >= 0xC0. We now use 256 bits to represent
1/sqrt(2) = 0x0.B504F333F9DE64845...

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
GH: #10246
crypto/bn/bn_rsa_fips186_4.c
crypto/rsa/rsa_sp800_56b_check.c
include/crypto/bn.h
test/rsa_sp800_56b_test.c