diff options
Diffstat (limited to 'test/bntest.c')
-rw-r--r-- | test/bntest.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/bntest.c b/test/bntest.c index 390dd80073..1cab660bca 100644 --- a/test/bntest.c +++ b/test/bntest.c @@ -1729,8 +1729,17 @@ static int file_modsqrt(STANZA *s) || !TEST_ptr(ret2 = BN_new())) goto err; + if (BN_is_negative(mod_sqrt)) { + /* A negative testcase */ + if (!TEST_ptr_null(BN_mod_sqrt(ret, a, p, ctx))) + goto err; + + st = 1; + goto err; + } + /* There are two possible answers. */ - if (!TEST_true(BN_mod_sqrt(ret, a, p, ctx)) + if (!TEST_ptr(BN_mod_sqrt(ret, a, p, ctx)) || !TEST_true(BN_sub(ret2, p, ret))) goto err; |