session-android/libaxolotl/jni/ed25519/ge_p3_tobytes.c
Moxie Marlinspike 2ed8d333d9 Add ed25519
2014-10-20 12:14:18 -07:00

15 lines
228 B
C

#include "ge.h"
void ge_p3_tobytes(unsigned char *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;
}