diff options
| author | J08nY | 2017-12-13 18:43:30 +0100 |
|---|---|---|
| committer | J08nY | 2017-12-13 18:43:30 +0100 |
| commit | c252a59d6e49b3780519aaa493de663bf4e14bd2 (patch) | |
| tree | fc367b94ffb9c822934784a1e053d8d0f22bcb52 /test/src | |
| parent | e0a255ac68932521c24e39f73f5fbf166383f275 (diff) | |
| download | ecgen-c252a59d6e49b3780519aaa493de663bf4e14bd2.tar.gz ecgen-c252a59d6e49b3780519aaa493de663bf4e14bd2.tar.zst ecgen-c252a59d6e49b3780519aaa493de663bf4e14bd2.zip | |
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/exhaustive/test_brainpool.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/src/exhaustive/test_brainpool.c b/test/src/exhaustive/test_brainpool.c index 912d286..d71bbf7 100644 --- a/test/src/exhaustive/test_brainpool.c +++ b/test/src/exhaustive/test_brainpool.c @@ -65,6 +65,21 @@ Test(brainpool, test_brainpool_seed_input_short) { cr_assert_eq(ret, 0, ); } +Test(brainpool, test_brainpool_field) { + curve_t curve = {0}; + char *seed = "abcdefabcdefabcdefabcdefabcdefabcdefabcd"; + cfg->seed = seed; + cfg->bits = 256; + + brainpool_gen_seed_argument(&curve, NULL, OFFSET_SEED); + + int ret = brainpool_gen_field(&curve, NULL, OFFSET_FIELD); + cr_assert_eq(ret, 1, ); + cr_assert_not_null(curve.field, ); + cr_assert(isprime(curve.field), ); + cr_assert_eq(mod4(curve.field), 3, ); +} + Test(brainpool, test_brainpool_equation) { curve_t curve = {0}; char *seed = "abcdefabcdefabcdefabcdefabcdefabcdefabcd"; |
