You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
2.4 KiB

  1. #include <stdint.h>
  2. #define <%=name%>_N64 <%= n64 %>
  3. #define <%=name%>_SHORT 0x00000000
  4. #define <%=name%>_LONG 0x80000000
  5. #define <%=name%>_LONGMONTGOMERY 0xC0000000
  6. typedef struct __attribute__((__packed__)) {
  7. int32_t shortVal;
  8. u_int32_t type;
  9. u_int64_t longVal[<%=name%>_N64];
  10. } <%=name%>Element;
  11. typedef <%=name%>Element *P<%=name%>Element;
  12. extern <%=name%>Element <%=name%>_q;
  13. extern "C" void <%=name%>_add(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  14. extern "C" void <%=name%>_sub(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  15. extern "C" void <%=name%>_neg(P<%=name%>Element r, P<%=name%>Element a);
  16. extern "C" void <%=name%>_mul(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  17. extern "C" void <%=name%>_square(P<%=name%>Element r, P<%=name%>Element a);
  18. extern "C" void <%=name%>_band(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  19. extern "C" void <%=name%>_bor(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  20. extern "C" void <%=name%>_bxor(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  21. extern "C" void <%=name%>_bnot(P<%=name%>Element r, P<%=name%>Element a);
  22. extern "C" void <%=name%>_eq(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  23. extern "C" void <%=name%>_neq(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  24. extern "C" void <%=name%>_lt(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  25. extern "C" void <%=name%>_gt(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  26. extern "C" void <%=name%>_leq(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  27. extern "C" void <%=name%>_geq(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  28. extern "C" void <%=name%>_land(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  29. extern "C" void <%=name%>_lor(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  30. extern "C" void <%=name%>_lnot(P<%=name%>Element r, P<%=name%>Element a);
  31. extern "C" void <%=name%>_toNormal(P<%=name%>Element pE);
  32. extern "C" void <%=name%>_toMontgomery(P<%=name%>Element pE);
  33. void <%=name%>_str2element(P<%=name%>Element pE, char *s);
  34. char *<%=name%>_element2str(P<%=name%>Element pE);
  35. void <%=name%>_idiv(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  36. void <%=name%>_inv(P<%=name%>Element r, P<%=name%>Element a);
  37. void <%=name%>_div(P<%=name%>Element r, P<%=name%>Element a, P<%=name%>Element b);
  38. extern <%=name%>Element <%=name%>_q;