aboutsummaryrefslogtreecommitdiff
path: root/src/gen
diff options
context:
space:
mode:
authorJ08nY2017-09-12 20:15:18 +0200
committerJ08nY2017-09-12 20:15:18 +0200
commitcceec4063e74bb29c79500f38aa40fc466180a0b (patch)
treec082b39d2859d17138edcbd74b6a4a5205c7c7ea /src/gen
parent40672ceceeaeb6def572117c30d612f54a73fb1d (diff)
downloadecgen-cceec4063e74bb29c79500f38aa40fc466180a0b.tar.gz
ecgen-cceec4063e74bb29c79500f38aa40fc466180a0b.tar.zst
ecgen-cceec4063e74bb29c79500f38aa40fc466180a0b.zip
Add more utility functions to bits_t.
Diffstat (limited to 'src/gen')
-rw-r--r--src/gen/seed.c3
-rw-r--r--src/gen/types.h10
2 files changed, 6 insertions, 7 deletions
diff --git a/src/gen/seed.c b/src/gen/seed.c
index 628dad5..cc26cb4 100644
--- a/src/gen/seed.c
+++ b/src/gen/seed.c
@@ -129,7 +129,8 @@ static void seed_W(seed_t *seed, const config_t *cfg) {
GEN hash = binascii_btoi(seed->hash20, 20, ENDIAN_BIG);
GEN mask = subis(int2n(itos(h)), 1);
// TODO: what if I get zeros at the beginning? 0123 == 123 for PARI t_INT
- // I should just convert to a t_VECSMALL of bits from the seed->hash and do everything with that.
+ // I should just convert to a t_VECSMALL of bits from the seed->hash and do
+ // everything with that.
// That's alot of custom code to handle bit strings.
GEN c0 = ibitand(hash, mask);
}
diff --git a/src/gen/types.h b/src/gen/types.h
index b6d488e..8507847 100644
--- a/src/gen/types.h
+++ b/src/gen/types.h
@@ -91,9 +91,7 @@ typedef struct {
/**
* @brief
*/
-typedef enum {
- ENDIAN_BIG = 0, ENDIAN_LITTLE
-} endian_e;
+typedef enum { ENDIAN_BIG = 0, ENDIAN_LITTLE } endian_e;
typedef struct {
unsigned char *bits;
@@ -109,7 +107,7 @@ typedef struct {
* @return state diff
*/
#define GENERATOR(gen_name) \
- int gen_name(curve_t *curve, const config_t *cfg, arg_t *args)
+ int gen_name(curve_t *curve, const config_t *cfg, arg_t *args)
typedef GENERATOR((*gen_t));
@@ -122,8 +120,8 @@ typedef GENERATOR((*gen_t));
* @return
*/
#define UNROLL(unroll_name) \
- int unroll_name(curve_t *curve, const config_t *cfg, pari_sp from, \
- pari_sp to)
+ int unroll_name(curve_t *curve, const config_t *cfg, pari_sp from, \
+ pari_sp to)
typedef UNROLL((*unroll_t));