session-android/libaxolotl/jni/ed25519/ge_tobytes.c

15 lines
225 B
C
Raw Normal View History

2014-06-24 19:59:22 +00:00
#include "ge.h"
void ge_tobytes(unsigned char *s,const ge_p2 *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;
}