aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-12-18 00:36:35 +0100
committerJ08nY2017-12-18 00:36:35 +0100
commitc47349695478abefc50467796960faf816ac6057 (patch)
tree2fa4e9a18d088d0ac260e222d0a5e912ff274ea8
parent4e457fb5ad74ef3685520d9c79258cf8965b3a41 (diff)
downloadecgen-c47349695478abefc50467796960faf816ac6057.tar.gz
ecgen-c47349695478abefc50467796960faf816ac6057.tar.zst
ecgen-c47349695478abefc50467796960faf816ac6057.zip
-rw-r--r--src/exhaustive/brainpool.c4
-rwxr-xr-xtest/ecgen.sh8
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