Rm multiplication using NAF

Comb method is at most 1% slower for random points,
and is way faster for fixed point (repeated).
This commit is contained in:
Manuel Pégourié-Gonnard 2013-11-20 23:06:14 +01:00
parent 04a0225388
commit 09ceaf49d0
2 changed files with 6 additions and 296 deletions

View file

@ -476,14 +476,9 @@ int ecp_sub( const ecp_group *grp, ecp_point *R,
* has very low overhead, it is recommended to always provide
* a non-NULL f_rng parameter when using secret inputs.
*/
// Temporary, WIP
int ecp_mul_wnaf( ecp_group *grp, ecp_point *R,
const mpi *m, const ecp_point *P,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
int ecp_mul_comb( ecp_group *grp, ecp_point *R,
const mpi *m, const ecp_point *P,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
#define ecp_mul ecp_mul_comb
int ecp_mul( ecp_group *grp, ecp_point *R,
const mpi *m, const ecp_point *P,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
* \brief Check that a point is a valid public key on this curve