ge_tobytes.c 225 B

1234567891011121314
  1. #include "ge.h"
  2. void ge_tobytes(unsigned char *s,const ge_p2 *h)
  3. {
  4. fe recip;
  5. fe x;
  6. fe y;
  7. fe_invert(recip,h->Z);
  8. fe_mul(x,h->X,recip);
  9. fe_mul(y,h->Y,recip);
  10. fe_tobytes(s,y);
  11. s[31] ^= fe_isnegative(x) << 7;
  12. }