Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the source code of this file.
Macros | |
#define | ECMULT_CONST_TABLE_GET_GE(r, pre, n, w) |
Functions | |
static int | secp256k1_wnaf_const (int *wnaf, secp256k1_scalar s, int w, int size) |
Convert a number to WNAF notation. More... | |
static void | secp256k1_ecmult_const (secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *scalar, int size) |
Macro Definition Documentation
◆ ECMULT_CONST_TABLE_GET_GE
#define ECMULT_CONST_TABLE_GET_GE | ( | r, | |
pre, | |||
n, | |||
w | |||
) |
Definition at line 16 of file ecmult_const_impl.h.
Referenced by secp256k1_ecmult_const().
Function Documentation
◆ secp256k1_ecmult_const()
|
static |
Definition at line 120 of file ecmult_const_impl.h.
References ECMULT_CONST_TABLE_GET_GE, ECMULT_TABLE_SIZE, secp256k1_ecmult_odd_multiples_table_globalz_windowa(), secp256k1_fe_mul(), secp256k1_fe_normalize_weak(), secp256k1_ge_from_storage(), secp256k1_ge_neg(), secp256k1_ge_set_gej(), secp256k1_ge_storage_cmov(), secp256k1_ge_to_storage(), secp256k1_gej_add_ge(), secp256k1_gej_double_nonzero(), secp256k1_gej_double_var(), secp256k1_gej_set_ge(), secp256k1_wnaf_const(), VERIFY_CHECK, WINDOW_A, WNAF_SIZE, WNAF_SIZE_BITS, and secp256k1_gej::z.
◆ secp256k1_wnaf_const()
|
static |
Convert a number to WNAF notation.
The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val. It has the following guarantees:
- each wnaf[i] an odd integer between -(1 << w) and (1 << w)
- each wnaf[i] is nonzero
- the number of words set is always WNAF_SIZE(w) + 1
Adapted from The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar Multiplications Secure against Side Channel Attacks
, Okeya and Tagaki. M. Joye (Ed.) CT-RSA 2003, LNCS 2612, pp. 328-443, 2003. Springer-Verlagy Berlin Heidelberg 2003
Numbers reference steps of Algorithm SPA-resistant Width-w NAF with Odd Scalar
on pp. 335
Definition at line 51 of file ecmult_const_impl.h.
References secp256k1_scalar_cadd_bit(), secp256k1_scalar_cond_negate(), secp256k1_scalar_is_even(), secp256k1_scalar_is_high(), secp256k1_scalar_is_one(), secp256k1_scalar_is_zero(), secp256k1_scalar_negate(), secp256k1_scalar_shr_int(), VERIFY_CHECK, and WNAF_SIZE_BITS.
Referenced by bench_wnaf_const(), secp256k1_ecmult_const(), and test_constant_wnaf().