diff --git a/src/precompute_ecmult.c b/src/precompute_ecmult.c index a96aeaa0450dc..0c5306bfcc68f 100644 --- a/src/precompute_ecmult.c +++ b/src/precompute_ecmult.c @@ -70,7 +70,7 @@ int main(void) { fprintf(fp, " * an array secp256k1_pre_g_128 with odd multiples of 2^128*G for accelerating the computation of a*P + b*G.\n"); fprintf(fp, " */\n"); fprintf(fp, "#if defined HAVE_CONFIG_H\n"); - fprintf(fp, "#include \"libsecp256k1-config.h\"\n"); + fprintf(fp, "# include \"libsecp256k1-config.h\"\n"); fprintf(fp, "#endif\n"); fprintf(fp, "#include \"../include/secp256k1.h\"\n"); fprintf(fp, "#include \"group.h\"\n"); @@ -80,7 +80,7 @@ int main(void) { fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build.\n"); fprintf(fp, "#endif\n"); fprintf(fp, "#ifdef EXHAUSTIVE_TEST_ORDER\n"); - fprintf(fp, "#error Cannot compile precomputed_ecmult.c in exhaustive test mode\n"); + fprintf(fp, "# error Cannot compile precomputed_ecmult.c in exhaustive test mode\n"); fprintf(fp, "#endif /* EXHAUSTIVE_TEST_ORDER */\n"); fprintf(fp, "#define WINDOW_G ECMULT_WINDOW_SIZE\n"); diff --git a/src/precompute_ecmult_gen.c b/src/precompute_ecmult_gen.c index 5af94863fd09b..266efac7e0fe5 100644 --- a/src/precompute_ecmult_gen.c +++ b/src/precompute_ecmult_gen.c @@ -31,13 +31,13 @@ int main(int argc, char **argv) { fprintf(fp, "/* This file was automatically generated by precompute_ecmult_gen. */\n"); fprintf(fp, "/* See ecmult_gen_impl.h for details about the contents of this file. */\n"); fprintf(fp, "#if defined HAVE_CONFIG_H\n"); - fprintf(fp, "#include \"libsecp256k1-config.h\"\n"); + fprintf(fp, "# include \"libsecp256k1-config.h\"\n"); fprintf(fp, "#endif\n"); fprintf(fp, "#include \"../include/secp256k1.h\"\n"); fprintf(fp, "#include \"group.h\"\n"); fprintf(fp, "#include \"ecmult_gen.h\"\n"); fprintf(fp, "#ifdef EXHAUSTIVE_TEST_ORDER\n"); - fprintf(fp, "#error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode\n"); + fprintf(fp, "# error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode\n"); fprintf(fp, "#endif /* EXHAUSTIVE_TEST_ORDER */\n"); fprintf(fp, "#define S(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) SECP256K1_GE_STORAGE_CONST(0x##a##u,0x##b##u,0x##c##u,0x##d##u,0x##e##u,0x##f##u,0x##g##u,0x##h##u,0x##i##u,0x##j##u,0x##k##u,0x##l##u,0x##m##u,0x##n##u,0x##o##u,0x##p##u)\n"); fprintf(fp, "const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)] = {\n"); diff --git a/src/precomputed_ecmult.c b/src/precomputed_ecmult.c index bc6c21ce82884..7c61450a428cd 100644 --- a/src/precomputed_ecmult.c +++ b/src/precomputed_ecmult.c @@ -3,7 +3,7 @@ * an array secp256k1_pre_g_128 with odd multiples of 2^128*G for accelerating the computation of a*P + b*G. */ #if defined HAVE_CONFIG_H -#include "libsecp256k1-config.h" +# include "libsecp256k1-config.h" #endif #include "../include/secp256k1.h" #include "group.h" @@ -13,7 +13,7 @@ #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build. #endif #ifdef EXHAUSTIVE_TEST_ORDER -#error Cannot compile precomputed_ecmult.c in exhaustive test mode +# error Cannot compile precomputed_ecmult.c in exhaustive test mode #endif /* EXHAUSTIVE_TEST_ORDER */ #define WINDOW_G ECMULT_WINDOW_SIZE const secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)] = { diff --git a/src/precomputed_ecmult.h b/src/precomputed_ecmult.h index 8fd92e37a1a27..e7f93138a02d3 100644 --- a/src/precomputed_ecmult.h +++ b/src/precomputed_ecmult.h @@ -6,20 +6,22 @@ #ifndef SECP256K1_PRECOMPUTED_ECMULT_H #define SECP256K1_PRECOMPUTED_ECMULT_H + #include "group.h" #if defined(EXHAUSTIVE_TEST_ORDER) #if EXHAUSTIVE_TEST_ORDER == 13 -#define WINDOW_G 4 -#elif EXHAUSTIVE_TEST_ORDER == 199 -#define WINDOW_G 8 -#else - #error No known generator for the specified exhaustive test group order. -#endif +# define WINDOW_G 4 +# elif EXHAUSTIVE_TEST_ORDER == 199 +# define WINDOW_G 8 +# else +# error No known generator for the specified exhaustive test group order. +# endif static secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; static secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; #else /* !defined(EXHAUSTIVE_TEST_ORDER) */ -#define WINDOW_G ECMULT_WINDOW_SIZE +# define WINDOW_G ECMULT_WINDOW_SIZE extern const secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; extern const secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ + #endif /* SECP256K1_PRECOMPUTED_ECMULT_H */ diff --git a/src/precomputed_ecmult_gen.c b/src/precomputed_ecmult_gen.c index 2b1d319c72f6d..b038091554baf 100644 --- a/src/precomputed_ecmult_gen.c +++ b/src/precomputed_ecmult_gen.c @@ -1,13 +1,13 @@ /* This file was automatically generated by precompute_ecmult_gen. */ /* See ecmult_gen_impl.h for details about the contents of this file. */ #if defined HAVE_CONFIG_H -#include "libsecp256k1-config.h" +# include "libsecp256k1-config.h" #endif #include "../include/secp256k1.h" #include "group.h" #include "ecmult_gen.h" #ifdef EXHAUSTIVE_TEST_ORDER -#error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode +# error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode #endif /* EXHAUSTIVE_TEST_ORDER */ #define S(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) SECP256K1_GE_STORAGE_CONST(0x##a##u,0x##b##u,0x##c##u,0x##d##u,0x##e##u,0x##f##u,0x##g##u,0x##h##u,0x##i##u,0x##j##u,0x##k##u,0x##l##u,0x##m##u,0x##n##u,0x##o##u,0x##p##u) const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)] = { diff --git a/src/precomputed_ecmult_gen.h b/src/precomputed_ecmult_gen.h index 052243a0030b9..8f62c9cf6a567 100644 --- a/src/precomputed_ecmult_gen.h +++ b/src/precomputed_ecmult_gen.h @@ -6,6 +6,7 @@ #ifndef SECP256K1_PRECOMPUTED_ECMULT_GEN_H #define SECP256K1_PRECOMPUTED_ECMULT_GEN_H + #include "group.h" #include "ecmult_gen.h" #ifdef EXHAUSTIVE_TEST_ORDER @@ -13,4 +14,5 @@ static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(EC #else extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)]; #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ + #endif /* SECP256K1_PRECOMPUTED_ECMULT_GEN_H */