destatic fe25519_pow22523()

This commit is contained in:
Frank Denis 2017-11-25 18:00:19 +01:00
parent ee2403deba
commit 3998cd7228
3 changed files with 2 additions and 56 deletions

View File

@ -66,61 +66,6 @@ has_small_order(const unsigned char s[32])
return (int) ((k >> 8) & 1);
}
static void
fe25519_pow22523(fe25519 out, const fe25519 z)
{
fe25519 t0;
fe25519 t1;
fe25519 t2;
int i;
fe25519_sq(t0, z);
fe25519_sq(t1, t0);
fe25519_sq(t1, t1);
fe25519_mul(t1, z, t1);
fe25519_mul(t0, t0, t1);
fe25519_sq(t0, t0);
fe25519_mul(t0, t1, t0);
fe25519_sq(t1, t0);
for (i = 1; i < 5; ++i) {
fe25519_sq(t1, t1);
}
fe25519_mul(t0, t1, t0);
fe25519_sq(t1, t0);
for (i = 1; i < 10; ++i) {
fe25519_sq(t1, t1);
}
fe25519_mul(t1, t1, t0);
fe25519_sq(t2, t1);
for (i = 1; i < 20; ++i) {
fe25519_sq(t2, t2);
}
fe25519_mul(t1, t2, t1);
fe25519_sq(t1, t1);
for (i = 1; i < 10; ++i) {
fe25519_sq(t1, t1);
}
fe25519_mul(t0, t1, t0);
fe25519_sq(t1, t0);
for (i = 1; i < 50; ++i) {
fe25519_sq(t1, t1);
}
fe25519_mul(t1, t1, t0);
fe25519_sq(t2, t1);
for (i = 1; i < 100; ++i) {
fe25519_sq(t2, t2);
}
fe25519_mul(t1, t2, t1);
fe25519_sq(t1, t1);
for (i = 1; i < 50; ++i) {
fe25519_sq(t1, t1);
}
fe25519_mul(t0, t1, t0);
fe25519_sq(t0, t0);
fe25519_sq(t0, t0);
fe25519_mul(out, t0, z);
}
static int
is_on_main_subgroup(const fe25519 x1)
{

View File

@ -108,7 +108,7 @@ fe25519_invert(fe25519 out, const fe25519 z)
fe25519_mul(out, t1, t0);
}
static void
void
fe25519_pow22523(fe25519 out, const fe25519 z)
{
fe25519 t0;

View File

@ -17,6 +17,7 @@ typedef int32_t fe25519[10];
void fe25519_invert(fe25519 out, const fe25519 z);
void fe25519_frombytes(fe25519 h, const unsigned char *s);
void fe25519_pow22523(fe25519 out, const fe25519 z);
void fe25519_tobytes(unsigned char *s, const fe25519 h);
#ifdef HAVE_TI_MODE