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.

47 lines
1.4 KiB

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