Skip to content

Commit

Permalink
refactor: Make generator a parameter of ecmult_gen_create_prec_table
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Dec 3, 2021
1 parent 9ad09f6 commit e1a7653
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ecmult_gen_prec.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

static const size_t ECMULT_GEN_PREC_TABLE_SIZE = ECMULT_GEN_PREC_N * ECMULT_GEN_PREC_G * sizeof(secp256k1_ge_storage);

static void secp256k1_ecmult_gen_create_prec_table(secp256k1_ge_storage* table);
static void secp256k1_ecmult_gen_create_prec_table(secp256k1_ge_storage* table, const secp256k1_ge* gen);

#endif /* SECP256K1_ECMULT_GEN_PREC_H */
4 changes: 2 additions & 2 deletions src/ecmult_gen_prec_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
#include "field_impl.h"
#include "ecmult_gen.h"

static void secp256k1_ecmult_gen_create_prec_table(secp256k1_ge_storage* table) {
static void secp256k1_ecmult_gen_create_prec_table(secp256k1_ge_storage* table, const secp256k1_ge* gen) {
secp256k1_ge prec[ECMULT_GEN_PREC_N * ECMULT_GEN_PREC_G];
secp256k1_gej gj;
secp256k1_gej nums_gej;
int i, j;

/* get the generator */
secp256k1_gej_set_ge(&gj, &secp256k1_ge_const_g);
secp256k1_gej_set_ge(&gj, gen);

/* Construct a group element with no known corresponding scalar (nothing up my sleeve). */
{
Expand Down
2 changes: 1 addition & 1 deletion src/gen_ecmult_gen_static_prec_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int main(int argc, char **argv) {
fprintf(fp, "static const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N][ECMULT_GEN_PREC_G] = {\n");

table = checked_malloc(&default_error_callback, ECMULT_GEN_PREC_TABLE_SIZE);
secp256k1_ecmult_gen_create_prec_table(table);
secp256k1_ecmult_gen_create_prec_table(table, &secp256k1_ge_const_g);
for(outer = 0; outer != ECMULT_GEN_PREC_N; outer++) {
fprintf(fp,"{\n");
for(inner = 0; inner != ECMULT_GEN_PREC_G; inner++) {
Expand Down

0 comments on commit e1a7653

Please sign in to comment.