text: // Copyright (c) 2012-2017, The CryptoNote Developers, The Bytecoin Developers
  // Copyright (c) 2020, The TurtleCoin Developers
  //
  // Please see the included LICENSE file for more information.
  
  #include "ge_p3_tobytes.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;
  }