7#ifndef SECP256K1_ECMULT_GEN_COMPUTE_TABLE_IMPL_H
8#define SECP256K1_ECMULT_GEN_COMPUTE_TABLE_IMPL_H
20 secp256k1_ge* prec = checked_malloc(&default_error_callback, n * g *
sizeof(*prec));
26 secp256k1_gej_set_ge(&gj, gen);
30 static const unsigned char nums_b32[33] =
"The scalar for this x is unknown";
34 r = secp256k1_fe_set_b32(&nums_x, nums_b32);
37 r = secp256k1_ge_set_xo_var(&nums_ge, &nums_x, 0);
40 secp256k1_gej_set_ge(&nums_gej, &nums_ge);
42 secp256k1_gej_add_ge_var(&nums_gej, &nums_gej, gen, NULL);
49 secp256k1_gej* precj = checked_malloc(&default_error_callback, n * g *
sizeof(*precj));
52 for (
j = 0;
j < n;
j++) {
54 precj[
j*g] = numsbase;
55 for (i = 1; i < g; i++) {
56 secp256k1_gej_add_var(&precj[
j*g + i], &precj[
j*g + i - 1], &gbase, NULL);
59 for (i = 0; i < bits; i++) {
60 secp256k1_gej_double_var(&gbase, &gbase, NULL);
63 secp256k1_gej_double_var(&numsbase, &numsbase, NULL);
66 secp256k1_gej_neg(&numsbase, &numsbase);
67 secp256k1_gej_add_var(&numsbase, &numsbase, &nums_gej, NULL);
70 secp256k1_ge_set_all_gej_var(prec, precj, n * g);
73 for (
j = 0;
j < n;
j++) {
74 for (i = 0; i < g; i++) {
75 secp256k1_ge_to_storage(&table[
j*g + i], &prec[
j*g + i]);
#define ECMULT_GEN_PREC_G(bits)
#define ECMULT_GEN_PREC_N(bits)
#define VERIFY_CHECK(cond)