|
static void | secp256k1_ecmult_odd_multiples_table (int n, secp256k1_gej *prej, secp256k1_fe *zr, const secp256k1_gej *a) |
| Fill a table 'prej' with precomputed odd multiples of a. More...
|
|
static void | secp256k1_ecmult_odd_multiples_table_globalz_windowa (secp256k1_ge *pre, secp256k1_fe *globalz, const secp256k1_gej *a) |
| Fill a table 'pre' with precomputed odd multiples of a. More...
|
|
static void | secp256k1_ecmult_odd_multiples_table_storage_var (const int n, secp256k1_ge_storage *pre, const secp256k1_gej *a) |
|
static void | secp256k1_ecmult_context_init (secp256k1_ecmult_context *ctx) |
|
static void | secp256k1_ecmult_context_build (secp256k1_ecmult_context *ctx, void **prealloc) |
|
static void | secp256k1_ecmult_context_finalize_memcpy (secp256k1_ecmult_context *dst, const secp256k1_ecmult_context *src) |
|
static int | secp256k1_ecmult_context_is_built (const secp256k1_ecmult_context *ctx) |
|
static void | secp256k1_ecmult_context_clear (secp256k1_ecmult_context *ctx) |
|
static int | secp256k1_ecmult_wnaf (int *wnaf, int len, const secp256k1_scalar *a, int w) |
| Convert a number to WNAF notation. More...
|
|
static void | secp256k1_ecmult_strauss_wnaf (const secp256k1_ecmult_context *ctx, const struct secp256k1_strauss_state *state, secp256k1_gej *r, size_t num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) |
|
static void | secp256k1_ecmult (const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) |
|
static size_t | secp256k1_strauss_scratch_size (size_t n_points) |
|
static int | secp256k1_ecmult_strauss_batch (const secp256k1_callback *error_callback, const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n_points, size_t cb_offset) |
|
static int | secp256k1_ecmult_strauss_batch_single (const secp256k1_callback *error_callback, const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n) |
|
static size_t | secp256k1_strauss_max_points (const secp256k1_callback *error_callback, secp256k1_scratch *scratch) |
|
static int | secp256k1_wnaf_fixed (int *wnaf, const secp256k1_scalar *s, int w) |
| Convert a number to WNAF notation. More...
|
|
static int | secp256k1_ecmult_pippenger_wnaf (secp256k1_gej *buckets, int bucket_window, struct secp256k1_pippenger_state *state, secp256k1_gej *r, const secp256k1_scalar *sc, const secp256k1_ge *pt, size_t num) |
|
static int | secp256k1_pippenger_bucket_window (size_t n) |
| Returns optimal bucket_window (number of bits of a scalar represented by a set of buckets) for a given number of points. More...
|
|
static size_t | secp256k1_pippenger_bucket_window_inv (int bucket_window) |
| Returns the maximum optimal number of points for a bucket_window. More...
|
|
static SECP256K1_INLINE void | secp256k1_ecmult_endo_split (secp256k1_scalar *s1, secp256k1_scalar *s2, secp256k1_ge *p1, secp256k1_ge *p2) |
|
static size_t | secp256k1_pippenger_scratch_size (size_t n_points, int bucket_window) |
| Returns the scratch size required for a given number of points (excluding base point G) without considering alignment. More...
|
|
static int | secp256k1_ecmult_pippenger_batch (const secp256k1_callback *error_callback, const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n_points, size_t cb_offset) |
|
static int | secp256k1_ecmult_pippenger_batch_single (const secp256k1_callback *error_callback, const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n) |
|
static size_t | secp256k1_pippenger_max_points (const secp256k1_callback *error_callback, secp256k1_scratch *scratch) |
| Returns the maximum number of points in addition to G that can be used with a given scratch space. More...
|
|
static int | secp256k1_ecmult_multi_simple_var (const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n_points) |
|
static int | secp256k1_ecmult_multi_batch_size_helper (size_t *n_batches, size_t *n_batch_points, size_t max_n_batch_points, size_t n) |
|
static int | secp256k1_ecmult_multi_var (const secp256k1_callback *error_callback, const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n) |
|
#define WINDOW_G ECMULT_WINDOW_SIZE |
Larger values for ECMULT_WINDOW_SIZE result in possibly better performance at the cost of an exponentially larger precomputed table.
The exact table size is (1 << (WINDOW_G - 2)) * sizeof(secp256k1_ge_storage) bytes, where sizeof(secp256k1_ge_storage) is typically 64 bytes but can be larger due to platform-specific padding and alignment. Two tables of this size are used (due to the endomorphism optimization).
Definition at line 44 of file ecmult_impl.h.
Fill a table 'prej' with precomputed odd multiples of a.
Prej will contain the values [1*a,3*a,...,(2*n-1)*a], so it space for n values. zr[0] will contain prej[0].z / a.z. The other zr[i] values = prej[i].z / prej[i-1].z. Prej's Z values are undefined, except for the last value.
Definition at line 85 of file ecmult_impl.h.
Fill a table 'pre' with precomputed odd multiples of a.
There are two versions of this function:
- secp256k1_ecmult_odd_multiples_table_globalz_windowa which brings its resulting point set to a single constant Z denominator, stores the X and Y coordinates as ge_storage points in pre, and stores the global Z in rz. It only operates on tables sized for WINDOW_A wnaf multiples.
- secp256k1_ecmult_odd_multiples_table_storage_var, which converts its resulting point set to actually affine points, and stores those in pre. It operates on tables of any size.
To compute a*P + b*G, we compute a table for P using the first function, and for G using the second (which requires an inverse, but it only needs to happen once).
Definition at line 135 of file ecmult_impl.h.