summaryrefslogtreecommitdiff
path: root/security/nss/lib/freebl/ecl/tests/ecp_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/freebl/ecl/tests/ecp_test.c')
-rw-r--r--security/nss/lib/freebl/ecl/tests/ecp_test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/security/nss/lib/freebl/ecl/tests/ecp_test.c b/security/nss/lib/freebl/ecl/tests/ecp_test.c
index 9e3ae4d99..d7ce299ec 100644
--- a/security/nss/lib/freebl/ecl/tests/ecp_test.c
+++ b/security/nss/lib/freebl/ecl/tests/ecp_test.c
@@ -310,6 +310,19 @@ ectest_curve_GFp(ECGroup *group, int ectestPrint, int ectestTime,
goto CLEANUP;
}
+ /* test validate_point function */
+ if (ECPoint_validate(group, &gx, &gy) != MP_YES) {
+ printf(" Error: validate point on base point failed.\n");
+ res = MP_NO;
+ goto CLEANUP;
+ }
+ MP_CHECKOK(mp_add_d(&gy, 1, &ry));
+ if (ECPoint_validate(group, &gx, &ry) != MP_NO) {
+ printf(" Error: validate point on invalid point passed.\n");
+ res = MP_NO;
+ goto CLEANUP;
+ }
+
if (ectestTime) {
/* compute random scalar */
size = mpl_significant_bits(&group->meth->irr);