Skip to content

Commit 075252c

Browse files
committed
Rename ecmult_static_pre_g -> precomputed_ecmult
1 parent 7cf47f7 commit 075252c

6 files changed

+16
-16
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
src/ecmult_static_pre_g.h linguist-generated
1+
src/precomputed_ecmult.h linguist-generated
22
src/precomputed_ecmult_gen.h linguist-generated

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ precompute_ecmult_gen_LDADD = $(SECP_LIBS) $(COMMON_LIB)
147147
# build by a normal user) depends on mtimes, and thus is very fragile.
148148
# This means that rebuilds of the prebuilt files always need to be
149149
# forced by deleting them, e.g., by invoking `make clean-precomp`.
150-
src/ecmult_static_pre_g.h:
150+
src/precomputed_ecmult.h:
151151
$(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(EXEEXT)
152152
./precompute_ecmult$(EXEEXT)
153153
src/precomputed_ecmult_gen.h:
154154
$(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(EXEEXT)
155155
./precompute_ecmult_gen$(EXEEXT)
156156

157-
PRECOMP = src/precomputed_ecmult_gen.h src/ecmult_static_pre_g.h
157+
PRECOMP = src/precomputed_ecmult_gen.h src/precomputed_ecmult.h
158158
noinst_HEADERS += $(PRECOMP)
159159
precomp: $(PRECOMP)
160160

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
152152
[window size for ecmult precomputation for verification, specified as integer in range [2..24].]
153153
[Larger values result in possibly better performance at the cost of an exponentially larger precomputed table.]
154154
[The table will store 2^(SIZE-1) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.]
155-
[A window size larger than 15 will require you delete the prebuilt ecmult_static_pre_g.h file so that it can be rebuilt.]
155+
[A window size larger than 15 will require you delete the prebuilt precomputed_ecmult.h file so that it can be rebuilt.]
156156
[For very large window sizes, use "make -j 1" to reduce memory use during compilation.]
157157
["auto" is a reasonable setting for desktop machines (currently 15). [default=auto]]
158158
)],

src/ecmult_impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "group.h"
1515
#include "scalar.h"
1616
#include "ecmult.h"
17-
#include "ecmult_static_pre_g.h"
17+
#include "precomputed_ecmult.h"
1818

1919
#if defined(EXHAUSTIVE_TEST_ORDER)
2020
/* We need to lower these values for exhaustive tests because
@@ -103,7 +103,7 @@ static void secp256k1_ecmult_odd_multiples_table(int n, secp256k1_gej *prej, sec
103103
* It only operates on tables sized for WINDOW_A wnaf multiples.
104104
*
105105
* To compute a*P + b*G, we compute a table for P using this function,
106-
* and use the precomputed table in <ecmult_static_pre_g.h> for G.
106+
* and use the precomputed table in <precomputed_ecmult.h> for G.
107107
*/
108108
static void secp256k1_ecmult_odd_multiples_table_globalz_windowa(secp256k1_ge *pre, secp256k1_fe *globalz, const secp256k1_gej *a) {
109109
secp256k1_gej prej[ECMULT_TABLE_SIZE(WINDOW_A)];

src/precompute_ecmult.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ int main(void) {
8181
const int window_g_199 = 8;
8282
FILE* fp;
8383

84-
fp = fopen("src/ecmult_static_pre_g.h","w");
84+
fp = fopen("src/precomputed_ecmult.h","w");
8585
if (fp == NULL) {
86-
fprintf(stderr, "Could not open src/ecmult_static_pre_g.h for writing!\n");
86+
fprintf(stderr, "Could not open src/precomputed_ecmult.h for writing!\n");
8787
return -1;
8888
}
8989

9090
fprintf(fp, "/* This file was automatically generated by precompute_ecmult. */\n");
9191
fprintf(fp, "/* This file contains an array secp256k1_pre_g with odd multiples of the base point G and\n");
9292
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");
9393
fprintf(fp, " */\n");
94-
fprintf(fp, "#ifndef SECP256K1_ECMULT_STATIC_PRE_G_H\n");
95-
fprintf(fp, "#define SECP256K1_ECMULT_STATIC_PRE_G_H\n");
94+
fprintf(fp, "#ifndef SECP256K1_PRECOMPUTED_ECMULT_H\n");
95+
fprintf(fp, "#define SECP256K1_PRECOMPUTED_ECMULT_H\n");
9696
fprintf(fp, "#include \"group.h\"\n");
9797
fprintf(fp, "#ifdef S\n");
9898
fprintf(fp, " #error macro identifier S already in use.\n");
@@ -101,7 +101,7 @@ int main(void) {
101101
"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,"
102102
"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");
103103
fprintf(fp, "#if ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE) > %ld\n", ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE));
104-
fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting ecmult_static_pre_g.h before the build.\n");
104+
fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.h before the build.\n");
105105
fprintf(fp, "#endif\n");
106106
fprintf(fp, "#if defined(EXHAUSTIVE_TEST_ORDER)\n");
107107
fprintf(fp, "#if EXHAUSTIVE_TEST_ORDER == 13\n");
@@ -124,7 +124,7 @@ int main(void) {
124124

125125
fprintf(fp, "#endif\n");
126126
fprintf(fp, "#undef S\n");
127-
fprintf(fp, "#endif\n");
127+
fprintf(fp, "#endif /* SECP256K1_PRECOMPUTED_ECMULT_H */\n");
128128
fclose(fp);
129129

130130
return 0;

src/ecmult_static_pre_g.h src/precomputed_ecmult.h

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)