Remove ge_scalarmult_vartime() which is not used any more

This commit is contained in:
Frank Denis 2017-10-31 16:10:51 +01:00
parent 0b734963db
commit a3f96045d4

View File

@ -1863,71 +1863,6 @@ ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a, const ge_p3 *A,
}
}
#ifndef MINIMAL
/* only used for verification of legacy (edwards25519sha512batch) signatures */
void
ge_scalarmult_vartime(ge_p3 *r, const unsigned char *a, const ge_p3 *A)
{
signed char aslide[256];
ge_cached Ai[8];
ge_p1p1 t;
ge_p3 u;
ge_p3 A2;
int i;
slide_vartime(aslide, a);
ge_p3_to_cached(&Ai[0], A);
ge_p3_dbl(&t, A);
ge_p1p1_to_p3(&A2, &t);
ge_add(&t, &A2, &Ai[0]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[1], &u);
ge_add(&t, &A2, &Ai[1]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[2], &u);
ge_add(&t, &A2, &Ai[2]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[3], &u);
ge_add(&t, &A2, &Ai[3]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[4], &u);
ge_add(&t, &A2, &Ai[4]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[5], &u);
ge_add(&t, &A2, &Ai[5]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[6], &u);
ge_add(&t, &A2, &Ai[6]);
ge_p1p1_to_p3(&u, &t);
ge_p3_to_cached(&Ai[7], &u);
ge_p3_0(r);
for (i = 255; i >= 0; --i) {
if (aslide[i])
break;
}
for (; i >= 0; --i) {
ge_p3_dbl(&t, r);
if (aslide[i] > 0) {
ge_p1p1_to_p3(&u, &t);
ge_add(&t, &u, &Ai[aslide[i] / 2]);
} else if (aslide[i] < 0) {
ge_p1p1_to_p3(&u, &t);
ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]);
}
ge_p1p1_to_p3(r, &t);
}
}
#endif
/*
h = a * p
where a = a[0]+256*a[1]+...+256^31 a[31]