diff options
| author | J08nY | 2018-01-18 18:37:44 +0100 |
|---|---|---|
| committer | J08nY | 2018-01-18 18:40:06 +0100 |
| commit | cf074191532caef918fb9f502b37697094da317a (patch) | |
| tree | 9826a5f436aba9fcbfbba8dfd5e615267213123f /test/src | |
| parent | f940f80a2cb69ffcd1f0d608cbb1b0f06e0854d6 (diff) | |
| download | ecgen-cf074191532caef918fb9f502b37697094da317a.tar.gz ecgen-cf074191532caef918fb9f502b37697094da317a.tar.zst ecgen-cf074191532caef918fb9f502b37697094da317a.zip | |
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/math/test_twists.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/src/math/test_twists.c b/test/src/math/test_twists.c index 30bc958..8a869bf 100644 --- a/test/src/math/test_twists.c +++ b/test/src/math/test_twists.c @@ -3,8 +3,8 @@ * Copyright (C) 2017 J08nY */ #include <criterion/criterion.h> -#include "gen/point.h" #include "gen/field.h" +#include "gen/point.h" #include "math/poly.h" #include "math/twists.h" #include "test/default.h" @@ -12,7 +12,7 @@ TestSuite(twists, .init = default_setup, .fini = default_teardown); -Test(twists, test_twist_rand_fp) { +Test(twists, test_twist_rand_to_fp) { random_init(); GEN a = mkintmodu(3, 23); GEN b = mkintmodu(4, 23); @@ -22,25 +22,26 @@ Test(twists, test_twist_rand_fp) { .curve = ellinit(mkvec2(a, b), stoi(23), -1)}; curve_t to = {0}; - curve_twist_rand(&to, &curve); + twist_rand_to(&to, &curve); cr_assert_not_null(to.a, ); cr_assert_not_null(to.b, ); cr_assert_not_null(to.field, ); cr_assert_not_null(to.curve, ); } -Test(twists, test_twist_rand_f2m) { +Test(twists, test_twist_rand_to_f2m) { random_init(); GEN field = poly_find_gen(13); GEN a = field_ielement(field, stoi(2)); GEN b = field_ielement(field, stoi(3)); - curve_t curve = {.a = a, - .b = b, - .field = field, - .curve = ellinit(mkvecn(5, gen_1, a, gen_0, gen_0, b), NULL, -1)}; + curve_t curve = { + .a = a, + .b = b, + .field = field, + .curve = ellinit(mkvecn(5, gen_1, a, gen_0, gen_0, b), NULL, -1)}; curve_t to = {0}; - curve_twist_rand(&to, &curve); + twist_rand_to(&to, &curve); cr_assert_not_null(to.a, ); cr_assert_not_null(to.b, ); cr_assert_not_null(to.field, ); |
