Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/ecmult_const_impl.h
Show All 40 Lines | |||||
* The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val. | * The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val. | ||||
* It has the following guarantees: | * It has the following guarantees: | ||||
* - each wnaf[i] an odd integer between -(1 << w) and (1 << w) | * - each wnaf[i] an odd integer between -(1 << w) and (1 << w) | ||||
* - each wnaf[i] is nonzero | * - each wnaf[i] is nonzero | ||||
* - the number of words set is always WNAF_SIZE(w) + 1 | * - 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 | * 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.) | * 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 | * CT-RSA 2003, LNCS 2612, pp. 328-443, 2003. Springer-Verlag Berlin Heidelberg 2003 | ||||
* | * | ||||
* Numbers reference steps of `Algorithm SPA-resistant Width-w NAF with Odd Scalar` on pp. 335 | * Numbers reference steps of `Algorithm SPA-resistant Width-w NAF with Odd Scalar` on pp. 335 | ||||
*/ | */ | ||||
static int secp256k1_wnaf_const(int *wnaf, const secp256k1_scalar *scalar, int w, int size) { | static int secp256k1_wnaf_const(int *wnaf, const secp256k1_scalar *scalar, int w, int size) { | ||||
int global_sign; | int global_sign; | ||||
int skew = 0; | int skew = 0; | ||||
int word = 0; | int word = 0; | ||||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |