add methode ge_scalarmult_vartime

This commit is contained in:
WolverinDEV 2018-04-24 20:18:34 +02:00
parent 60c1e612ac
commit b761bf653a
2 changed files with 11 additions and 0 deletions

View File

@ -58,6 +58,7 @@ int ge_frombytes_negate_vartime(ge_p3 *h, const unsigned char *s);
void ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); void ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
void ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q); void ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
void ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A, const unsigned char *b); void ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A, const unsigned char *b);
void ge_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A);
void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q); void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q);
void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q); void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q);
void ge_scalarmult_base(ge_p3 *h, const unsigned char *a); void ge_scalarmult_base(ge_p3 *h, const unsigned char *a);

View File

@ -1,3 +1,4 @@
#include <memory.h>
#include "../include/ge.h" #include "../include/ge.h"
#include "../include/precomp_data.h" #include "../include/precomp_data.h"
@ -57,6 +58,15 @@ static void slide(signed char *r, const unsigned char *a) {
} }
} }
/*
* Warps to ge_double_scalarmult_vartime() => r = a * A + zero * B
*/
void ge_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A) {
unsigned char zero[32];
memset(zero, 0, sizeof(zero));
ge_double_scalarmult_vartime(r, a, A, zero);
}
/* /*
r = a * A + b * B r = a * A + b * B
where a = a[0]+256*a[1]+...+256^31 a[31]. where a = a[0]+256*a[1]+...+256^31 a[31].