PIVX Core  5.6.99
P2P Digital Currency
Classes | Macros | Typedefs
ecmult_impl.h File Reference
#include <string.h>
#include <stdint.h>
#include "group.h"
#include "scalar.h"
#include "ecmult.h"
Include dependency graph for ecmult_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  secp256k1_strauss_point_state
 
struct  secp256k1_strauss_state
 
struct  secp256k1_pippenger_point_state
 
struct  secp256k1_pippenger_state
 

Macros

#define WINDOW_A   5
 
#define WINDOW_G   16
 larger numbers may result in slightly better performance, at the cost of exponentially larger precomputed tables. More...
 
#define WNAF_BITS   256
 
#define WNAF_SIZE_BITS(bits, w)   (((bits) + (w) - 1) / (w))
 
#define WNAF_SIZE(w)   WNAF_SIZE_BITS(WNAF_BITS, w)
 
#define ECMULT_TABLE_SIZE(w)   (1 << ((w)-2))
 The number of entries a table with precomputed multiples needs to have. More...
 
#define PIPPENGER_SCRATCH_OBJECTS   6
 
#define STRAUSS_SCRATCH_OBJECTS   6
 
#define PIPPENGER_MAX_BUCKET_WINDOW   12
 
#define ECMULT_PIPPENGER_THRESHOLD   160
 
#define ECMULT_MAX_POINTS_PER_BATCH   10000000
 
#define ECMULT_TABLE_GET_GE(r, pre, n, w)
 The following two macro retrieves a particular odd multiple from a table of precomputed multiples. More...
 
#define ECMULT_TABLE_GET_GE_STORAGE(r, pre, n, w)
 

Typedefs

typedef int(* secp256k1_ecmult_multi_func) (const secp256k1_ecmult_context *, secp256k1_scratch *, secp256k1_gej *, const secp256k1_scalar *, secp256k1_ecmult_multi_callback cb, void *, size_t)
 

Macro Definition Documentation

◆ ECMULT_MAX_POINTS_PER_BATCH

#define ECMULT_MAX_POINTS_PER_BATCH   10000000

Definition at line 72 of file ecmult_impl.h.

◆ ECMULT_PIPPENGER_THRESHOLD

#define ECMULT_PIPPENGER_THRESHOLD   160

Definition at line 66 of file ecmult_impl.h.

◆ ECMULT_TABLE_GET_GE

#define ECMULT_TABLE_GET_GE (   r,
  pre,
  n,
 
)
Value:
do { \
VERIFY_CHECK(((n) & 1) == 1); \
VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \
VERIFY_CHECK((n) <= ((1 << ((w)-1)) - 1)); \
if ((n) > 0) { \
*(r) = (pre)[((n)-1)/2]; \
} else { \
secp256k1_ge_neg((r), &(pre)[(-(n)-1)/2]); \
} \
} while(0)

The following two macro retrieves a particular odd multiple from a table of precomputed multiples.

Definition at line 162 of file ecmult_impl.h.

◆ ECMULT_TABLE_GET_GE_STORAGE

#define ECMULT_TABLE_GET_GE_STORAGE (   r,
  pre,
  n,
 
)
Value:
do { \
VERIFY_CHECK(((n) & 1) == 1); \
VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \
VERIFY_CHECK((n) <= ((1 << ((w)-1)) - 1)); \
if ((n) > 0) { \
secp256k1_ge_from_storage((r), &(pre)[((n)-1)/2]); \
} else { \
secp256k1_ge_from_storage((r), &(pre)[(-(n)-1)/2]); \
secp256k1_ge_neg((r), (r)); \
} \
} while(0)

Definition at line 173 of file ecmult_impl.h.

◆ ECMULT_TABLE_SIZE

#define ECMULT_TABLE_SIZE (   w)    (1 << ((w)-2))

The number of entries a table with precomputed multiples needs to have.

Definition at line 54 of file ecmult_impl.h.

◆ PIPPENGER_MAX_BUCKET_WINDOW

#define PIPPENGER_MAX_BUCKET_WINDOW   12

Definition at line 60 of file ecmult_impl.h.

◆ PIPPENGER_SCRATCH_OBJECTS

#define PIPPENGER_SCRATCH_OBJECTS   6

Definition at line 57 of file ecmult_impl.h.

◆ STRAUSS_SCRATCH_OBJECTS

#define STRAUSS_SCRATCH_OBJECTS   6

Definition at line 58 of file ecmult_impl.h.

◆ WINDOW_A

#define WINDOW_A   5

Definition at line 33 of file ecmult_impl.h.

◆ WINDOW_G

#define WINDOW_G   16

larger numbers may result in slightly better performance, at the cost of exponentially larger precomputed tables.

One table for window size 16: 1.375 MiB.

Definition at line 41 of file ecmult_impl.h.

◆ WNAF_BITS

#define WNAF_BITS   256

Definition at line 48 of file ecmult_impl.h.

◆ WNAF_SIZE

#define WNAF_SIZE (   w)    WNAF_SIZE_BITS(WNAF_BITS, w)

Definition at line 51 of file ecmult_impl.h.

◆ WNAF_SIZE_BITS

#define WNAF_SIZE_BITS (   bits,
 
)    (((bits) + (w) - 1) / (w))

Definition at line 50 of file ecmult_impl.h.

Typedef Documentation

◆ secp256k1_ecmult_multi_func

typedef int(* secp256k1_ecmult_multi_func) (const secp256k1_ecmult_context *, secp256k1_scratch *, secp256k1_gej *, const secp256k1_scalar *, secp256k1_ecmult_multi_callback cb, void *, size_t)

Definition at line 975 of file ecmult_impl.h.