x25519-x86_64.s 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. .text
  2. .globl x25519_fe51_mul
  3. .type x25519_fe51_mul,@function
  4. .align 32
  5. x25519_fe51_mul:
  6. .cfi_startproc
  7. pushq %rbp
  8. .cfi_adjust_cfa_offset 8
  9. .cfi_offset %rbp,-16
  10. pushq %rbx
  11. .cfi_adjust_cfa_offset 8
  12. .cfi_offset %rbx,-24
  13. pushq %r12
  14. .cfi_adjust_cfa_offset 8
  15. .cfi_offset %r12,-32
  16. pushq %r13
  17. .cfi_adjust_cfa_offset 8
  18. .cfi_offset %r13,-40
  19. pushq %r14
  20. .cfi_adjust_cfa_offset 8
  21. .cfi_offset %r14,-48
  22. pushq %r15
  23. .cfi_adjust_cfa_offset 8
  24. .cfi_offset %r15,-56
  25. leaq -40(%rsp),%rsp
  26. .cfi_adjust_cfa_offset 40
  27. .Lfe51_mul_body:
  28. movq 0(%rsi),%rax
  29. movq 0(%rdx),%r11
  30. movq 8(%rdx),%r12
  31. movq 16(%rdx),%r13
  32. movq 24(%rdx),%rbp
  33. movq 32(%rdx),%r14
  34. movq %rdi,32(%rsp)
  35. movq %rax,%rdi
  36. mulq %r11
  37. movq %r11,0(%rsp)
  38. movq %rax,%rbx
  39. movq %rdi,%rax
  40. movq %rdx,%rcx
  41. mulq %r12
  42. movq %r12,8(%rsp)
  43. movq %rax,%r8
  44. movq %rdi,%rax
  45. leaq (%r14,%r14,8),%r15
  46. movq %rdx,%r9
  47. mulq %r13
  48. movq %r13,16(%rsp)
  49. movq %rax,%r10
  50. movq %rdi,%rax
  51. leaq (%r14,%r15,2),%rdi
  52. movq %rdx,%r11
  53. mulq %rbp
  54. movq %rax,%r12
  55. movq 0(%rsi),%rax
  56. movq %rdx,%r13
  57. mulq %r14
  58. movq %rax,%r14
  59. movq 8(%rsi),%rax
  60. movq %rdx,%r15
  61. mulq %rdi
  62. addq %rax,%rbx
  63. movq 16(%rsi),%rax
  64. adcq %rdx,%rcx
  65. mulq %rdi
  66. addq %rax,%r8
  67. movq 24(%rsi),%rax
  68. adcq %rdx,%r9
  69. mulq %rdi
  70. addq %rax,%r10
  71. movq 32(%rsi),%rax
  72. adcq %rdx,%r11
  73. mulq %rdi
  74. imulq $19,%rbp,%rdi
  75. addq %rax,%r12
  76. movq 8(%rsi),%rax
  77. adcq %rdx,%r13
  78. mulq %rbp
  79. movq 16(%rsp),%rbp
  80. addq %rax,%r14
  81. movq 16(%rsi),%rax
  82. adcq %rdx,%r15
  83. mulq %rdi
  84. addq %rax,%rbx
  85. movq 24(%rsi),%rax
  86. adcq %rdx,%rcx
  87. mulq %rdi
  88. addq %rax,%r8
  89. movq 32(%rsi),%rax
  90. adcq %rdx,%r9
  91. mulq %rdi
  92. imulq $19,%rbp,%rdi
  93. addq %rax,%r10
  94. movq 8(%rsi),%rax
  95. adcq %rdx,%r11
  96. mulq %rbp
  97. addq %rax,%r12
  98. movq 16(%rsi),%rax
  99. adcq %rdx,%r13
  100. mulq %rbp
  101. movq 8(%rsp),%rbp
  102. addq %rax,%r14
  103. movq 24(%rsi),%rax
  104. adcq %rdx,%r15
  105. mulq %rdi
  106. addq %rax,%rbx
  107. movq 32(%rsi),%rax
  108. adcq %rdx,%rcx
  109. mulq %rdi
  110. addq %rax,%r8
  111. movq 8(%rsi),%rax
  112. adcq %rdx,%r9
  113. mulq %rbp
  114. imulq $19,%rbp,%rdi
  115. addq %rax,%r10
  116. movq 16(%rsi),%rax
  117. adcq %rdx,%r11
  118. mulq %rbp
  119. addq %rax,%r12
  120. movq 24(%rsi),%rax
  121. adcq %rdx,%r13
  122. mulq %rbp
  123. movq 0(%rsp),%rbp
  124. addq %rax,%r14
  125. movq 32(%rsi),%rax
  126. adcq %rdx,%r15
  127. mulq %rdi
  128. addq %rax,%rbx
  129. movq 8(%rsi),%rax
  130. adcq %rdx,%rcx
  131. mulq %rbp
  132. addq %rax,%r8
  133. movq 16(%rsi),%rax
  134. adcq %rdx,%r9
  135. mulq %rbp
  136. addq %rax,%r10
  137. movq 24(%rsi),%rax
  138. adcq %rdx,%r11
  139. mulq %rbp
  140. addq %rax,%r12
  141. movq 32(%rsi),%rax
  142. adcq %rdx,%r13
  143. mulq %rbp
  144. addq %rax,%r14
  145. adcq %rdx,%r15
  146. movq 32(%rsp),%rdi
  147. jmp .Lreduce51
  148. .Lfe51_mul_epilogue:
  149. .cfi_endproc
  150. .size x25519_fe51_mul,.-x25519_fe51_mul
  151. .globl x25519_fe51_sqr
  152. .type x25519_fe51_sqr,@function
  153. .align 32
  154. x25519_fe51_sqr:
  155. .cfi_startproc
  156. pushq %rbp
  157. .cfi_adjust_cfa_offset 8
  158. .cfi_offset %rbp,-16
  159. pushq %rbx
  160. .cfi_adjust_cfa_offset 8
  161. .cfi_offset %rbx,-24
  162. pushq %r12
  163. .cfi_adjust_cfa_offset 8
  164. .cfi_offset %r12,-32
  165. pushq %r13
  166. .cfi_adjust_cfa_offset 8
  167. .cfi_offset %r13,-40
  168. pushq %r14
  169. .cfi_adjust_cfa_offset 8
  170. .cfi_offset %r14,-48
  171. pushq %r15
  172. .cfi_adjust_cfa_offset 8
  173. .cfi_offset %r15,-56
  174. leaq -40(%rsp),%rsp
  175. .cfi_adjust_cfa_offset 40
  176. .Lfe51_sqr_body:
  177. movq 0(%rsi),%rax
  178. movq 16(%rsi),%r15
  179. movq 32(%rsi),%rbp
  180. movq %rdi,32(%rsp)
  181. leaq (%rax,%rax,1),%r14
  182. mulq %rax
  183. movq %rax,%rbx
  184. movq 8(%rsi),%rax
  185. movq %rdx,%rcx
  186. mulq %r14
  187. movq %rax,%r8
  188. movq %r15,%rax
  189. movq %r15,0(%rsp)
  190. movq %rdx,%r9
  191. mulq %r14
  192. movq %rax,%r10
  193. movq 24(%rsi),%rax
  194. movq %rdx,%r11
  195. imulq $19,%rbp,%rdi
  196. mulq %r14
  197. movq %rax,%r12
  198. movq %rbp,%rax
  199. movq %rdx,%r13
  200. mulq %r14
  201. movq %rax,%r14
  202. movq %rbp,%rax
  203. movq %rdx,%r15
  204. mulq %rdi
  205. addq %rax,%r12
  206. movq 8(%rsi),%rax
  207. adcq %rdx,%r13
  208. movq 24(%rsi),%rsi
  209. leaq (%rax,%rax,1),%rbp
  210. mulq %rax
  211. addq %rax,%r10
  212. movq 0(%rsp),%rax
  213. adcq %rdx,%r11
  214. mulq %rbp
  215. addq %rax,%r12
  216. movq %rbp,%rax
  217. adcq %rdx,%r13
  218. mulq %rsi
  219. addq %rax,%r14
  220. movq %rbp,%rax
  221. adcq %rdx,%r15
  222. imulq $19,%rsi,%rbp
  223. mulq %rdi
  224. addq %rax,%rbx
  225. leaq (%rsi,%rsi,1),%rax
  226. adcq %rdx,%rcx
  227. mulq %rdi
  228. addq %rax,%r10
  229. movq %rsi,%rax
  230. adcq %rdx,%r11
  231. mulq %rbp
  232. addq %rax,%r8
  233. movq 0(%rsp),%rax
  234. adcq %rdx,%r9
  235. leaq (%rax,%rax,1),%rsi
  236. mulq %rax
  237. addq %rax,%r14
  238. movq %rbp,%rax
  239. adcq %rdx,%r15
  240. mulq %rsi
  241. addq %rax,%rbx
  242. movq %rsi,%rax
  243. adcq %rdx,%rcx
  244. mulq %rdi
  245. addq %rax,%r8
  246. adcq %rdx,%r9
  247. movq 32(%rsp),%rdi
  248. jmp .Lreduce51
  249. .align 32
  250. .Lreduce51:
  251. movq $0x7ffffffffffff,%rbp
  252. movq %r10,%rdx
  253. shrq $51,%r10
  254. shlq $13,%r11
  255. andq %rbp,%rdx
  256. orq %r10,%r11
  257. addq %r11,%r12
  258. adcq $0,%r13
  259. movq %rbx,%rax
  260. shrq $51,%rbx
  261. shlq $13,%rcx
  262. andq %rbp,%rax
  263. orq %rbx,%rcx
  264. addq %rcx,%r8
  265. adcq $0,%r9
  266. movq %r12,%rbx
  267. shrq $51,%r12
  268. shlq $13,%r13
  269. andq %rbp,%rbx
  270. orq %r12,%r13
  271. addq %r13,%r14
  272. adcq $0,%r15
  273. movq %r8,%rcx
  274. shrq $51,%r8
  275. shlq $13,%r9
  276. andq %rbp,%rcx
  277. orq %r8,%r9
  278. addq %r9,%rdx
  279. movq %r14,%r10
  280. shrq $51,%r14
  281. shlq $13,%r15
  282. andq %rbp,%r10
  283. orq %r14,%r15
  284. leaq (%r15,%r15,8),%r14
  285. leaq (%r15,%r14,2),%r15
  286. addq %r15,%rax
  287. movq %rdx,%r8
  288. andq %rbp,%rdx
  289. shrq $51,%r8
  290. addq %r8,%rbx
  291. movq %rax,%r9
  292. andq %rbp,%rax
  293. shrq $51,%r9
  294. addq %r9,%rcx
  295. movq %rax,0(%rdi)
  296. movq %rcx,8(%rdi)
  297. movq %rdx,16(%rdi)
  298. movq %rbx,24(%rdi)
  299. movq %r10,32(%rdi)
  300. movq 40(%rsp),%r15
  301. .cfi_restore %r15
  302. movq 48(%rsp),%r14
  303. .cfi_restore %r14
  304. movq 56(%rsp),%r13
  305. .cfi_restore %r13
  306. movq 64(%rsp),%r12
  307. .cfi_restore %r12
  308. movq 72(%rsp),%rbx
  309. .cfi_restore %rbx
  310. movq 80(%rsp),%rbp
  311. .cfi_restore %rbp
  312. leaq 88(%rsp),%rsp
  313. .cfi_adjust_cfa_offset 88
  314. .Lfe51_sqr_epilogue:
  315. .byte 0xf3,0xc3
  316. .cfi_endproc
  317. .size x25519_fe51_sqr,.-x25519_fe51_sqr
  318. .globl x25519_fe51_mul121666
  319. .type x25519_fe51_mul121666,@function
  320. .align 32
  321. x25519_fe51_mul121666:
  322. .cfi_startproc
  323. pushq %rbp
  324. .cfi_adjust_cfa_offset 8
  325. .cfi_offset %rbp,-16
  326. pushq %rbx
  327. .cfi_adjust_cfa_offset 8
  328. .cfi_offset %rbx,-24
  329. pushq %r12
  330. .cfi_adjust_cfa_offset 8
  331. .cfi_offset %r12,-32
  332. pushq %r13
  333. .cfi_adjust_cfa_offset 8
  334. .cfi_offset %r13,-40
  335. pushq %r14
  336. .cfi_adjust_cfa_offset 8
  337. .cfi_offset %r14,-48
  338. pushq %r15
  339. .cfi_adjust_cfa_offset 8
  340. .cfi_offset %r15,-56
  341. leaq -40(%rsp),%rsp
  342. .cfi_adjust_cfa_offset 40
  343. .Lfe51_mul121666_body:
  344. movl $121666,%eax
  345. mulq 0(%rsi)
  346. movq %rax,%rbx
  347. movl $121666,%eax
  348. movq %rdx,%rcx
  349. mulq 8(%rsi)
  350. movq %rax,%r8
  351. movl $121666,%eax
  352. movq %rdx,%r9
  353. mulq 16(%rsi)
  354. movq %rax,%r10
  355. movl $121666,%eax
  356. movq %rdx,%r11
  357. mulq 24(%rsi)
  358. movq %rax,%r12
  359. movl $121666,%eax
  360. movq %rdx,%r13
  361. mulq 32(%rsi)
  362. movq %rax,%r14
  363. movq %rdx,%r15
  364. jmp .Lreduce51
  365. .Lfe51_mul121666_epilogue:
  366. .cfi_endproc
  367. .size x25519_fe51_mul121666,.-x25519_fe51_mul121666
  368. .globl x25519_fe64_eligible
  369. .type x25519_fe64_eligible,@function
  370. .align 32
  371. x25519_fe64_eligible:
  372. .cfi_startproc
  373. movl OPENSSL_ia32cap_P+8(%rip),%ecx
  374. xorl %eax,%eax
  375. andl $0x80100,%ecx
  376. cmpl $0x80100,%ecx
  377. cmovel %ecx,%eax
  378. .byte 0xf3,0xc3
  379. .cfi_endproc
  380. .size x25519_fe64_eligible,.-x25519_fe64_eligible
  381. .globl x25519_fe64_mul
  382. .type x25519_fe64_mul,@function
  383. .align 32
  384. x25519_fe64_mul:
  385. .cfi_startproc
  386. pushq %rbp
  387. .cfi_adjust_cfa_offset 8
  388. .cfi_offset %rbp,-16
  389. pushq %rbx
  390. .cfi_adjust_cfa_offset 8
  391. .cfi_offset %rbx,-24
  392. pushq %r12
  393. .cfi_adjust_cfa_offset 8
  394. .cfi_offset %r12,-32
  395. pushq %r13
  396. .cfi_adjust_cfa_offset 8
  397. .cfi_offset %r13,-40
  398. pushq %r14
  399. .cfi_adjust_cfa_offset 8
  400. .cfi_offset %r14,-48
  401. pushq %r15
  402. .cfi_adjust_cfa_offset 8
  403. .cfi_offset %r15,-56
  404. pushq %rdi
  405. .cfi_adjust_cfa_offset 8
  406. .cfi_offset %rdi,-64
  407. leaq -16(%rsp),%rsp
  408. .cfi_adjust_cfa_offset 16
  409. .Lfe64_mul_body:
  410. movq %rdx,%rax
  411. movq 0(%rdx),%rbp
  412. movq 0(%rsi),%rdx
  413. movq 8(%rax),%rcx
  414. movq 16(%rax),%r14
  415. movq 24(%rax),%r15
  416. mulxq %rbp,%r8,%rax
  417. xorl %edi,%edi
  418. mulxq %rcx,%r9,%rbx
  419. adcxq %rax,%r9
  420. mulxq %r14,%r10,%rax
  421. adcxq %rbx,%r10
  422. mulxq %r15,%r11,%r12
  423. movq 8(%rsi),%rdx
  424. adcxq %rax,%r11
  425. movq %r14,(%rsp)
  426. adcxq %rdi,%r12
  427. mulxq %rbp,%rax,%rbx
  428. adoxq %rax,%r9
  429. adcxq %rbx,%r10
  430. mulxq %rcx,%rax,%rbx
  431. adoxq %rax,%r10
  432. adcxq %rbx,%r11
  433. mulxq %r14,%rax,%rbx
  434. adoxq %rax,%r11
  435. adcxq %rbx,%r12
  436. mulxq %r15,%rax,%r13
  437. movq 16(%rsi),%rdx
  438. adoxq %rax,%r12
  439. adcxq %rdi,%r13
  440. adoxq %rdi,%r13
  441. mulxq %rbp,%rax,%rbx
  442. adcxq %rax,%r10
  443. adoxq %rbx,%r11
  444. mulxq %rcx,%rax,%rbx
  445. adcxq %rax,%r11
  446. adoxq %rbx,%r12
  447. mulxq %r14,%rax,%rbx
  448. adcxq %rax,%r12
  449. adoxq %rbx,%r13
  450. mulxq %r15,%rax,%r14
  451. movq 24(%rsi),%rdx
  452. adcxq %rax,%r13
  453. adoxq %rdi,%r14
  454. adcxq %rdi,%r14
  455. mulxq %rbp,%rax,%rbx
  456. adoxq %rax,%r11
  457. adcxq %rbx,%r12
  458. mulxq %rcx,%rax,%rbx
  459. adoxq %rax,%r12
  460. adcxq %rbx,%r13
  461. mulxq (%rsp),%rax,%rbx
  462. adoxq %rax,%r13
  463. adcxq %rbx,%r14
  464. mulxq %r15,%rax,%r15
  465. movl $38,%edx
  466. adoxq %rax,%r14
  467. adcxq %rdi,%r15
  468. adoxq %rdi,%r15
  469. jmp .Lreduce64
  470. .Lfe64_mul_epilogue:
  471. .cfi_endproc
  472. .size x25519_fe64_mul,.-x25519_fe64_mul
  473. .globl x25519_fe64_sqr
  474. .type x25519_fe64_sqr,@function
  475. .align 32
  476. x25519_fe64_sqr:
  477. .cfi_startproc
  478. pushq %rbp
  479. .cfi_adjust_cfa_offset 8
  480. .cfi_offset %rbp,-16
  481. pushq %rbx
  482. .cfi_adjust_cfa_offset 8
  483. .cfi_offset %rbx,-24
  484. pushq %r12
  485. .cfi_adjust_cfa_offset 8
  486. .cfi_offset %r12,-32
  487. pushq %r13
  488. .cfi_adjust_cfa_offset 8
  489. .cfi_offset %r13,-40
  490. pushq %r14
  491. .cfi_adjust_cfa_offset 8
  492. .cfi_offset %r14,-48
  493. pushq %r15
  494. .cfi_adjust_cfa_offset 8
  495. .cfi_offset %r15,-56
  496. pushq %rdi
  497. .cfi_adjust_cfa_offset 8
  498. .cfi_offset %rdi,-64
  499. leaq -16(%rsp),%rsp
  500. .cfi_adjust_cfa_offset 16
  501. .Lfe64_sqr_body:
  502. movq 0(%rsi),%rdx
  503. movq 8(%rsi),%rcx
  504. movq 16(%rsi),%rbp
  505. movq 24(%rsi),%rsi
  506. mulxq %rdx,%r8,%r15
  507. mulxq %rcx,%r9,%rax
  508. xorl %edi,%edi
  509. mulxq %rbp,%r10,%rbx
  510. adcxq %rax,%r10
  511. mulxq %rsi,%r11,%r12
  512. movq %rcx,%rdx
  513. adcxq %rbx,%r11
  514. adcxq %rdi,%r12
  515. mulxq %rbp,%rax,%rbx
  516. adoxq %rax,%r11
  517. adcxq %rbx,%r12
  518. mulxq %rsi,%rax,%r13
  519. movq %rbp,%rdx
  520. adoxq %rax,%r12
  521. adcxq %rdi,%r13
  522. mulxq %rsi,%rax,%r14
  523. movq %rcx,%rdx
  524. adoxq %rax,%r13
  525. adcxq %rdi,%r14
  526. adoxq %rdi,%r14
  527. adcxq %r9,%r9
  528. adoxq %r15,%r9
  529. adcxq %r10,%r10
  530. mulxq %rdx,%rax,%rbx
  531. movq %rbp,%rdx
  532. adcxq %r11,%r11
  533. adoxq %rax,%r10
  534. adcxq %r12,%r12
  535. adoxq %rbx,%r11
  536. mulxq %rdx,%rax,%rbx
  537. movq %rsi,%rdx
  538. adcxq %r13,%r13
  539. adoxq %rax,%r12
  540. adcxq %r14,%r14
  541. adoxq %rbx,%r13
  542. mulxq %rdx,%rax,%r15
  543. movl $38,%edx
  544. adoxq %rax,%r14
  545. adcxq %rdi,%r15
  546. adoxq %rdi,%r15
  547. jmp .Lreduce64
  548. .align 32
  549. .Lreduce64:
  550. mulxq %r12,%rax,%rbx
  551. adcxq %rax,%r8
  552. adoxq %rbx,%r9
  553. mulxq %r13,%rax,%rbx
  554. adcxq %rax,%r9
  555. adoxq %rbx,%r10
  556. mulxq %r14,%rax,%rbx
  557. adcxq %rax,%r10
  558. adoxq %rbx,%r11
  559. mulxq %r15,%rax,%r12
  560. adcxq %rax,%r11
  561. adoxq %rdi,%r12
  562. adcxq %rdi,%r12
  563. movq 16(%rsp),%rdi
  564. imulq %rdx,%r12
  565. addq %r12,%r8
  566. adcq $0,%r9
  567. adcq $0,%r10
  568. adcq $0,%r11
  569. sbbq %rax,%rax
  570. andq $38,%rax
  571. addq %rax,%r8
  572. movq %r9,8(%rdi)
  573. movq %r10,16(%rdi)
  574. movq %r11,24(%rdi)
  575. movq %r8,0(%rdi)
  576. movq 24(%rsp),%r15
  577. .cfi_restore %r15
  578. movq 32(%rsp),%r14
  579. .cfi_restore %r14
  580. movq 40(%rsp),%r13
  581. .cfi_restore %r13
  582. movq 48(%rsp),%r12
  583. .cfi_restore %r12
  584. movq 56(%rsp),%rbx
  585. .cfi_restore %rbx
  586. movq 64(%rsp),%rbp
  587. .cfi_restore %rbp
  588. leaq 72(%rsp),%rsp
  589. .cfi_adjust_cfa_offset 88
  590. .Lfe64_sqr_epilogue:
  591. .byte 0xf3,0xc3
  592. .cfi_endproc
  593. .size x25519_fe64_sqr,.-x25519_fe64_sqr
  594. .globl x25519_fe64_mul121666
  595. .type x25519_fe64_mul121666,@function
  596. .align 32
  597. x25519_fe64_mul121666:
  598. .Lfe64_mul121666_body:
  599. .cfi_startproc
  600. movl $121666,%edx
  601. mulxq 0(%rsi),%r8,%rcx
  602. mulxq 8(%rsi),%r9,%rax
  603. addq %rcx,%r9
  604. mulxq 16(%rsi),%r10,%rcx
  605. adcq %rax,%r10
  606. mulxq 24(%rsi),%r11,%rax
  607. adcq %rcx,%r11
  608. adcq $0,%rax
  609. imulq $38,%rax,%rax
  610. addq %rax,%r8
  611. adcq $0,%r9
  612. adcq $0,%r10
  613. adcq $0,%r11
  614. sbbq %rax,%rax
  615. andq $38,%rax
  616. addq %rax,%r8
  617. movq %r9,8(%rdi)
  618. movq %r10,16(%rdi)
  619. movq %r11,24(%rdi)
  620. movq %r8,0(%rdi)
  621. .Lfe64_mul121666_epilogue:
  622. .byte 0xf3,0xc3
  623. .cfi_endproc
  624. .size x25519_fe64_mul121666,.-x25519_fe64_mul121666
  625. .globl x25519_fe64_add
  626. .type x25519_fe64_add,@function
  627. .align 32
  628. x25519_fe64_add:
  629. .Lfe64_add_body:
  630. .cfi_startproc
  631. movq 0(%rsi),%r8
  632. movq 8(%rsi),%r9
  633. movq 16(%rsi),%r10
  634. movq 24(%rsi),%r11
  635. addq 0(%rdx),%r8
  636. adcq 8(%rdx),%r9
  637. adcq 16(%rdx),%r10
  638. adcq 24(%rdx),%r11
  639. sbbq %rax,%rax
  640. andq $38,%rax
  641. addq %rax,%r8
  642. adcq $0,%r9
  643. adcq $0,%r10
  644. movq %r9,8(%rdi)
  645. adcq $0,%r11
  646. movq %r10,16(%rdi)
  647. sbbq %rax,%rax
  648. movq %r11,24(%rdi)
  649. andq $38,%rax
  650. addq %rax,%r8
  651. movq %r8,0(%rdi)
  652. .Lfe64_add_epilogue:
  653. .byte 0xf3,0xc3
  654. .cfi_endproc
  655. .size x25519_fe64_add,.-x25519_fe64_add
  656. .globl x25519_fe64_sub
  657. .type x25519_fe64_sub,@function
  658. .align 32
  659. x25519_fe64_sub:
  660. .Lfe64_sub_body:
  661. .cfi_startproc
  662. movq 0(%rsi),%r8
  663. movq 8(%rsi),%r9
  664. movq 16(%rsi),%r10
  665. movq 24(%rsi),%r11
  666. subq 0(%rdx),%r8
  667. sbbq 8(%rdx),%r9
  668. sbbq 16(%rdx),%r10
  669. sbbq 24(%rdx),%r11
  670. sbbq %rax,%rax
  671. andq $38,%rax
  672. subq %rax,%r8
  673. sbbq $0,%r9
  674. sbbq $0,%r10
  675. movq %r9,8(%rdi)
  676. sbbq $0,%r11
  677. movq %r10,16(%rdi)
  678. sbbq %rax,%rax
  679. movq %r11,24(%rdi)
  680. andq $38,%rax
  681. subq %rax,%r8
  682. movq %r8,0(%rdi)
  683. .Lfe64_sub_epilogue:
  684. .byte 0xf3,0xc3
  685. .cfi_endproc
  686. .size x25519_fe64_sub,.-x25519_fe64_sub
  687. .globl x25519_fe64_tobytes
  688. .type x25519_fe64_tobytes,@function
  689. .align 32
  690. x25519_fe64_tobytes:
  691. .Lfe64_to_body:
  692. .cfi_startproc
  693. movq 0(%rsi),%r8
  694. movq 8(%rsi),%r9
  695. movq 16(%rsi),%r10
  696. movq 24(%rsi),%r11
  697. leaq (%r11,%r11,1),%rax
  698. sarq $63,%r11
  699. shrq $1,%rax
  700. andq $19,%r11
  701. addq $19,%r11
  702. addq %r11,%r8
  703. adcq $0,%r9
  704. adcq $0,%r10
  705. adcq $0,%rax
  706. leaq (%rax,%rax,1),%r11
  707. sarq $63,%rax
  708. shrq $1,%r11
  709. notq %rax
  710. andq $19,%rax
  711. subq %rax,%r8
  712. sbbq $0,%r9
  713. sbbq $0,%r10
  714. sbbq $0,%r11
  715. movq %r8,0(%rdi)
  716. movq %r9,8(%rdi)
  717. movq %r10,16(%rdi)
  718. movq %r11,24(%rdi)
  719. .Lfe64_to_epilogue:
  720. .byte 0xf3,0xc3
  721. .cfi_endproc
  722. .size x25519_fe64_tobytes,.-x25519_fe64_tobytes
  723. .byte 88,50,53,53,49,57,32,112,114,105,109,105,116,105,118,101,115,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0