diff --git a/src/precompute_ecmult.c b/src/precompute_ecmult.c index 0c5306bfc..488ba48ad 100644 --- a/src/precompute_ecmult.c +++ b/src/precompute_ecmult.c @@ -75,6 +75,7 @@ int main(void) { fprintf(fp, "#include \"../include/secp256k1.h\"\n"); fprintf(fp, "#include \"group.h\"\n"); fprintf(fp, "#include \"ecmult.h\"\n"); + fprintf(fp, "#include \"precomputed_ecmult.h\"\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, "#if ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE) > %ld\n", ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE)); fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build.\n"); diff --git a/src/precompute_ecmult_gen.c b/src/precompute_ecmult_gen.c index 266efac7e..7c6359c40 100644 --- a/src/precompute_ecmult_gen.c +++ b/src/precompute_ecmult_gen.c @@ -36,6 +36,7 @@ int main(int argc, char **argv) { fprintf(fp, "#include \"../include/secp256k1.h\"\n"); fprintf(fp, "#include \"group.h\"\n"); fprintf(fp, "#include \"ecmult_gen.h\"\n"); + fprintf(fp, "#include \"precomputed_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, "#endif /* EXHAUSTIVE_TEST_ORDER */\n"); diff --git a/src/precomputed_ecmult.c b/src/precomputed_ecmult.c index 7c61450a4..bd7f46aa6 100644 --- a/src/precomputed_ecmult.c +++ b/src/precomputed_ecmult.c @@ -8,6 +8,7 @@ #include "../include/secp256k1.h" #include "group.h" #include "ecmult.h" +#include "precomputed_ecmult.h" #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) #if ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE) > 8192 #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build. diff --git a/src/precomputed_ecmult.h b/src/precomputed_ecmult.h index e7f93138a..949b62c87 100644 --- a/src/precomputed_ecmult.h +++ b/src/precomputed_ecmult.h @@ -7,6 +7,10 @@ #ifndef SECP256K1_PRECOMPUTED_ECMULT_H #define SECP256K1_PRECOMPUTED_ECMULT_H +#ifdef __cplusplus +extern "C" { +#endif + #include "group.h" #if defined(EXHAUSTIVE_TEST_ORDER) #if EXHAUSTIVE_TEST_ORDER == 13 @@ -24,4 +28,8 @@ 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) */ +#ifdef __cplusplus +} +#endif + #endif /* SECP256K1_PRECOMPUTED_ECMULT_H */ diff --git a/src/precomputed_ecmult_gen.c b/src/precomputed_ecmult_gen.c index b03809155..d67291fcf 100644 --- a/src/precomputed_ecmult_gen.c +++ b/src/precomputed_ecmult_gen.c @@ -6,6 +6,7 @@ #include "../include/secp256k1.h" #include "group.h" #include "ecmult_gen.h" +#include "precomputed_ecmult_gen.h" #ifdef EXHAUSTIVE_TEST_ORDER # error Cannot compile precomputed_ecmult_gen.c in exhaustive test mode #endif /* EXHAUSTIVE_TEST_ORDER */ diff --git a/src/precomputed_ecmult_gen.h b/src/precomputed_ecmult_gen.h index 8f62c9cf6..7256ad2e3 100644 --- a/src/precomputed_ecmult_gen.h +++ b/src/precomputed_ecmult_gen.h @@ -7,6 +7,10 @@ #ifndef SECP256K1_PRECOMPUTED_ECMULT_GEN_H #define SECP256K1_PRECOMPUTED_ECMULT_GEN_H +#ifdef __cplusplus +extern "C" { +#endif + #include "group.h" #include "ecmult_gen.h" #ifdef EXHAUSTIVE_TEST_ORDER @@ -15,4 +19,8 @@ static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(EC 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) */ +#ifdef __cplusplus +} +#endif + #endif /* SECP256K1_PRECOMPUTED_ECMULT_GEN_H */