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.

41 lines
1.2 KiB

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