X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test_curves.c;h=1ee15b0fab706e665f53258a5ac1f4799b18d463;hb=b9935fbf77164cf491fb12df74f7a85e877813cd;hp=7f36c7501d9b7bfaf1df6870009d57d8a43de798;hpb=3383ad117b305cad929bc2aa57f5b724fe699b9a;p=openssl-gost%2Fengine.git diff --git a/test_curves.c b/test_curves.c index 7f36c75..1ee15b0 100644 --- a/test_curves.c +++ b/test_curves.c @@ -129,7 +129,7 @@ static int parameter_test(struct test_curve *tc) T(p = BN_new()); T(a = BN_new()); T(b = BN_new()); - EC_GROUP_get_curve_GFp(group, p, a, b, ctx); + EC_GROUP_get_curve(group, p, a, b, ctx); print_bn("p", p); print_bn("a", a); print_bn("b", b); @@ -144,7 +144,7 @@ static int parameter_test(struct test_curve *tc) BIGNUM *x, *y; T(x = BN_new()); T(y = BN_new()); - T(EC_POINT_get_affine_coordinates_GFp(group, generator, x, y, ctx)); + T(EC_POINT_get_affine_coordinates(group, generator, x, y, ctx)); print_bn("x", x); print_bn("y", y); T(!BN_is_zero(y)); @@ -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;