summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-11-04 22:54:29 +0000
committerMatt Caswell <matt@openssl.org>2016-01-29 13:07:12 +0000
commit1e9446bf5c85486919fc54b15cc67e913a979eca (patch)
tree88973c7014366c5f27305f976296641afb6b1d46 /crypto/ec
parente94f52e0c70dc42f5de5b7982525f76cfe42fa90 (diff)
Add have_precompute_mult tests
Add tests for have_precompute_mult for the optimised curves (nistp224, nistp256 and nistp521) if present Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 8ce4e7e605577cb5818de068e2c6da60901cddba)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ectest.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/ec/ectest.c b/crypto/ec/ectest.c
index efab0b07b1..40a1f00325 100644
--- a/crypto/ec/ectest.c
+++ b/crypto/ec/ectest.c
@@ -1758,9 +1758,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);