mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-01-10 03:27:19 -03:00
ref10: tweak things
This commit is contained in:
parent
9139d302fb
commit
ffb8498905
4 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue