From fdbcf2dcc45094f6eee2fe2f17ee287118dc6cfd Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 21 Feb 2018 12:36:53 -0500 Subject: Expose EC_Group::a_is_minus_3 --- src/tests/unit_ecc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/tests/unit_ecc.cpp') diff --git a/src/tests/unit_ecc.cpp b/src/tests/unit_ecc.cpp index 1a2f1d61c..166dfcd14 100644 --- a/src/tests/unit_ecc.cpp +++ b/src/tests/unit_ecc.cpp @@ -281,6 +281,13 @@ Test::Result test_groups() result.confirm("EC_Group is known", !group.get_curve_oid().empty()); result.test_eq("EC_Group has correct bit size", group.get_p().bits(), group.get_p_bits()); result.test_eq("EC_Group has byte size", group.get_p().bytes(), group.get_p_bytes()); + + bool a_is_minus_3 = group.a_is_minus_3(); + + if(a_is_minus_3) + result.test_eq("Group A equals -3", group.get_a(), group.get_p() - 3); + else + result.test_ne("Group " + group_name + " A does not equal -3", group.get_a(), group.get_p() - 3); } return result; } -- cgit v1.2.3