mkp224o/ed25519/ref10/ge_p3_tobytes.c
2019-01-19 14:39:33 +00:00

15 lines
221 B
C

#include "ge.h"
void ge_p3_tobytes(bytes32 s,const ge_p3 *h)
{
fe recip;
fe x;
fe y;
fe_invert(recip,h->Z);
fe_mul(x,h->X,recip);
fe_mul(y,h->Y,recip);
fe_tobytes(s,y);
s[31] ^= fe_isnegative(x) << 7;
}