25
25
#include "ecmult_gen_prec_impl.h"
26
26
#include "ecmult_prec_impl.h"
27
27
28
- static void precompute_ecmult_print_table (FILE * fp , const char * name , int window_g , const secp256k1_ge_storage * table , int with_conditionals ) {
28
+ static void precompute_ecmult_print_table (FILE * fp , const char * name , int window_g , const secp256k1_ge_storage * table ) {
29
29
int j ;
30
30
int i ;
31
31
@@ -37,29 +37,25 @@ static void precompute_ecmult_print_table(FILE *fp, const char *name, int window
37
37
38
38
j = 1 ;
39
39
for (i = 3 ; i <= window_g ; ++ i ) {
40
- if (with_conditionals ) {
41
- fprintf (fp , "#if ECMULT_TABLE_SIZE(WINDOW_G) > %ld\n" , ECMULT_TABLE_SIZE (i - 1 ));
42
- }
40
+ fprintf (fp , "#if ECMULT_TABLE_SIZE(WINDOW_G) > %ld\n" , ECMULT_TABLE_SIZE (i - 1 ));
43
41
for (;j < ECMULT_TABLE_SIZE (i ); ++ j ) {
44
42
fprintf (fp , ",S(%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32
45
43
",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ",%" PRIx32 ")\n" ,
46
44
SECP256K1_GE_STORAGE_CONST_GET (table [j ]));
47
45
}
48
- if (with_conditionals ) {
49
- fprintf (fp , "#endif\n" );
50
- }
46
+ fprintf (fp , "#endif\n" );
51
47
}
52
48
fprintf (fp , "};\n" );
53
49
}
54
50
55
- static void precompute_ecmult_print_two_tables (FILE * fp , int window_g , const secp256k1_ge * g , int with_conditionals ) {
51
+ static void precompute_ecmult_print_two_tables (FILE * fp , int window_g , const secp256k1_ge * g ) {
56
52
secp256k1_ge_storage * table = malloc (ECMULT_TABLE_SIZE (window_g ) * sizeof (secp256k1_ge_storage ));
57
53
secp256k1_ge_storage * table_128 = malloc (ECMULT_TABLE_SIZE (window_g ) * sizeof (secp256k1_ge_storage ));
58
54
59
55
secp256k1_ecmult_create_prec_two_tables (table , table_128 , window_g , g );
60
56
61
- precompute_ecmult_print_table (fp , "secp256k1_pre_g" , window_g , table , with_conditionals );
62
- precompute_ecmult_print_table (fp , "secp256k1_pre_g_128" , window_g , table_128 , with_conditionals );
57
+ precompute_ecmult_print_table (fp , "secp256k1_pre_g" , window_g , table );
58
+ precompute_ecmult_print_table (fp , "secp256k1_pre_g_128" , window_g , table_128 );
63
59
64
60
free (table );
65
61
free (table_128 );
@@ -106,7 +102,7 @@ static int precompute_ecmult(void) {
106
102
fprintf (fp , "#else /* !defined(EXHAUSTIVE_TEST_ORDER) */\n" );
107
103
fprintf (fp , "#define WINDOW_G ECMULT_WINDOW_SIZE\n" );
108
104
109
- precompute_ecmult_print_two_tables (fp , ECMULT_WINDOW_SIZE , & g , 1 );
105
+ precompute_ecmult_print_two_tables (fp , ECMULT_WINDOW_SIZE , & g );
110
106
111
107
fprintf (fp , "#endif /* EXHAUSTIVE_TEST_ORDER */\n" );
112
108
fprintf (fp , "#undef S\n" );
0 commit comments