Skip to content

Commit 8ae18f1

Browse files
refactor: Rename file that contains static ecmult_gen table
1 parent 00d2fa1 commit 8ae18f1

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

Makefile.am

+7-7
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ $(gen_context_OBJECTS): src/gen_context.c src/libsecp256k1-config.h
143143
$(gen_context_BIN): $(gen_context_OBJECTS)
144144
$(CC_FOR_BUILD) $(SECP_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
145145

146-
$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
147-
$(tests_OBJECTS): src/ecmult_static_context.h
148-
$(exhaustive_tests_OBJECTS): src/ecmult_static_context.h
149-
$(bench_internal_OBJECTS): src/ecmult_static_context.h
150-
$(bench_ecmult_OBJECTS): src/ecmult_static_context.h
146+
$(libsecp256k1_la_OBJECTS): src/ecmult_gen_static_prec_table.h
147+
$(tests_OBJECTS): src/ecmult_gen_static_prec_table.h
148+
$(exhaustive_tests_OBJECTS): src/ecmult_gen_static_prec_table.h
149+
$(bench_internal_OBJECTS): src/ecmult_gen_static_prec_table.h
150+
$(bench_ecmult_OBJECTS): src/ecmult_gen_static_prec_table.h
151151

152-
src/ecmult_static_context.h: $(gen_context_BIN)
152+
src/ecmult_gen_static_prec_table.h: $(gen_context_BIN)
153153
./$(gen_context_BIN)
154154

155-
CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h
155+
CLEANFILES = $(gen_context_BIN) src/ecmult_gen_static_prec_table.h
156156
endif
157157

158158
EXTRA_DIST = autogen.sh src/gen_context.c src/ecmult_static_pre_g.h src/basic-config.h

src/ecmult_gen_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "group.h"
1313
#include "ecmult_gen.h"
1414
#include "hash_impl.h"
15-
#include "ecmult_static_context.h"
15+
#include "ecmult_gen_static_prec_table.h"
1616

1717
static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx) {
1818
secp256k1_ecmult_gen_blind(ctx, NULL);

src/gen_context.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,24 @@ int main(int argc, char **argv) {
3838
secp256k1_ge_storage* table;
3939
int inner;
4040
int outer;
41+
const char outfile[] = "src/ecmult_gen_static_prec_table.h";
4142
FILE* fp;
4243

4344
(void)argc;
4445
(void)argv;
4546

46-
fp = fopen("src/ecmult_static_context.h","w");
47+
fp = fopen(outfile, "w");
4748
if (fp == NULL) {
48-
fprintf(stderr, "Could not open src/ecmult_static_context.h for writing!\n");
49+
fprintf(stderr, "Could not open %s for writing!\n", outfile);
4950
return -1;
5051
}
5152

52-
fprintf(fp, "#ifndef SECP256K1_ECMULT_STATIC_CONTEXT_H\n");
53-
fprintf(fp, "#define SECP256K1_ECMULT_STATIC_CONTEXT_H\n");
53+
fprintf(fp, "#ifndef SECP256K1_ECMULT_GEN_STATIC_PREC_TABLE_H\n");
54+
fprintf(fp, "#define SECP256K1_ECMULT_GEN_STATIC_PREC_TABLE_H\n");
5455
fprintf(fp, "#include \"src/group.h\"\n");
5556
fprintf(fp, "#define SC SECP256K1_GE_STORAGE_CONST\n");
5657
fprintf(fp, "#if ECMULT_GEN_PREC_N != %d || ECMULT_GEN_PREC_G != %d\n", ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G);
57-
fprintf(fp, " #error configuration mismatch, invalid ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G. Try deleting ecmult_static_context.h before the build.\n");
58+
fprintf(fp, " #error configuration mismatch, invalid ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G. Try deleting %s before the build.\n", outfile);
5859
fprintf(fp, "#endif\n");
5960
fprintf(fp, "static const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N][ECMULT_GEN_PREC_G] = {\n");
6061

0 commit comments

Comments
 (0)