diff options
| author | J08nY | 2017-12-18 00:36:35 +0100 |
|---|---|---|
| committer | J08nY | 2017-12-18 00:36:35 +0100 |
| commit | c47349695478abefc50467796960faf816ac6057 (patch) | |
| tree | 2fa4e9a18d088d0ac260e222d0a5e912ff274ea8 | |
| parent | 4e457fb5ad74ef3685520d9c79258cf8965b3a41 (diff) | |
| download | ecgen-c47349695478abefc50467796960faf816ac6057.tar.gz ecgen-c47349695478abefc50467796960faf816ac6057.tar.zst ecgen-c47349695478abefc50467796960faf816ac6057.zip | |
| -rw-r--r-- | src/exhaustive/brainpool.c | 4 | ||||
| -rwxr-xr-x | test/ecgen.sh | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/exhaustive/brainpool.c b/src/exhaustive/brainpool.c index 99d8fb8..499522e 100644 --- a/src/exhaustive/brainpool.c +++ b/src/exhaustive/brainpool.c @@ -3,6 +3,7 @@ * Copyright (C) 2017 J08nY */ +#include <misc/types.h> #include "brainpool.h" #include "gen/gens.h" #include "gen/point.h" @@ -219,7 +220,7 @@ GENERATOR(brainpool_gen_gens) { GEN x = gen_0; GEN Qy = ellordinate(curve->curve, x, 0); while (glength(Qy) == 0) { - mpaddz(x, gen_1, x); + x = addii(x, gen_1); Qy = ellordinate(curve->curve, x, 0); } @@ -238,6 +239,7 @@ GENERATOR(brainpool_gen_gens) { } curve->generators = points_new(1); + curve->ngens = 1; point_t *G = point_new(); curve->generators[0] = G; G->point = gerepilecopy(ltop, ellmul(curve->curve, P, k)); diff --git a/test/ecgen.sh b/test/ecgen.sh index b8ddfb3..0621c48 100755 --- a/test/ecgen.sh +++ b/test/ecgen.sh @@ -80,6 +80,13 @@ function ansix962() { assert_raises "${ecgen} --f2m -r --ansi 10" } +function brainpool() { + start_test + assert_raises "${ecgen} --fp -r --brainpool 10" + assert_raises "${ecgen} --f2m -r --brainpool 10" 1 + assert_raises "${ecgen} --fp -r --brainpool-rfc 10" + assert_raises "${ecgen} --f2m -r --brainpool-rfc 10" 1 +} function anomalous() { start_test assert_raises "${ecgen} --fp --anomalous -r 20" @@ -122,6 +129,7 @@ csv json exhaustive ansix962 +brainpool anomalous invalid cli |
