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.

53 lines
1.6 KiB

  1. global <%=name%>_copy
  2. global <%=name%>_copyn
  3. global <%=name%>_add
  4. global <%=name%>_sub
  5. global <%=name%>_neg
  6. global <%=name%>_mul
  7. global <%=name%>_square
  8. global <%=name%>_band
  9. global <%=name%>_bor
  10. global <%=name%>_bxor
  11. global <%=name%>_bnot
  12. global <%=name%>_eq
  13. global <%=name%>_neq
  14. global <%=name%>_lt
  15. global <%=name%>_gt
  16. global <%=name%>_leq
  17. global <%=name%>_geq
  18. global <%=name%>_land
  19. global <%=name%>_lor
  20. global <%=name%>_lnot
  21. global <%=name%>_toNormal
  22. global <%=name%>_toLongNormal
  23. global <%=name%>_toMontgomery
  24. global <%=name%>_toInt
  25. global <%=name%>_isTrue
  26. global <%=name%>_q
  27. extern <%=name%>_fail
  28. DEFAULT REL
  29. section .text
  30. <%- include('utils.asm.ejs'); %>
  31. <%- include('copy.asm.ejs'); %>
  32. <%- include('montgomery.asm.ejs'); %>
  33. <%- include('add.asm.ejs'); %>
  34. <%- include('sub.asm.ejs'); %>
  35. <%- include('neg.asm.ejs'); %>
  36. <%- include('mul.asm.ejs'); %>
  37. <%- include('binops.asm.ejs'); %>
  38. <%- include('cmpops.asm.ejs'); %>
  39. <%- include('logicalops.asm.ejs'); %>
  40. section .data
  41. <%=name%>_q:
  42. dd 0
  43. dd 0x80000000
  44. q dq <%= constantElement(q) %>
  45. half dq <%= constantElement(q.shiftRight(1)) %>
  46. R2 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*2).mod(q)) %>
  47. R3 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*3).mod(q)) %>
  48. lboMask dq 0x<%= bigInt("8000000000000000",16).shiftRight(n64*64 - q.bitLength()).minus(bigInt.one).toString(16) %>