Add have_precompute_mult tests
authorMatt Caswell <matt@openssl.org>
Wed, 4 Nov 2015 22:54:29 +0000 (22:54 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 29 Jan 2016 12:56:58 +0000 (12:56 +0000)
Add tests for have_precompute_mult for the optimised curves (nistp224,
nistp256 and nistp521) if present

Reviewed-by: Richard Levitte <levitte@openssl.org>
test/ectest.c

index f17b8b04e1a7ce444ffcf01a5fcd53e781ab166a..674e593f4430cf6b8ac2be03ba4080839143bc27 100644 (file)
@@ -1592,9 +1592,18 @@ static void nistp_single_test(const struct nistp_test_params *test)
     if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx))
         ABORT;
 
+    /*
+     * We have not performed precomputation so have_precompute mult should be
+     * false
+     */
+    if (EC_GROUP_have_precompute_mult(NISTP))
+        ABORT;
+
     /* now repeat all tests with precomputation */
     if (!EC_GROUP_precompute_mult(NISTP, ctx))
         ABORT;
+    if (!EC_GROUP_have_precompute_mult(NISTP))
+        ABORT;
 
     /* fixed point multiplication */
     EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx);