diff --git a/ed25519/ref10/fe.h b/ed25519/ref10/fe.h index ea34015..805863c 100644 --- a/ed25519/ref10/fe.h +++ b/ed25519/ref10/fe.h @@ -53,7 +53,7 @@ extern void fe_sq(fe,const fe); extern void fe_sq2(fe,const fe); extern void fe_mul121666(fe,const fe); extern void fe_invert(fe,const fe); -extern void fe_batchinvert(fe out[],fe tmp[],const fe in[], size_t num); +extern void fe_batchinvert(fe *out[],fe tmp[],const fe *in[], size_t num); extern void fe_pow22523(fe,const fe); #endif diff --git a/ed25519/ref10/fe_batchinvert.c b/ed25519/ref10/fe_batchinvert.c index c5a4aaf..629bf1e 100644 --- a/ed25519/ref10/fe_batchinvert.c +++ b/ed25519/ref10/fe_batchinvert.c @@ -2,7 +2,7 @@ // tmp MUST != out // in MAY == out -void fe_batchinvert(fe out[],fe tmp[],const fe in[], size_t num) +void fe_batchinvert(fe *out[],fe tmp[],const fe *in[], size_t num) { fe acc; fe tmpacc; @@ -12,15 +12,15 @@ void fe_batchinvert(fe out[],fe tmp[],const fe in[], size_t num) for (i = 0;i < num;++i) { fe_copy(tmp[i],acc); - fe_mul(acc,acc,in[i]); + fe_mul(acc,acc,*in[i]); } fe_invert(acc,acc); i = num; while (i--) { - fe_mul(tmpacc,acc,in[i]); - fe_mul(out[i],acc,tmp[i]); + fe_mul(tmpacc,acc,*in[i]); + fe_mul(*out[i],acc,tmp[i]); fe_copy(acc,tmpacc); } } diff --git a/ed25519/ref10/ge.h b/ed25519/ref10/ge.h index 55e95f9..69847fd 100644 --- a/ed25519/ref10/ge.h +++ b/ed25519/ref10/ge.h @@ -50,6 +50,8 @@ typedef struct { fe T2d; } ge_cached; +typedef unsigned char bytes32[32]; + #define ge_frombytes_negate_vartime crypto_sign_ed25519_ref10_ge_frombytes_negate_vartime #define ge_tobytes crypto_sign_ed25519_ref10_ge_tobytes #define ge_p3_tobytes crypto_sign_ed25519_ref10_ge_p3_tobytes diff --git a/ed25519/ref10/ge_p3_tobytes.c b/ed25519/ref10/ge_p3_tobytes.c index 21cb2fc..b251f60 100644 --- a/ed25519/ref10/ge_p3_tobytes.c +++ b/ed25519/ref10/ge_p3_tobytes.c @@ -1,6 +1,6 @@ #include "ge.h" -void ge_p3_tobytes(unsigned char *s,const ge_p3 *h) +void ge_p3_tobytes(bytes32 s,const ge_p3 *h) { fe recip; fe x;