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.

50 lines
1.5 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%>_q
  25. DEFAULT REL
  26. section .text
  27. <%- include('utils.asm.ejs'); %>
  28. <%- include('copy.asm.ejs'); %>
  29. <%- include('montgomery.asm.ejs'); %>
  30. <%- include('add.asm.ejs'); %>
  31. <%- include('sub.asm.ejs'); %>
  32. <%- include('neg.asm.ejs'); %>
  33. <%- include('mul.asm.ejs'); %>
  34. <%- include('binops.asm.ejs'); %>
  35. <%- include('cmpops.asm.ejs'); %>
  36. <%- include('logicalops.asm.ejs'); %>
  37. section .data
  38. <%=name%>_q:
  39. dd 0
  40. dd 0x80000000
  41. q dq <%= constantElement(q) %>
  42. half dq <%= constantElement(q.shiftRight(1)) %>
  43. R2 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*2).mod(q)) %>
  44. R3 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*3).mod(q)) %>
  45. lboMask dq 0x<%= bigInt("8000000000000000",16).shiftRight(n64*64 - q.bitLength()).minus(bigInt.one).toString(16) %>