diff options
author | Dmitry Meshkov <meshkov@rutoken.ru> | 2018-12-27 13:03:13 +0300 |
---|---|---|
committer | Dmitry Meshkov <meshkov@rutoken.ru> | 2018-12-28 10:11:47 +0300 |
commit | e73b5da38fe3e541d076093f7dd96fd2f8f527cc (patch) | |
tree | ea642a77cd2025b11f7ddd0a43d787d18763a337 /test_curves.c | |
parent | 2b79bbba6aed4e69b1d2d0c04da00f121c69799d (diff) | |
download | gost-engine-e73b5da38fe3e541d076093f7dd96fd2f8f527cc.zip gost-engine-e73b5da38fe3e541d076093f7dd96fd2f8f527cc.tar.gz gost-engine-e73b5da38fe3e541d076093f7dd96fd2f8f527cc.tar.bz2 |
Replace orders of groups with orders of cyclic subgroups
According to OpenSSL documentation EC_GROUP's member named order contains the cardinality of cyclic subgroup. Some paramsets contain cardinalities of elliptic curves' groups.
Diffstat (limited to 'test_curves.c')
-rw-r--r-- | test_curves.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test_curves.c b/test_curves.c index ba1da89..1ee15b0 100644 --- a/test_curves.c +++ b/test_curves.c @@ -182,8 +182,8 @@ static int parameter_test(struct test_curve *tc) const BIGNUM *order; T(order = EC_GROUP_get0_order(group)); T(!BN_is_zero(order)); - print_bn("m", order); - T(!BN_is_zero(order)); + print_bn("q", order); + T(BN_is_odd(order)); EC_POINT *point; T((point = EC_POINT_new(group))); T(EC_POINT_mul(group, point, NULL, generator, order, ctx)); @@ -204,10 +204,7 @@ static int parameter_test(struct test_curve *tc) /* Cofactor is 1 or 4 */ const BIGNUM *c; T(c = EC_GROUP_get0_cofactor(group)); - if (BN_is_odd(order)) - T(BN_is_word(c, 1)); - else - T(BN_is_word(c, 4)); + T(BN_is_word(c, 1) || BN_is_word(c, 4)); TEST_ASSERT(0); return test; |