Raven Core  3.0.0
P2P Digital Currency
Macros
ecmult_impl.h File Reference
#include <string.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.

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 ECMULT_TABLE_SIZE(w)   (1 << ((w)-2))
 The number of entries a table with precomputed multiples needs to have. More...
 
#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)
 

Macro Definition Documentation

◆ 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 134 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 145 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 45 of file ecmult_impl.h.

◆ WINDOW_A

#define WINDOW_A   5

Definition at line 32 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 40 of file ecmult_impl.h.