md5-aarch64.pl 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. #! /usr/bin/env perl
  2. # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. # MD5 optimized for aarch64.
  9. use strict;
  10. my $code;
  11. #no warnings qw(uninitialized);
  12. # $output is the last argument if it looks like a file (it has an extension)
  13. # $flavour is the first argument if it doesn't look like a file
  14. my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
  15. my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
  16. $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate;
  17. ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
  18. ( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
  19. die "can't locate arm-xlate.pl";
  20. open OUT,"| \"$^X\" $xlate $flavour \"$output\""
  21. or die "can't call $xlate: $1";
  22. *STDOUT=*OUT;
  23. $code .= <<EOF;
  24. .text
  25. .globl ossl_md5_block_asm_data_order
  26. .type ossl_md5_block_asm_data_order,\@function
  27. ossl_md5_block_asm_data_order:
  28. // Save all callee-saved registers
  29. stp x19,x20,[sp,#-80]!
  30. stp x21,x22,[sp,#16]
  31. stp x23,x24,[sp,#32]
  32. stp x25,x26,[sp,#48]
  33. stp x27,x28,[sp,#64]
  34. ldp w10, w11, [x0, #0] // Load MD5 state->A and state->B
  35. ldp w12, w13, [x0, #8] // Load MD5 state->C and state->D
  36. .align 5
  37. ossl_md5_blocks_loop:
  38. eor x17, x12, x13 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  39. and x16, x17, x11 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  40. ldp w15, w20, [x1] // Load 2 words of input data0 M[0],M[1]
  41. ldp w3, w21, [x1, #8] // Load 2 words of input data0 M[2],M[3]
  42. #ifdef __AARCH64EB__
  43. rev w15, w15
  44. rev w20, w20
  45. rev w3, w3
  46. rev w21, w21
  47. #endif
  48. eor x14, x16, x13 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  49. movz x9, #0xa478 // Load lower half of constant 0xd76aa478
  50. movk x9, #0xd76a, lsl #16 // Load upper half of constant 0xd76aa478
  51. add w8, w10, w15 // Add dest value
  52. add w7, w8, w9 // Add constant 0xd76aa478
  53. add w6, w7, w14 // Add aux function result
  54. ror w6, w6, #25 // Rotate left s=7 bits
  55. eor x5, x11, x12 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  56. add w4, w11, w6 // Add X parameter round 1 A=FF(A, B, C, D, 0xd76aa478, s=7, M[0])
  57. and x8, x5, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  58. eor x17, x8, x12 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  59. movz x16, #0xb756 // Load lower half of constant 0xe8c7b756
  60. movk x16, #0xe8c7, lsl #16 // Load upper half of constant 0xe8c7b756
  61. add w9, w13, w20 // Add dest value
  62. add w7, w9, w16 // Add constant 0xe8c7b756
  63. add w14, w7, w17 // Add aux function result
  64. ror w14, w14, #20 // Rotate left s=12 bits
  65. eor x6, x4, x11 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  66. add w5, w4, w14 // Add X parameter round 1 D=FF(D, A, B, C, 0xe8c7b756, s=12, M[1])
  67. and x8, x6, x5 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  68. eor x9, x8, x11 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  69. movz x16, #0x70db // Load lower half of constant 0x242070db
  70. movk x16, #0x2420, lsl #16 // Load upper half of constant 0x242070db
  71. add w7, w12, w3 // Add dest value
  72. add w17, w7, w16 // Add constant 0x242070db
  73. add w14, w17, w9 // Add aux function result
  74. ror w14, w14, #15 // Rotate left s=17 bits
  75. eor x6, x5, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  76. add w8, w5, w14 // Add X parameter round 1 C=FF(C, D, A, B, 0x242070db, s=17, M[2])
  77. and x7, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  78. eor x16, x7, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  79. movz x9, #0xceee // Load lower half of constant 0xc1bdceee
  80. movk x9, #0xc1bd, lsl #16 // Load upper half of constant 0xc1bdceee
  81. add w14, w11, w21 // Add dest value
  82. add w6, w14, w9 // Add constant 0xc1bdceee
  83. add w7, w6, w16 // Add aux function result
  84. ror w7, w7, #10 // Rotate left s=22 bits
  85. eor x17, x8, x5 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  86. add w9, w8, w7 // Add X parameter round 1 B=FF(B, C, D, A, 0xc1bdceee, s=22, M[3])
  87. ldp w14, w22, [x1, #16] // Load 2 words of input data0 M[4],M[5]
  88. ldp w7, w23, [x1, #24] // Load 2 words of input data0 M[6],M[7]
  89. #ifdef __AARCH64EB__
  90. rev w14, w14
  91. rev w22, w22
  92. rev w7, w7
  93. rev w23, w23
  94. #endif
  95. and x16, x17, x9 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  96. eor x6, x16, x5 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  97. movz x16, #0xfaf // Load lower half of constant 0xf57c0faf
  98. movk x16, #0xf57c, lsl #16 // Load upper half of constant 0xf57c0faf
  99. add w17, w4, w14 // Add dest value
  100. add w16, w17, w16 // Add constant 0xf57c0faf
  101. add w4, w16, w6 // Add aux function result
  102. ror w4, w4, #25 // Rotate left s=7 bits
  103. eor x16, x9, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  104. add w17, w9, w4 // Add X parameter round 1 A=FF(A, B, C, D, 0xf57c0faf, s=7, M[4])
  105. and x16, x16, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  106. eor x6, x16, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  107. movz x4, #0xc62a // Load lower half of constant 0x4787c62a
  108. movk x4, #0x4787, lsl #16 // Load upper half of constant 0x4787c62a
  109. add w16, w5, w22 // Add dest value
  110. add w16, w16, w4 // Add constant 0x4787c62a
  111. add w5, w16, w6 // Add aux function result
  112. ror w5, w5, #20 // Rotate left s=12 bits
  113. eor x4, x17, x9 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  114. add w19, w17, w5 // Add X parameter round 1 D=FF(D, A, B, C, 0x4787c62a, s=12, M[5])
  115. and x6, x4, x19 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  116. eor x5, x6, x9 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  117. movz x4, #0x4613 // Load lower half of constant 0xa8304613
  118. movk x4, #0xa830, lsl #16 // Load upper half of constant 0xa8304613
  119. add w6, w8, w7 // Add dest value
  120. add w8, w6, w4 // Add constant 0xa8304613
  121. add w4, w8, w5 // Add aux function result
  122. ror w4, w4, #15 // Rotate left s=17 bits
  123. eor x6, x19, x17 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  124. add w8, w19, w4 // Add X parameter round 1 C=FF(C, D, A, B, 0xa8304613, s=17, M[6])
  125. and x5, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  126. eor x4, x5, x17 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  127. movz x6, #0x9501 // Load lower half of constant 0xfd469501
  128. movk x6, #0xfd46, lsl #16 // Load upper half of constant 0xfd469501
  129. add w9, w9, w23 // Add dest value
  130. add w5, w9, w6 // Add constant 0xfd469501
  131. add w9, w5, w4 // Add aux function result
  132. ror w9, w9, #10 // Rotate left s=22 bits
  133. eor x6, x8, x19 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  134. add w4, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0xfd469501, s=22, M[7])
  135. ldp w5, w24, [x1, #32] // Load 2 words of input data0 M[8],M[9]
  136. ldp w16, w25, [x1, #40] // Load 2 words of input data0 M[10],M[11]
  137. #ifdef __AARCH64EB__
  138. rev w5, w5
  139. rev w24, w24
  140. rev w16, w16
  141. rev w25, w25
  142. #endif
  143. and x9, x6, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  144. eor x6, x9, x19 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  145. movz x9, #0x98d8 // Load lower half of constant 0x698098d8
  146. movk x9, #0x6980, lsl #16 // Load upper half of constant 0x698098d8
  147. add w17, w17, w5 // Add dest value
  148. add w9, w17, w9 // Add constant 0x698098d8
  149. add w17, w9, w6 // Add aux function result
  150. ror w17, w17, #25 // Rotate left s=7 bits
  151. eor x9, x4, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  152. add w6, w4, w17 // Add X parameter round 1 A=FF(A, B, C, D, 0x698098d8, s=7, M[8])
  153. and x17, x9, x6 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  154. eor x9, x17, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  155. movz x17, #0xf7af // Load lower half of constant 0x8b44f7af
  156. movk x17, #0x8b44, lsl #16 // Load upper half of constant 0x8b44f7af
  157. add w19, w19, w24 // Add dest value
  158. add w17, w19, w17 // Add constant 0x8b44f7af
  159. add w19, w17, w9 // Add aux function result
  160. ror w19, w19, #20 // Rotate left s=12 bits
  161. eor x9, x6, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  162. add w17, w6, w19 // Add X parameter round 1 D=FF(D, A, B, C, 0x8b44f7af, s=12, M[9])
  163. and x9, x9, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  164. eor x9, x9, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  165. movz x11, #0x5bb1 // Load lower half of constant 0xffff5bb1
  166. movk x11, #0xffff, lsl #16 // Load upper half of constant 0xffff5bb1
  167. add w8, w8, w16 // Add dest value
  168. add w8, w8, w11 // Add constant 0xffff5bb1
  169. add w8, w8, w9 // Add aux function result
  170. ror w8, w8, #15 // Rotate left s=17 bits
  171. eor x9, x17, x6 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  172. add w8, w17, w8 // Add X parameter round 1 C=FF(C, D, A, B, 0xffff5bb1, s=17, M[10])
  173. and x9, x9, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  174. eor x9, x9, x6 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  175. movz x11, #0xd7be // Load lower half of constant 0x895cd7be
  176. movk x11, #0x895c, lsl #16 // Load upper half of constant 0x895cd7be
  177. add w4, w4, w25 // Add dest value
  178. add w4, w4, w11 // Add constant 0x895cd7be
  179. add w9, w4, w9 // Add aux function result
  180. ror w9, w9, #10 // Rotate left s=22 bits
  181. eor x4, x8, x17 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  182. add w9, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0x895cd7be, s=22, M[11])
  183. ldp w11, w26, [x1, #48] // Load 2 words of input data0 M[12],M[13]
  184. ldp w12, w27, [x1, #56] // Load 2 words of input data0 M[14],M[15]
  185. #ifdef __AARCH64EB__
  186. rev w11, w11
  187. rev w26, w26
  188. rev w12, w12
  189. rev w27, w27
  190. #endif
  191. and x4, x4, x9 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  192. eor x4, x4, x17 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  193. movz x19, #0x1122 // Load lower half of constant 0x6b901122
  194. movk x19, #0x6b90, lsl #16 // Load upper half of constant 0x6b901122
  195. add w6, w6, w11 // Add dest value
  196. add w6, w6, w19 // Add constant 0x6b901122
  197. add w4, w6, w4 // Add aux function result
  198. ror w4, w4, #25 // Rotate left s=7 bits
  199. eor x6, x9, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  200. add w4, w9, w4 // Add X parameter round 1 A=FF(A, B, C, D, 0x6b901122, s=7, M[12])
  201. and x6, x6, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  202. eor x6, x6, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  203. movz x19, #0x7193 // Load lower half of constant 0xfd987193
  204. movk x19, #0xfd98, lsl #16 // Load upper half of constant 0xfd987193
  205. add w17, w17, w26 // Add dest value
  206. add w17, w17, w19 // Add constant 0xfd987193
  207. add w17, w17, w6 // Add aux function result
  208. ror w17, w17, #20 // Rotate left s=12 bits
  209. eor x6, x4, x9 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  210. add w17, w4, w17 // Add X parameter round 1 D=FF(D, A, B, C, 0xfd987193, s=12, M[13])
  211. and x6, x6, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  212. eor x6, x6, x9 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  213. movz x13, #0x438e // Load lower half of constant 0xa679438e
  214. movk x13, #0xa679, lsl #16 // Load upper half of constant 0xa679438e
  215. add w8, w8, w12 // Add dest value
  216. add w8, w8, w13 // Add constant 0xa679438e
  217. add w8, w8, w6 // Add aux function result
  218. ror w8, w8, #15 // Rotate left s=17 bits
  219. eor x6, x17, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  220. add w8, w17, w8 // Add X parameter round 1 C=FF(C, D, A, B, 0xa679438e, s=17, M[14])
  221. and x6, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  222. eor x6, x6, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)
  223. movz x13, #0x821 // Load lower half of constant 0x49b40821
  224. movk x13, #0x49b4, lsl #16 // Load upper half of constant 0x49b40821
  225. add w9, w9, w27 // Add dest value
  226. add w9, w9, w13 // Add constant 0x49b40821
  227. add w9, w9, w6 // Add aux function result
  228. ror w9, w9, #10 // Rotate left s=22 bits
  229. bic x6, x8, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  230. add w9, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0x49b40821, s=22, M[15])
  231. and x13, x9, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  232. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  233. movz x13, #0x2562 // Load lower half of constant 0xf61e2562
  234. movk x13, #0xf61e, lsl #16 // Load upper half of constant 0xf61e2562
  235. add w4, w4, w20 // Add dest value
  236. add w4, w4, w13 // Add constant 0xf61e2562
  237. add w4, w4, w6 // Add aux function result
  238. ror w4, w4, #27 // Rotate left s=5 bits
  239. bic x6, x9, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  240. add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xf61e2562, s=5, M[1])
  241. and x13, x4, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  242. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  243. movz x13, #0xb340 // Load lower half of constant 0xc040b340
  244. movk x13, #0xc040, lsl #16 // Load upper half of constant 0xc040b340
  245. add w17, w17, w7 // Add dest value
  246. add w17, w17, w13 // Add constant 0xc040b340
  247. add w17, w17, w6 // Add aux function result
  248. ror w17, w17, #23 // Rotate left s=9 bits
  249. bic x6, x4, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  250. add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xc040b340, s=9, M[6])
  251. and x13, x17, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  252. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  253. movz x13, #0x5a51 // Load lower half of constant 0x265e5a51
  254. movk x13, #0x265e, lsl #16 // Load upper half of constant 0x265e5a51
  255. add w8, w8, w25 // Add dest value
  256. add w8, w8, w13 // Add constant 0x265e5a51
  257. add w8, w8, w6 // Add aux function result
  258. ror w8, w8, #18 // Rotate left s=14 bits
  259. bic x6, x17, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  260. add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0x265e5a51, s=14, M[11])
  261. and x13, x8, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  262. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  263. movz x13, #0xc7aa // Load lower half of constant 0xe9b6c7aa
  264. movk x13, #0xe9b6, lsl #16 // Load upper half of constant 0xe9b6c7aa
  265. add w9, w9, w15 // Add dest value
  266. add w9, w9, w13 // Add constant 0xe9b6c7aa
  267. add w9, w9, w6 // Add aux function result
  268. ror w9, w9, #12 // Rotate left s=20 bits
  269. bic x6, x8, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  270. add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0xe9b6c7aa, s=20, M[0])
  271. and x13, x9, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  272. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  273. movz x13, #0x105d // Load lower half of constant 0xd62f105d
  274. movk x13, #0xd62f, lsl #16 // Load upper half of constant 0xd62f105d
  275. add w4, w4, w22 // Add dest value
  276. add w4, w4, w13 // Add constant 0xd62f105d
  277. add w4, w4, w6 // Add aux function result
  278. ror w4, w4, #27 // Rotate left s=5 bits
  279. bic x6, x9, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  280. add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xd62f105d, s=5, M[5])
  281. and x13, x4, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  282. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  283. movz x13, #0x1453 // Load lower half of constant 0x2441453
  284. movk x13, #0x244, lsl #16 // Load upper half of constant 0x2441453
  285. add w17, w17, w16 // Add dest value
  286. add w17, w17, w13 // Add constant 0x2441453
  287. add w17, w17, w6 // Add aux function result
  288. ror w17, w17, #23 // Rotate left s=9 bits
  289. bic x6, x4, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  290. add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0x2441453, s=9, M[10])
  291. and x13, x17, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  292. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  293. movz x13, #0xe681 // Load lower half of constant 0xd8a1e681
  294. movk x13, #0xd8a1, lsl #16 // Load upper half of constant 0xd8a1e681
  295. add w8, w8, w27 // Add dest value
  296. add w8, w8, w13 // Add constant 0xd8a1e681
  297. add w8, w8, w6 // Add aux function result
  298. ror w8, w8, #18 // Rotate left s=14 bits
  299. bic x6, x17, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  300. add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0xd8a1e681, s=14, M[15])
  301. and x13, x8, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  302. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  303. movz x13, #0xfbc8 // Load lower half of constant 0xe7d3fbc8
  304. movk x13, #0xe7d3, lsl #16 // Load upper half of constant 0xe7d3fbc8
  305. add w9, w9, w14 // Add dest value
  306. add w9, w9, w13 // Add constant 0xe7d3fbc8
  307. add w9, w9, w6 // Add aux function result
  308. ror w9, w9, #12 // Rotate left s=20 bits
  309. bic x6, x8, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  310. add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0xe7d3fbc8, s=20, M[4])
  311. and x13, x9, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  312. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  313. movz x13, #0xcde6 // Load lower half of constant 0x21e1cde6
  314. movk x13, #0x21e1, lsl #16 // Load upper half of constant 0x21e1cde6
  315. add w4, w4, w24 // Add dest value
  316. add w4, w4, w13 // Add constant 0x21e1cde6
  317. add w4, w4, w6 // Add aux function result
  318. ror w4, w4, #27 // Rotate left s=5 bits
  319. bic x6, x9, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  320. add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0x21e1cde6, s=5, M[9])
  321. and x13, x4, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  322. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  323. movz x13, #0x7d6 // Load lower half of constant 0xc33707d6
  324. movk x13, #0xc337, lsl #16 // Load upper half of constant 0xc33707d6
  325. add w17, w17, w12 // Add dest value
  326. add w17, w17, w13 // Add constant 0xc33707d6
  327. add w17, w17, w6 // Add aux function result
  328. ror w17, w17, #23 // Rotate left s=9 bits
  329. bic x6, x4, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  330. add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xc33707d6, s=9, M[14])
  331. and x13, x17, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  332. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  333. movz x13, #0xd87 // Load lower half of constant 0xf4d50d87
  334. movk x13, #0xf4d5, lsl #16 // Load upper half of constant 0xf4d50d87
  335. add w8, w8, w21 // Add dest value
  336. add w8, w8, w13 // Add constant 0xf4d50d87
  337. add w8, w8, w6 // Add aux function result
  338. ror w8, w8, #18 // Rotate left s=14 bits
  339. bic x6, x17, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  340. add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0xf4d50d87, s=14, M[3])
  341. and x13, x8, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  342. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  343. movz x13, #0x14ed // Load lower half of constant 0x455a14ed
  344. movk x13, #0x455a, lsl #16 // Load upper half of constant 0x455a14ed
  345. add w9, w9, w5 // Add dest value
  346. add w9, w9, w13 // Add constant 0x455a14ed
  347. add w9, w9, w6 // Add aux function result
  348. ror w9, w9, #12 // Rotate left s=20 bits
  349. bic x6, x8, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  350. add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0x455a14ed, s=20, M[8])
  351. and x13, x9, x17 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  352. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  353. movz x13, #0xe905 // Load lower half of constant 0xa9e3e905
  354. movk x13, #0xa9e3, lsl #16 // Load upper half of constant 0xa9e3e905
  355. add w4, w4, w26 // Add dest value
  356. add w4, w4, w13 // Add constant 0xa9e3e905
  357. add w4, w4, w6 // Add aux function result
  358. ror w4, w4, #27 // Rotate left s=5 bits
  359. bic x6, x9, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  360. add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xa9e3e905, s=5, M[13])
  361. and x13, x4, x8 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  362. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  363. movz x13, #0xa3f8 // Load lower half of constant 0xfcefa3f8
  364. movk x13, #0xfcef, lsl #16 // Load upper half of constant 0xfcefa3f8
  365. add w17, w17, w3 // Add dest value
  366. add w17, w17, w13 // Add constant 0xfcefa3f8
  367. add w17, w17, w6 // Add aux function result
  368. ror w17, w17, #23 // Rotate left s=9 bits
  369. bic x6, x4, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  370. add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xfcefa3f8, s=9, M[2])
  371. and x13, x17, x9 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  372. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  373. movz x13, #0x2d9 // Load lower half of constant 0x676f02d9
  374. movk x13, #0x676f, lsl #16 // Load upper half of constant 0x676f02d9
  375. add w8, w8, w23 // Add dest value
  376. add w8, w8, w13 // Add constant 0x676f02d9
  377. add w8, w8, w6 // Add aux function result
  378. ror w8, w8, #18 // Rotate left s=14 bits
  379. bic x6, x17, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  380. add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0x676f02d9, s=14, M[7])
  381. and x13, x8, x4 // Aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  382. orr x6, x6, x13 // End aux function round 2 G(x,y,z)=((x&z)|(~z&y))
  383. movz x13, #0x4c8a // Load lower half of constant 0x8d2a4c8a
  384. movk x13, #0x8d2a, lsl #16 // Load upper half of constant 0x8d2a4c8a
  385. add w9, w9, w11 // Add dest value
  386. add w9, w9, w13 // Add constant 0x8d2a4c8a
  387. add w9, w9, w6 // Add aux function result
  388. eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  389. ror w9, w9, #12 // Rotate left s=20 bits
  390. movz x10, #0x3942 // Load lower half of constant 0xfffa3942
  391. add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0x8d2a4c8a, s=20, M[12])
  392. movk x10, #0xfffa, lsl #16 // Load upper half of constant 0xfffa3942
  393. add w4, w4, w22 // Add dest value
  394. eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)
  395. add w4, w4, w10 // Add constant 0xfffa3942
  396. add w4, w4, w6 // Add aux function result
  397. ror w4, w4, #28 // Rotate left s=4 bits
  398. eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  399. movz x10, #0xf681 // Load lower half of constant 0x8771f681
  400. add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xfffa3942, s=4, M[5])
  401. movk x10, #0x8771, lsl #16 // Load upper half of constant 0x8771f681
  402. add w17, w17, w5 // Add dest value
  403. eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)
  404. add w17, w17, w10 // Add constant 0x8771f681
  405. add w17, w17, w6 // Add aux function result
  406. eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  407. ror w17, w17, #21 // Rotate left s=11 bits
  408. movz x13, #0x6122 // Load lower half of constant 0x6d9d6122
  409. add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0x8771f681, s=11, M[8])
  410. movk x13, #0x6d9d, lsl #16 // Load upper half of constant 0x6d9d6122
  411. add w8, w8, w25 // Add dest value
  412. eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)
  413. add w8, w8, w13 // Add constant 0x6d9d6122
  414. add w8, w8, w6 // Add aux function result
  415. ror w8, w8, #16 // Rotate left s=16 bits
  416. eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  417. movz x13, #0x380c // Load lower half of constant 0xfde5380c
  418. add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0x6d9d6122, s=16, M[11])
  419. movk x13, #0xfde5, lsl #16 // Load upper half of constant 0xfde5380c
  420. add w9, w9, w12 // Add dest value
  421. eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)
  422. add w9, w9, w13 // Add constant 0xfde5380c
  423. add w9, w9, w6 // Add aux function result
  424. eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  425. ror w9, w9, #9 // Rotate left s=23 bits
  426. movz x10, #0xea44 // Load lower half of constant 0xa4beea44
  427. add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xfde5380c, s=23, M[14])
  428. movk x10, #0xa4be, lsl #16 // Load upper half of constant 0xa4beea44
  429. add w4, w4, w20 // Add dest value
  430. eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)
  431. add w4, w4, w10 // Add constant 0xa4beea44
  432. add w4, w4, w6 // Add aux function result
  433. ror w4, w4, #28 // Rotate left s=4 bits
  434. eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  435. movz x10, #0xcfa9 // Load lower half of constant 0x4bdecfa9
  436. add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xa4beea44, s=4, M[1])
  437. movk x10, #0x4bde, lsl #16 // Load upper half of constant 0x4bdecfa9
  438. add w17, w17, w14 // Add dest value
  439. eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)
  440. add w17, w17, w10 // Add constant 0x4bdecfa9
  441. add w17, w17, w6 // Add aux function result
  442. eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  443. ror w17, w17, #21 // Rotate left s=11 bits
  444. movz x13, #0x4b60 // Load lower half of constant 0xf6bb4b60
  445. add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0x4bdecfa9, s=11, M[4])
  446. movk x13, #0xf6bb, lsl #16 // Load upper half of constant 0xf6bb4b60
  447. add w8, w8, w23 // Add dest value
  448. eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)
  449. add w8, w8, w13 // Add constant 0xf6bb4b60
  450. add w8, w8, w6 // Add aux function result
  451. ror w8, w8, #16 // Rotate left s=16 bits
  452. eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  453. movz x13, #0xbc70 // Load lower half of constant 0xbebfbc70
  454. add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0xf6bb4b60, s=16, M[7])
  455. movk x13, #0xbebf, lsl #16 // Load upper half of constant 0xbebfbc70
  456. add w9, w9, w16 // Add dest value
  457. eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)
  458. add w9, w9, w13 // Add constant 0xbebfbc70
  459. add w9, w9, w6 // Add aux function result
  460. eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  461. ror w9, w9, #9 // Rotate left s=23 bits
  462. movz x10, #0x7ec6 // Load lower half of constant 0x289b7ec6
  463. add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xbebfbc70, s=23, M[10])
  464. movk x10, #0x289b, lsl #16 // Load upper half of constant 0x289b7ec6
  465. add w4, w4, w26 // Add dest value
  466. eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)
  467. add w4, w4, w10 // Add constant 0x289b7ec6
  468. add w4, w4, w6 // Add aux function result
  469. ror w4, w4, #28 // Rotate left s=4 bits
  470. eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  471. movz x10, #0x27fa // Load lower half of constant 0xeaa127fa
  472. add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0x289b7ec6, s=4, M[13])
  473. movk x10, #0xeaa1, lsl #16 // Load upper half of constant 0xeaa127fa
  474. add w17, w17, w15 // Add dest value
  475. eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)
  476. add w17, w17, w10 // Add constant 0xeaa127fa
  477. add w17, w17, w6 // Add aux function result
  478. eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  479. ror w17, w17, #21 // Rotate left s=11 bits
  480. movz x13, #0x3085 // Load lower half of constant 0xd4ef3085
  481. add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0xeaa127fa, s=11, M[0])
  482. movk x13, #0xd4ef, lsl #16 // Load upper half of constant 0xd4ef3085
  483. add w8, w8, w21 // Add dest value
  484. eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)
  485. add w8, w8, w13 // Add constant 0xd4ef3085
  486. add w8, w8, w6 // Add aux function result
  487. ror w8, w8, #16 // Rotate left s=16 bits
  488. eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  489. movz x13, #0x1d05 // Load lower half of constant 0x4881d05
  490. add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0xd4ef3085, s=16, M[3])
  491. movk x13, #0x488, lsl #16 // Load upper half of constant 0x4881d05
  492. add w9, w9, w7 // Add dest value
  493. eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)
  494. add w9, w9, w13 // Add constant 0x4881d05
  495. add w9, w9, w6 // Add aux function result
  496. eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  497. ror w9, w9, #9 // Rotate left s=23 bits
  498. movz x10, #0xd039 // Load lower half of constant 0xd9d4d039
  499. add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0x4881d05, s=23, M[6])
  500. movk x10, #0xd9d4, lsl #16 // Load upper half of constant 0xd9d4d039
  501. add w4, w4, w24 // Add dest value
  502. eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)
  503. add w4, w4, w10 // Add constant 0xd9d4d039
  504. add w4, w4, w6 // Add aux function result
  505. ror w4, w4, #28 // Rotate left s=4 bits
  506. eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  507. movz x10, #0x99e5 // Load lower half of constant 0xe6db99e5
  508. add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xd9d4d039, s=4, M[9])
  509. movk x10, #0xe6db, lsl #16 // Load upper half of constant 0xe6db99e5
  510. add w17, w17, w11 // Add dest value
  511. eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)
  512. add w17, w17, w10 // Add constant 0xe6db99e5
  513. add w17, w17, w6 // Add aux function result
  514. eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  515. ror w17, w17, #21 // Rotate left s=11 bits
  516. movz x13, #0x7cf8 // Load lower half of constant 0x1fa27cf8
  517. add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0xe6db99e5, s=11, M[12])
  518. movk x13, #0x1fa2, lsl #16 // Load upper half of constant 0x1fa27cf8
  519. add w8, w8, w27 // Add dest value
  520. eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)
  521. add w8, w8, w13 // Add constant 0x1fa27cf8
  522. add w8, w8, w6 // Add aux function result
  523. ror w8, w8, #16 // Rotate left s=16 bits
  524. eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)
  525. movz x13, #0x5665 // Load lower half of constant 0xc4ac5665
  526. add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0x1fa27cf8, s=16, M[15])
  527. movk x13, #0xc4ac, lsl #16 // Load upper half of constant 0xc4ac5665
  528. add w9, w9, w3 // Add dest value
  529. eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)
  530. add w9, w9, w13 // Add constant 0xc4ac5665
  531. add w9, w9, w6 // Add aux function result
  532. ror w9, w9, #9 // Rotate left s=23 bits
  533. movz x6, #0x2244 // Load lower half of constant 0xf4292244
  534. movk x6, #0xf429, lsl #16 // Load upper half of constant 0xf4292244
  535. add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xc4ac5665, s=23, M[2])
  536. add w4, w4, w15 // Add dest value
  537. orn x13, x9, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  538. add w4, w4, w6 // Add constant 0xf4292244
  539. eor x6, x8, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  540. add w4, w4, w6 // Add aux function result
  541. ror w4, w4, #26 // Rotate left s=6 bits
  542. movz x6, #0xff97 // Load lower half of constant 0x432aff97
  543. movk x6, #0x432a, lsl #16 // Load upper half of constant 0x432aff97
  544. add w4, w9, w4 // Add X parameter round 4 A=II(A, B, C, D, 0xf4292244, s=6, M[0])
  545. orn x10, x4, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  546. add w17, w17, w23 // Add dest value
  547. eor x10, x9, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  548. add w17, w17, w6 // Add constant 0x432aff97
  549. add w6, w17, w10 // Add aux function result
  550. ror w6, w6, #22 // Rotate left s=10 bits
  551. movz x17, #0x23a7 // Load lower half of constant 0xab9423a7
  552. movk x17, #0xab94, lsl #16 // Load upper half of constant 0xab9423a7
  553. add w6, w4, w6 // Add X parameter round 4 D=II(D, A, B, C, 0x432aff97, s=10, M[7])
  554. add w8, w8, w12 // Add dest value
  555. orn x10, x6, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  556. add w8, w8, w17 // Add constant 0xab9423a7
  557. eor x17, x4, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  558. add w8, w8, w17 // Add aux function result
  559. ror w8, w8, #17 // Rotate left s=15 bits
  560. movz x17, #0xa039 // Load lower half of constant 0xfc93a039
  561. movk x17, #0xfc93, lsl #16 // Load upper half of constant 0xfc93a039
  562. add w8, w6, w8 // Add X parameter round 4 C=II(C, D, A, B, 0xab9423a7, s=15, M[14])
  563. orn x13, x8, x4 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  564. add w9, w9, w22 // Add dest value
  565. eor x13, x6, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  566. add w9, w9, w17 // Add constant 0xfc93a039
  567. add w17, w9, w13 // Add aux function result
  568. ror w17, w17, #11 // Rotate left s=21 bits
  569. movz x9, #0x59c3 // Load lower half of constant 0x655b59c3
  570. movk x9, #0x655b, lsl #16 // Load upper half of constant 0x655b59c3
  571. add w17, w8, w17 // Add X parameter round 4 B=II(B, C, D, A, 0xfc93a039, s=21, M[5])
  572. add w4, w4, w11 // Add dest value
  573. orn x13, x17, x6 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  574. add w9, w4, w9 // Add constant 0x655b59c3
  575. eor x4, x8, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  576. add w9, w9, w4 // Add aux function result
  577. ror w9, w9, #26 // Rotate left s=6 bits
  578. movz x4, #0xcc92 // Load lower half of constant 0x8f0ccc92
  579. movk x4, #0x8f0c, lsl #16 // Load upper half of constant 0x8f0ccc92
  580. add w9, w17, w9 // Add X parameter round 4 A=II(A, B, C, D, 0x655b59c3, s=6, M[12])
  581. orn x10, x9, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  582. add w6, w6, w21 // Add dest value
  583. eor x10, x17, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  584. add w4, w6, w4 // Add constant 0x8f0ccc92
  585. add w6, w4, w10 // Add aux function result
  586. ror w6, w6, #22 // Rotate left s=10 bits
  587. movz x4, #0xf47d // Load lower half of constant 0xffeff47d
  588. movk x4, #0xffef, lsl #16 // Load upper half of constant 0xffeff47d
  589. add w6, w9, w6 // Add X parameter round 4 D=II(D, A, B, C, 0x8f0ccc92, s=10, M[3])
  590. add w8, w8, w16 // Add dest value
  591. orn x10, x6, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  592. add w8, w8, w4 // Add constant 0xffeff47d
  593. eor x4, x9, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  594. add w8, w8, w4 // Add aux function result
  595. ror w8, w8, #17 // Rotate left s=15 bits
  596. movz x4, #0x5dd1 // Load lower half of constant 0x85845dd1
  597. movk x4, #0x8584, lsl #16 // Load upper half of constant 0x85845dd1
  598. add w8, w6, w8 // Add X parameter round 4 C=II(C, D, A, B, 0xffeff47d, s=15, M[10])
  599. orn x10, x8, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  600. add w15, w17, w20 // Add dest value
  601. eor x17, x6, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  602. add w15, w15, w4 // Add constant 0x85845dd1
  603. add w4, w15, w17 // Add aux function result
  604. ror w4, w4, #11 // Rotate left s=21 bits
  605. movz x15, #0x7e4f // Load lower half of constant 0x6fa87e4f
  606. movk x15, #0x6fa8, lsl #16 // Load upper half of constant 0x6fa87e4f
  607. add w17, w8, w4 // Add X parameter round 4 B=II(B, C, D, A, 0x85845dd1, s=21, M[1])
  608. add w4, w9, w5 // Add dest value
  609. orn x9, x17, x6 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  610. add w15, w4, w15 // Add constant 0x6fa87e4f
  611. eor x4, x8, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  612. add w9, w15, w4 // Add aux function result
  613. ror w9, w9, #26 // Rotate left s=6 bits
  614. movz x15, #0xe6e0 // Load lower half of constant 0xfe2ce6e0
  615. movk x15, #0xfe2c, lsl #16 // Load upper half of constant 0xfe2ce6e0
  616. add w4, w17, w9 // Add X parameter round 4 A=II(A, B, C, D, 0x6fa87e4f, s=6, M[8])
  617. orn x9, x4, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  618. add w6, w6, w27 // Add dest value
  619. eor x9, x17, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  620. add w15, w6, w15 // Add constant 0xfe2ce6e0
  621. add w6, w15, w9 // Add aux function result
  622. ror w6, w6, #22 // Rotate left s=10 bits
  623. movz x9, #0x4314 // Load lower half of constant 0xa3014314
  624. movk x9, #0xa301, lsl #16 // Load upper half of constant 0xa3014314
  625. add w15, w4, w6 // Add X parameter round 4 D=II(D, A, B, C, 0xfe2ce6e0, s=10, M[15])
  626. add w6, w8, w7 // Add dest value
  627. orn x7, x15, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  628. add w8, w6, w9 // Add constant 0xa3014314
  629. eor x9, x4, x7 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  630. add w6, w8, w9 // Add aux function result
  631. ror w6, w6, #17 // Rotate left s=15 bits
  632. movz x7, #0x11a1 // Load lower half of constant 0x4e0811a1
  633. movk x7, #0x4e08, lsl #16 // Load upper half of constant 0x4e0811a1
  634. add w8, w15, w6 // Add X parameter round 4 C=II(C, D, A, B, 0xa3014314, s=15, M[6])
  635. orn x9, x8, x4 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  636. add w6, w17, w26 // Add dest value
  637. eor x17, x15, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  638. add w9, w6, w7 // Add constant 0x4e0811a1
  639. add w7, w9, w17 // Add aux function result
  640. ror w7, w7, #11 // Rotate left s=21 bits
  641. movz x6, #0x7e82 // Load lower half of constant 0xf7537e82
  642. movk x6, #0xf753, lsl #16 // Load upper half of constant 0xf7537e82
  643. add w9, w8, w7 // Add X parameter round 4 B=II(B, C, D, A, 0x4e0811a1, s=21, M[13])
  644. add w17, w4, w14 // Add dest value
  645. orn x7, x9, x15 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  646. add w14, w17, w6 // Add constant 0xf7537e82
  647. eor x4, x8, x7 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  648. add w17, w14, w4 // Add aux function result
  649. ror w17, w17, #26 // Rotate left s=6 bits
  650. movz x6, #0xf235 // Load lower half of constant 0xbd3af235
  651. movk x6, #0xbd3a, lsl #16 // Load upper half of constant 0xbd3af235
  652. add w7, w9, w17 // Add X parameter round 4 A=II(A, B, C, D, 0xf7537e82, s=6, M[4])
  653. orn x14, x7, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  654. add w4, w15, w25 // Add dest value
  655. eor x17, x9, x14 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  656. add w15, w4, w6 // Add constant 0xbd3af235
  657. add w16, w15, w17 // Add aux function result
  658. ror w16, w16, #22 // Rotate left s=10 bits
  659. movz x14, #0xd2bb // Load lower half of constant 0x2ad7d2bb
  660. movk x14, #0x2ad7, lsl #16 // Load upper half of constant 0x2ad7d2bb
  661. add w4, w7, w16 // Add X parameter round 4 D=II(D, A, B, C, 0xbd3af235, s=10, M[11])
  662. add w6, w8, w3 // Add dest value
  663. orn x15, x4, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  664. add w17, w6, w14 // Add constant 0x2ad7d2bb
  665. eor x16, x7, x15 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  666. add w8, w17, w16 // Add aux function result
  667. ror w8, w8, #17 // Rotate left s=15 bits
  668. movz x3, #0xd391 // Load lower half of constant 0xeb86d391
  669. movk x3, #0xeb86, lsl #16 // Load upper half of constant 0xeb86d391
  670. add w14, w4, w8 // Add X parameter round 4 C=II(C, D, A, B, 0x2ad7d2bb, s=15, M[2])
  671. orn x6, x14, x7 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)
  672. add w15, w9, w24 // Add dest value
  673. eor x17, x4, x6 // End aux function round 4 I(x,y,z)=((~z|x)^y)
  674. add w16, w15, w3 // Add constant 0xeb86d391
  675. add w8, w16, w17 // Add aux function result
  676. ror w8, w8, #11 // Rotate left s=21 bits
  677. ldp w6, w15, [x0] // Reload MD5 state->A and state->B
  678. ldp w5, w9, [x0, #8] // Reload MD5 state->C and state->D
  679. add w3, w14, w8 // Add X parameter round 4 B=II(B, C, D, A, 0xeb86d391, s=21, M[9])
  680. add w13, w4, w9 // Add result of MD5 rounds to state->D
  681. add w12, w14, w5 // Add result of MD5 rounds to state->C
  682. add w10, w7, w6 // Add result of MD5 rounds to state->A
  683. add w11, w3, w15 // Add result of MD5 rounds to state->B
  684. stp w12, w13, [x0, #8] // Store MD5 states C,D
  685. stp w10, w11, [x0] // Store MD5 states A,B
  686. add x1, x1, #64 // Increment data pointer
  687. subs w2, w2, #1 // Decrement block counter
  688. b.ne ossl_md5_blocks_loop
  689. ldp x21,x22,[sp,#16]
  690. ldp x23,x24,[sp,#32]
  691. ldp x25,x26,[sp,#48]
  692. ldp x27,x28,[sp,#64]
  693. ldp x19,x20,[sp],#80
  694. ret
  695. EOF
  696. # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
  697. # CONTEXT *context,DISPATCHER_CONTEXT *disp)
  698. print $code;
  699. close STDOUT or die "error closing STDOUT: $!";