fe.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef FE_H
  2. #define FE_H
  3. #include "crypto_int32.h"
  4. typedef crypto_int32 fe[10];
  5. /*
  6. fe means field element.
  7. Here the field is \Z/(2^255-19).
  8. An element t, entries t[0]...t[9], represents the integer
  9. t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
  10. Bounds on each t[i] vary depending on context.
  11. */
  12. #define fe_frombytes crypto_scalarmult_curve25519_ref10_fe_frombytes
  13. #define fe_tobytes crypto_scalarmult_curve25519_ref10_fe_tobytes
  14. #define fe_copy crypto_scalarmult_curve25519_ref10_fe_copy
  15. #define fe_0 crypto_scalarmult_curve25519_ref10_fe_0
  16. #define fe_1 crypto_scalarmult_curve25519_ref10_fe_1
  17. #define fe_cswap crypto_scalarmult_curve25519_ref10_fe_cswap
  18. #define fe_add crypto_scalarmult_curve25519_ref10_fe_add
  19. #define fe_sub crypto_scalarmult_curve25519_ref10_fe_sub
  20. #define fe_mul crypto_scalarmult_curve25519_ref10_fe_mul
  21. #define fe_sq crypto_scalarmult_curve25519_ref10_fe_sq
  22. #define fe_mul121666 crypto_scalarmult_curve25519_ref10_fe_mul121666
  23. #define fe_invert crypto_scalarmult_curve25519_ref10_fe_invert
  24. extern void fe_frombytes(fe,const unsigned char *);
  25. extern void fe_tobytes(unsigned char *,fe);
  26. extern void fe_copy(fe,fe);
  27. extern void fe_0(fe);
  28. extern void fe_1(fe);
  29. extern void fe_cswap(fe,fe,unsigned int);
  30. extern void fe_add(fe,fe,fe);
  31. extern void fe_sub(fe,fe,fe);
  32. extern void fe_mul(fe,fe,fe);
  33. extern void fe_sq(fe,fe);
  34. extern void fe_mul121666(fe,fe);
  35. extern void fe_invert(fe,fe);
  36. #endif