fe_neg.c 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "fe.h"
  2. /*
  3. h = -f
  4. Preconditions:
  5. |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
  6. Postconditions:
  7. |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc.
  8. */
  9. void fe_neg(fe h,const fe f)
  10. {
  11. crypto_int32 f0 = f[0];
  12. crypto_int32 f1 = f[1];
  13. crypto_int32 f2 = f[2];
  14. crypto_int32 f3 = f[3];
  15. crypto_int32 f4 = f[4];
  16. crypto_int32 f5 = f[5];
  17. crypto_int32 f6 = f[6];
  18. crypto_int32 f7 = f[7];
  19. crypto_int32 f8 = f[8];
  20. crypto_int32 f9 = f[9];
  21. crypto_int32 h0 = -f0;
  22. crypto_int32 h1 = -f1;
  23. crypto_int32 h2 = -f2;
  24. crypto_int32 h3 = -f3;
  25. crypto_int32 h4 = -f4;
  26. crypto_int32 h5 = -f5;
  27. crypto_int32 h6 = -f6;
  28. crypto_int32 h7 = -f7;
  29. crypto_int32 h8 = -f8;
  30. crypto_int32 h9 = -f9;
  31. h[0] = h0;
  32. h[1] = h1;
  33. h[2] = h2;
  34. h[3] = h3;
  35. h[4] = h4;
  36. h[5] = h5;
  37. h[6] = h6;
  38. h[7] = h7;
  39. h[8] = h8;
  40. h[9] = h9;
  41. }