Bitcoin Core 31.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
ecmult_const_impl.h File Reference
#include "scalar.h"
#include "group.h"
#include "ecmult_const.h"
#include "ecmult_impl.h"
Include dependency graph for ecmult_const_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ECMULT_CONST_GROUP_SIZE   5
#define ECMULT_CONST_TABLE_SIZE   (1L << (ECMULT_CONST_GROUP_SIZE - 1))
#define ECMULT_CONST_GROUPS   ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)
#define ECMULT_CONST_BITS   (ECMULT_CONST_GROUPS * ECMULT_CONST_GROUP_SIZE)
#define ECMULT_CONST_TABLE_GET_GE(r, pre, n)

Functions

static void secp256k1_ecmult_const_odd_multiples_table_globalz (secp256k1_ge *pre, secp256k1_fe *globalz, const secp256k1_gej *a)
 Fill a table 'pre' with precomputed odd multiples of a.
static void secp256k1_ecmult_const (secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q)
static int secp256k1_ecmult_const_xonly (secp256k1_fe *r, const secp256k1_fe *n, const secp256k1_fe *d, const secp256k1_scalar *q, int known_on_curve)

Variables

static const secp256k1_scalar secp256k1_ecmult_const_K = SECP256K1_SCALAR_CONST(0xa4e88a7dul, 0xcb13034eul, 0xc2bdd6bful, 0x7c118d6bul, 0x589ae848ul, 0x26ba29e4ul, 0xb5c2c1dcul, 0xde9798d9ul)

Macro Definition Documentation

◆ ECMULT_CONST_BITS

#define ECMULT_CONST_BITS   (ECMULT_CONST_GROUPS * ECMULT_CONST_GROUP_SIZE)

Definition at line 35 of file ecmult_const_impl.h.

◆ ECMULT_CONST_GROUP_SIZE

#define ECMULT_CONST_GROUP_SIZE   5

Definition at line 30 of file ecmult_const_impl.h.

◆ ECMULT_CONST_GROUPS

#define ECMULT_CONST_GROUPS   ((129 + ECMULT_CONST_GROUP_SIZE - 1) / ECMULT_CONST_GROUP_SIZE)

Definition at line 34 of file ecmult_const_impl.h.

◆ ECMULT_CONST_TABLE_GET_GE

#define ECMULT_CONST_TABLE_GET_GE ( r,
pre,
n )
Value:
do { \
unsigned int m = 0; \
\
volatile unsigned int negative = ((n) >> (ECMULT_CONST_GROUP_SIZE - 1)) ^ 1; \
\
unsigned int index = ((unsigned int)(-negative) ^ n) & ((1U << (ECMULT_CONST_GROUP_SIZE - 1)) - 1U); \
secp256k1_fe neg_y; \
VERIFY_CHECK((n) < (1U << ECMULT_CONST_GROUP_SIZE)); \
VERIFY_CHECK(index < (1U << (ECMULT_CONST_GROUP_SIZE - 1))); \
\
secp256k1_ge_set_xy((r), &(pre)[m].x, &(pre)[m].y); \
for (m = 1; m < ECMULT_CONST_TABLE_SIZE; m++) { \
\
secp256k1_fe_cmov(&(r)->x, &(pre)[m].x, m == index); \
secp256k1_fe_cmov(&(r)->y, &(pre)[m].y, m == index); \
} \
secp256k1_fe_negate(&neg_y, &(r)->y, 1); \
secp256k1_fe_cmov(&(r)->y, &neg_y, negative); \
} while(0)
#define ECMULT_CONST_GROUP_SIZE
#define ECMULT_CONST_TABLE_SIZE
This field implementation represents the value as 10 uint32_t limbs in base 2^26.
Definition field_10x26.h:14

Definition at line 61 of file ecmult_const_impl.h.

◆ ECMULT_CONST_TABLE_SIZE

#define ECMULT_CONST_TABLE_SIZE   (1L << (ECMULT_CONST_GROUP_SIZE - 1))

Definition at line 33 of file ecmult_const_impl.h.

Function Documentation

◆ secp256k1_ecmult_const()

void secp256k1_ecmult_const ( secp256k1_gej * r,
const secp256k1_ge * a,
const secp256k1_scalar * q )
static

Definition at line 122 of file ecmult_const_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_ecmult_const_odd_multiples_table_globalz()

void secp256k1_ecmult_const_odd_multiples_table_globalz ( secp256k1_ge * pre,
secp256k1_fe * globalz,
const secp256k1_gej * a )
static

Fill a table 'pre' with precomputed odd multiples of a.

The resulting point set is brought to a single constant Z denominator, stores the X and Y coordinates as ge points in pre, and stores the global Z in globalz.

'pre' must be an array of size ECMULT_CONST_TABLE_SIZE.

Definition at line 44 of file ecmult_const_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_ecmult_const_xonly()

int secp256k1_ecmult_const_xonly ( secp256k1_fe * r,
const secp256k1_fe * n,
const secp256k1_fe * d,
const secp256k1_scalar * q,
int known_on_curve )
static

Definition at line 268 of file ecmult_const_impl.h.

Here is the call graph for this function:

Variable Documentation

◆ secp256k1_ecmult_const_K

const secp256k1_scalar secp256k1_ecmult_const_K = SECP256K1_SCALAR_CONST(0xa4e88a7dul, 0xcb13034eul, 0xc2bdd6bful, 0x7c118d6bul, 0x589ae848ul, 0x26ba29e4ul, 0xb5c2c1dcul, 0xde9798d9ul)
static

Definition at line 114 of file ecmult_const_impl.h.