|
static void | secp256k1_ecmult_odd_multiples_table (int n, secp256k1_ge *pre_a, secp256k1_fe *zr, secp256k1_fe *z, const secp256k1_gej *a) |
| Fill a table 'pre_a' with precomputed odd multiples of a. More...
|
|
static SECP256K1_INLINE void | secp256k1_ecmult_table_verify (int n, int w) |
|
static SECP256K1_INLINE void | secp256k1_ecmult_table_get_ge (secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) |
|
static SECP256K1_INLINE void | secp256k1_ecmult_table_get_ge_lambda (secp256k1_ge *r, const secp256k1_ge *pre, const secp256k1_fe *x, int n, int w) |
|
static SECP256K1_INLINE void | secp256k1_ecmult_table_get_ge_storage (secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) |
|
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 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 (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, 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, 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, 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, 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 (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, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n) |
|
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 'pre_a' with precomputed odd multiples of a.
pre_a will contain [1*a,3*a,...,(2*n-1)*a], so it needs space for n group elements. zr needs space for n field elements.
Although pre_a is an array of _ge rather than _gej, it actually represents elements in Jacobian coordinates with their z coordinates omitted. The omitted z-coordinates can be recovered using z and zr. Using the notation z(b) to represent the omitted z coordinate of b:
- z(pre_a[n-1]) = 'z'
- z(pre_a[i-1]) = z(pre_a[i]) / zr[i] for n > i > 0
Lastly the zr[0] value, which isn't used above, is set so that:
- a.z = z(pre_a[0]) / zr[0]
Definition at line 73 of file ecmult_impl.h.