Loading test/ectest.c +15 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,8 @@ static void group_order_tests(EC_GROUP *group) BIGNUM *n1, *n2, *order; EC_POINT *P = EC_POINT_new(group); EC_POINT *Q = EC_POINT_new(group); EC_POINT *R = EC_POINT_new(group); EC_POINT *S = EC_POINT_new(group); BN_CTX *ctx = BN_CTX_new(); int i; Loading Loading @@ -198,6 +200,17 @@ static void group_order_tests(EC_GROUP *group) /* Exercise EC_POINTs_mul, including corner cases. */ if (EC_POINT_is_at_infinity(group, P)) ABORT; scalars[0] = scalars[1] = BN_value_one(); points[0] = points[1] = P; if (!EC_POINTs_mul(group, R, NULL, 2, points, scalars, ctx)) ABORT; if (!EC_POINT_dbl(group, S, points[0], ctx)) ABORT; if (0 != EC_POINT_cmp(group, R, S, ctx)) ABORT; scalars[0] = n1; points[0] = Q; /* => infinity */ scalars[1] = n2; Loading @@ -219,6 +232,8 @@ static void group_order_tests(EC_GROUP *group) EC_POINT_free(P); EC_POINT_free(Q); EC_POINT_free(R); EC_POINT_free(S); BN_free(n1); BN_free(n2); BN_free(order); Loading Loading
test/ectest.c +15 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,8 @@ static void group_order_tests(EC_GROUP *group) BIGNUM *n1, *n2, *order; EC_POINT *P = EC_POINT_new(group); EC_POINT *Q = EC_POINT_new(group); EC_POINT *R = EC_POINT_new(group); EC_POINT *S = EC_POINT_new(group); BN_CTX *ctx = BN_CTX_new(); int i; Loading Loading @@ -198,6 +200,17 @@ static void group_order_tests(EC_GROUP *group) /* Exercise EC_POINTs_mul, including corner cases. */ if (EC_POINT_is_at_infinity(group, P)) ABORT; scalars[0] = scalars[1] = BN_value_one(); points[0] = points[1] = P; if (!EC_POINTs_mul(group, R, NULL, 2, points, scalars, ctx)) ABORT; if (!EC_POINT_dbl(group, S, points[0], ctx)) ABORT; if (0 != EC_POINT_cmp(group, R, S, ctx)) ABORT; scalars[0] = n1; points[0] = Q; /* => infinity */ scalars[1] = n2; Loading @@ -219,6 +232,8 @@ static void group_order_tests(EC_GROUP *group) EC_POINT_free(P); EC_POINT_free(Q); EC_POINT_free(R); EC_POINT_free(S); BN_free(n1); BN_free(n2); BN_free(order); Loading