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.

72 lines
1.3 KiB

  1. <% global.setTypeDest = function (t) {
  2. return (
  3. ` mov r11b, ${t}
  4. shl r11, 56
  5. mov [rdi], r11`);
  6. } %>
  7. <% global.toMont_a = function () {
  8. return (
  9. ` push rdi
  10. mov rdi, rsi
  11. mov rsi, rdx
  12. call ${name}_toMontgomery
  13. mov rdx, rsi
  14. mov rsi, rdi
  15. pop rdi`);
  16. } %>
  17. <% global.toMont_b = function() {
  18. return (
  19. ` push rdi
  20. mov rdi, rdx
  21. call ${name}_toMontgomery
  22. mov rdx, rdi
  23. pop rdi`);
  24. } %>
  25. <% global.fromMont_a = function () {
  26. return (
  27. ` push rdi
  28. mov rdi, rsi
  29. mov rsi, rdx
  30. call ${name}_toNormal
  31. mov rdx, rsi
  32. mov rsi, rdi
  33. pop rdi`);
  34. } %>
  35. <% global.fromMont_b = function() {
  36. return (
  37. ` push rdi
  38. mov rdi, rdx
  39. call ${name}_toNormal
  40. mov rdx, rdi
  41. pop rdi`);
  42. } %>
  43. <% global.toLong_a = function () {
  44. return (
  45. ` push rdi
  46. push rdx
  47. mov rdi, rsi
  48. movsx rsi, r8d
  49. call rawCopyS2L
  50. mov rsi, rdi
  51. pop rdx
  52. pop rdi`);
  53. } %>
  54. <% global.toLong_b = function() {
  55. return (
  56. ` push rdi
  57. push rsi
  58. mov rdi, rdx
  59. movsx rsi, r9d
  60. call rawCopyS2L
  61. mov rdx, rdi
  62. pop rsi
  63. pop rdi`);
  64. } %>