summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2019-10-23 22:10:54 +0200
committerKurt Roeckx <kurt@roeckx.be>2019-11-09 16:01:54 +0100
commitfd4a6e7d1e51ad53f70ae75317da36418cae6458 (patch)
treef46f15a916a7927f74355c6fde558d8e7fb4bdd6 /test
parentdb5cf86535b305378308c58c52596994e1ece1e6 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/rsa_sp800_56b_test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/rsa_sp800_56b_test.c b/test/rsa_sp800_56b_test.c
index 1e6ea8d0b6..b928655794 100644
--- a/test/rsa_sp800_56b_test.c
+++ b/test/rsa_sp800_56b_test.c
@@ -223,6 +223,8 @@ static int test_check_prime_factor_range(void)
&& TEST_true(BN_set_word(p, 0x10))
&& TEST_false(rsa_check_prime_factor_range(p, 8, ctx))
&& TEST_true(BN_set_word(p, 0xB))
+ && TEST_false(rsa_check_prime_factor_range(p, 8, ctx))
+ && TEST_true(BN_set_word(p, 0xC))
&& TEST_true(rsa_check_prime_factor_range(p, 8, ctx))
&& TEST_true(BN_set_word(p, 0xF))
&& TEST_true(rsa_check_prime_factor_range(p, 8, ctx))