aboutsummaryrefslogtreecommitdiff
path: root/src/exhaustive
diff options
context:
space:
mode:
authorJ08nY2017-09-19 13:17:22 +0200
committerJ08nY2017-09-19 13:17:22 +0200
commitbbcff0f1875f3ac1db7964b228db34350fb84833 (patch)
tree49787fc74c5c2460a2b0711b46595c7b4afb11d8 /src/exhaustive
parent2bacc9d1dee4ec1003635edae93b1a03dbb2a12d (diff)
downloadecgen-bbcff0f1875f3ac1db7964b228db34350fb84833.tar.gz
ecgen-bbcff0f1875f3ac1db7964b228db34350fb84833.tar.zst
ecgen-bbcff0f1875f3ac1db7964b228db34350fb84833.zip
Run clang-format.
Diffstat (limited to 'src/exhaustive')
-rw-r--r--src/exhaustive/anomalous.h2
-rw-r--r--src/exhaustive/ansi.c22
-rw-r--r--src/exhaustive/ansi.h2
-rw-r--r--src/exhaustive/exhaustive.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/src/exhaustive/anomalous.h b/src/exhaustive/anomalous.h
index cf8c208..1750f4b 100644
--- a/src/exhaustive/anomalous.h
+++ b/src/exhaustive/anomalous.h
@@ -10,8 +10,8 @@
#include <pari/pari.h>
#include "arg.h"
-#include "misc/types.h"
#include "io/cli.h"
+#include "misc/types.h"
typedef struct disc_t {
GEN d;
diff --git a/src/exhaustive/ansi.c b/src/exhaustive/ansi.c
index 40fbf41..6c36063 100644
--- a/src/exhaustive/ansi.c
+++ b/src/exhaustive/ansi.c
@@ -1,13 +1,12 @@
+#include "ansi.h"
#include <misc/config.h>
#include <misc/types.h>
-#include "ansi.h"
-#include "gen/seed.h"
#include "gen/field.h"
+#include "gen/seed.h"
+#include "io/output.h"
#include "util/bits.h"
#include "util/memory.h"
-#include "io/output.h"
-
bool ansi_seed_valid(const char *hex_str) {
size_t len = strlen(hex_str);
@@ -40,8 +39,8 @@ static void seed_hash(seed_t *seed) {
static void seed_tsh(seed_t *seed, const config_t *cfg) {
pari_sp ltop = avma;
seed->ansi.t = utoi(cfg->bits);
- seed->ansi.s = floorr(
- rdivii(subis(seed->ansi.t, 1), stoi(160), DEFAULTPREC));
+ seed->ansi.s =
+ floorr(rdivii(subis(seed->ansi.t, 1), stoi(160), DEFAULTPREC));
seed->ansi.h = subii(seed->ansi.t, mulis(seed->ansi.s, 160));
gerepileall(ltop, 3, &seed->ansi.t, &seed->ansi.s, &seed->ansi.h);
}
@@ -144,7 +143,7 @@ static GENERATOR(ansi_gen_equation_fp) {
do {
a = random_int(cfg->bits);
b2 = mulii(powis(a, 3), r_inv);
- }while (!Fp_issquare(b2, curve->field));
+ } while (!Fp_issquare(b2, curve->field));
GEN b = Fp_sqrt(b2, curve->field);
curve->a = a;
@@ -180,9 +179,12 @@ static GENERATOR(ansi_gen_equation_f2m) {
GENERATOR(ansi_gen_equation) {
switch (cfg->field) {
- case FIELD_PRIME: return ansi_gen_equation_fp(curve, cfg, args);
- case FIELD_BINARY: return ansi_gen_equation_f2m(curve, cfg, args);
- default: pari_err_BUG("Field not prime or binary?");
+ case FIELD_PRIME:
+ return ansi_gen_equation_fp(curve, cfg, args);
+ case FIELD_BINARY:
+ return ansi_gen_equation_f2m(curve, cfg, args);
+ default:
+ pari_err_BUG("Field not prime or binary?");
return INT_MIN; /* NOT REACHABLE */
}
}
diff --git a/src/exhaustive/ansi.h b/src/exhaustive/ansi.h
index 74e787e..ec24e13 100644
--- a/src/exhaustive/ansi.h
+++ b/src/exhaustive/ansi.h
@@ -52,4 +52,4 @@ UNROLL(ansi_unroll_seed);
*/
GENERATOR(ansi_gen_equation);
-#endif //ECGEN_ANSI_H
+#endif // ECGEN_ANSI_H
diff --git a/src/exhaustive/exhaustive.c b/src/exhaustive/exhaustive.c
index 0506409..a83bd42 100644
--- a/src/exhaustive/exhaustive.c
+++ b/src/exhaustive/exhaustive.c
@@ -2,8 +2,8 @@
* ecgen, tool for generating Elliptic curve domain parameters
* Copyright (C) 2017 J08nY
*/
-#include <misc/config.h>
#include "exhaustive.h"
+#include <misc/config.h>
#include "anomalous.h"
#include "ansi.h"
#include "gen/curve.h"