diff options
| author | J08nY | 2017-12-17 20:16:16 +0100 |
|---|---|---|
| committer | J08nY | 2017-12-17 22:55:45 +0100 |
| commit | 878bd3fb19c5f876c6852ca5274186850b3c189f (patch) | |
| tree | 172c60b0cd9190ff539e57e2d506598663bc604d /src/exhaustive | |
| parent | 04237935d3577eed75efaf0e2fec69e1cdad35e4 (diff) | |
| download | ecgen-feature/brainpool-algo.tar.gz ecgen-feature/brainpool-algo.tar.zst ecgen-feature/brainpool-algo.zip | |
Diffstat (limited to 'src/exhaustive')
| -rw-r--r-- | src/exhaustive/brainpool.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exhaustive/brainpool.c b/src/exhaustive/brainpool.c index c45d0d5..fdabd6f 100644 --- a/src/exhaustive/brainpool.c +++ b/src/exhaustive/brainpool.c @@ -109,7 +109,11 @@ GENERATOR(brainpool_gen_field) { GEN c = bits_to_i(p_bits); bits_free(&p_bits); GEN p = c; + pari_sp bbtop = avma; do { + if (p != c) {//yes, check ptr identity here + avma = bbtop; + } p = nextprime(addii(p, gen_1)); } while (mod4(p) != 3); @@ -127,7 +131,7 @@ GENERATOR(brainpool_gen_field) { continue; } - curve->field = p; + curve->field = gcopy(p); gerepileall(btop, 1, &curve->field); break; } while (true); @@ -156,6 +160,7 @@ GENERATOR(brainpool_gen_equation) { avma = btop; continue; } + GEN z; z = Fp_sqrtn(Fp_muls(am, -3, curve->field), stoi(4), curve->field, NULL); |
