mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-04-22 23:09:10 +00: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_sq2(fe,const fe);
|
||||||
extern void fe_mul121666(fe,const fe);
|
extern void fe_mul121666(fe,const fe);
|
||||||
extern void fe_invert(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);
|
extern void fe_pow22523(fe,const fe);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// tmp MUST != out
|
// tmp MUST != out
|
||||||
// in MAY == 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 acc;
|
||||||
fe tmpacc;
|
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) {
|
for (i = 0;i < num;++i) {
|
||||||
fe_copy(tmp[i],acc);
|
fe_copy(tmp[i],acc);
|
||||||
fe_mul(acc,acc,in[i]);
|
fe_mul(acc,acc,*in[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fe_invert(acc,acc);
|
fe_invert(acc,acc);
|
||||||
|
|
||||||
i = num;
|
i = num;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
fe_mul(tmpacc,acc,in[i]);
|
fe_mul(tmpacc,acc,*in[i]);
|
||||||
fe_mul(out[i],acc,tmp[i]);
|
fe_mul(*out[i],acc,tmp[i]);
|
||||||
fe_copy(acc,tmpacc);
|
fe_copy(acc,tmpacc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,8 @@ typedef struct {
|
||||||
fe T2d;
|
fe T2d;
|
||||||
} ge_cached;
|
} ge_cached;
|
||||||
|
|
||||||
|
typedef unsigned char bytes32[32];
|
||||||
|
|
||||||
#define ge_frombytes_negate_vartime crypto_sign_ed25519_ref10_ge_frombytes_negate_vartime
|
#define ge_frombytes_negate_vartime crypto_sign_ed25519_ref10_ge_frombytes_negate_vartime
|
||||||
#define ge_tobytes crypto_sign_ed25519_ref10_ge_tobytes
|
#define ge_tobytes crypto_sign_ed25519_ref10_ge_tobytes
|
||||||
#define ge_p3_tobytes crypto_sign_ed25519_ref10_ge_p3_tobytes
|
#define ge_p3_tobytes crypto_sign_ed25519_ref10_ge_p3_tobytes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "ge.h"
|
#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 recip;
|
||||||
fe x;
|
fe x;
|
||||||
|
|
Loading…
Add table
Reference in a new issue