aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJ08nY2018-01-19 23:34:17 +0100
committerJ08nY2018-01-19 23:34:17 +0100
commitcfdddb2a57ad77f485eb4be1a52efe5ffe19a220 (patch)
tree896cb662429b87781b97b49ea88bf3004bd77d61 /test
parentcde38f8c4ed443af6d0074e3e5294029246c2774 (diff)
downloadecgen-cfdddb2a57ad77f485eb4be1a52efe5ffe19a220.tar.gz
ecgen-cfdddb2a57ad77f485eb4be1a52efe5ffe19a220.tar.zst
ecgen-cfdddb2a57ad77f485eb4be1a52efe5ffe19a220.zip
Diffstat (limited to 'test')
-rw-r--r--test/src/math/test_twists.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/src/math/test_twists.c b/test/src/math/test_twists.c
index 8a869bf..cc39369 100644
--- a/test/src/math/test_twists.c
+++ b/test/src/math/test_twists.c
@@ -4,7 +4,6 @@
*/
#include <criterion/criterion.h>
#include "gen/field.h"
-#include "gen/point.h"
#include "math/poly.h"
#include "math/twists.h"
#include "test/default.h"
@@ -19,7 +18,8 @@ Test(twists, test_twist_rand_to_fp) {
curve_t curve = {.a = a,
.b = b,
.field = stoi(23),
- .curve = ellinit(mkvec2(a, b), stoi(23), -1)};
+ .curve = ellinit(mkvec2(a, b), stoi(23), -1),
+ .order = stoi(24)};
curve_t to = {0};
twist_rand_to(&to, &curve);
@@ -27,6 +27,7 @@ Test(twists, test_twist_rand_to_fp) {
cr_assert_not_null(to.b, );
cr_assert_not_null(to.field, );
cr_assert_not_null(to.curve, );
+ cr_assert(equalii(to.order, stoi(24)), );
}
Test(twists, test_twist_rand_to_f2m) {
@@ -38,7 +39,8 @@ Test(twists, test_twist_rand_to_f2m) {
.a = a,
.b = b,
.field = field,
- .curve = ellinit(mkvecn(5, gen_1, a, gen_0, gen_0, b), NULL, -1)};
+ .curve = ellinit(mkvecn(5, gen_1, a, gen_0, gen_0, b), NULL, -1),
+ .order = stoi(8140)};
curve_t to = {0};
twist_rand_to(&to, &curve);
@@ -46,4 +48,5 @@ Test(twists, test_twist_rand_to_f2m) {
cr_assert_not_null(to.b, );
cr_assert_not_null(to.field, );
cr_assert_not_null(to.curve, );
+ cr_assert(equalii(to.order, stoi(8246)), );
} \ No newline at end of file