mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-06-01 04:12:14 +00:00
add missing files, 2 stage batch pack
This commit is contained in:
parent
f944bb64a2
commit
8f248cbd14
2 changed files with 50 additions and 0 deletions
24
ed25519/amd64-64-24k/ge25519_batchpack.c
Normal file
24
ed25519/amd64-64-24k/ge25519_batchpack.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "fe25519.h"
|
||||
#include "ge25519.h"
|
||||
|
||||
// assumes inz[] points to things in in[]
|
||||
// NOTE: leaves in unfinished state
|
||||
void ge25519_batchpack_destructive_1(bytes32 out[], ge25519_p3 in[], fe25519 *inz[], fe25519 tmp[], size_t num)
|
||||
{
|
||||
fe25519 ty;
|
||||
|
||||
fe25519_batchinvert(inz, tmp, inz, num);
|
||||
|
||||
for (size_t i = 0; i < num; ++i) {
|
||||
fe25519_mul(&ty, &in[i].y, &in[i].z);
|
||||
fe25519_pack(out[i], &ty);
|
||||
}
|
||||
}
|
||||
|
||||
void ge25519_batchpack_destructive_finish(bytes32 out, ge25519_p3 *unf)
|
||||
{
|
||||
fe25519 tx;
|
||||
// z of unfinished is inverted
|
||||
fe25519_mul(&tx, &unf->x, &unf->z);
|
||||
out[31] ^= fe25519_getparity(&tx) << 7;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue