sha256-ssse3-asm.S 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. ########################################################################
  2. # Implement fast SHA-256 with SSSE3 instructions. (x86_64)
  3. #
  4. # Copyright (C) 2013 Intel Corporation.
  5. #
  6. # Authors:
  7. # James Guilford <james.guilford@intel.com>
  8. # Kirk Yap <kirk.s.yap@intel.com>
  9. # Tim Chen <tim.c.chen@linux.intel.com>
  10. #
  11. # This software is available to you under a choice of one of two
  12. # licenses. You may choose to be licensed under the terms of the GNU
  13. # General Public License (GPL) Version 2, available from the file
  14. # COPYING in the main directory of this source tree, or the
  15. # OpenIB.org BSD license below:
  16. #
  17. # Redistribution and use in source and binary forms, with or
  18. # without modification, are permitted provided that the following
  19. # conditions are met:
  20. #
  21. # - Redistributions of source code must retain the above
  22. # copyright notice, this list of conditions and the following
  23. # disclaimer.
  24. #
  25. # - Redistributions in binary form must reproduce the above
  26. # copyright notice, this list of conditions and the following
  27. # disclaimer in the documentation and/or other materials
  28. # provided with the distribution.
  29. #
  30. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  31. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  32. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  33. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  34. # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  35. # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  36. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  37. # SOFTWARE.
  38. #
  39. ########################################################################
  40. #
  41. # This code is described in an Intel White-Paper:
  42. # "Fast SHA-256 Implementations on Intel Architecture Processors"
  43. #
  44. # To find it, surf to http://www.intel.com/p/en_US/embedded
  45. # and search for that title.
  46. #
  47. ########################################################################
  48. #include <linux/linkage.h>
  49. ## assume buffers not aligned
  50. #define MOVDQ movdqu
  51. ################################ Define Macros
  52. # addm [mem], reg
  53. # Add reg to mem using reg-mem add and store
  54. .macro addm p1 p2
  55. add \p1, \p2
  56. mov \p2, \p1
  57. .endm
  58. ################################
  59. # COPY_XMM_AND_BSWAP xmm, [mem], byte_flip_mask
  60. # Load xmm with mem and byte swap each dword
  61. .macro COPY_XMM_AND_BSWAP p1 p2 p3
  62. MOVDQ \p2, \p1
  63. pshufb \p3, \p1
  64. .endm
  65. ################################
  66. X0 = %xmm4
  67. X1 = %xmm5
  68. X2 = %xmm6
  69. X3 = %xmm7
  70. XTMP0 = %xmm0
  71. XTMP1 = %xmm1
  72. XTMP2 = %xmm2
  73. XTMP3 = %xmm3
  74. XTMP4 = %xmm8
  75. XFER = %xmm9
  76. SHUF_00BA = %xmm10 # shuffle xBxA -> 00BA
  77. SHUF_DC00 = %xmm11 # shuffle xDxC -> DC00
  78. BYTE_FLIP_MASK = %xmm12
  79. NUM_BLKS = %rdx # 3rd arg
  80. INP = %rsi # 2nd arg
  81. CTX = %rdi # 1st arg
  82. SRND = %rsi # clobbers INP
  83. c = %ecx
  84. d = %r8d
  85. e = %edx
  86. TBL = %r12
  87. a = %eax
  88. b = %ebx
  89. f = %r9d
  90. g = %r10d
  91. h = %r11d
  92. y0 = %r13d
  93. y1 = %r14d
  94. y2 = %r15d
  95. _INP_END_SIZE = 8
  96. _INP_SIZE = 8
  97. _XFER_SIZE = 16
  98. _XMM_SAVE_SIZE = 0
  99. _INP_END = 0
  100. _INP = _INP_END + _INP_END_SIZE
  101. _XFER = _INP + _INP_SIZE
  102. _XMM_SAVE = _XFER + _XFER_SIZE
  103. STACK_SIZE = _XMM_SAVE + _XMM_SAVE_SIZE
  104. # rotate_Xs
  105. # Rotate values of symbols X0...X3
  106. .macro rotate_Xs
  107. X_ = X0
  108. X0 = X1
  109. X1 = X2
  110. X2 = X3
  111. X3 = X_
  112. .endm
  113. # ROTATE_ARGS
  114. # Rotate values of symbols a...h
  115. .macro ROTATE_ARGS
  116. TMP_ = h
  117. h = g
  118. g = f
  119. f = e
  120. e = d
  121. d = c
  122. c = b
  123. b = a
  124. a = TMP_
  125. .endm
  126. .macro FOUR_ROUNDS_AND_SCHED
  127. ## compute s0 four at a time and s1 two at a time
  128. ## compute W[-16] + W[-7] 4 at a time
  129. movdqa X3, XTMP0
  130. mov e, y0 # y0 = e
  131. ror $(25-11), y0 # y0 = e >> (25-11)
  132. mov a, y1 # y1 = a
  133. palignr $4, X2, XTMP0 # XTMP0 = W[-7]
  134. ror $(22-13), y1 # y1 = a >> (22-13)
  135. xor e, y0 # y0 = e ^ (e >> (25-11))
  136. mov f, y2 # y2 = f
  137. ror $(11-6), y0 # y0 = (e >> (11-6)) ^ (e >> (25-6))
  138. movdqa X1, XTMP1
  139. xor a, y1 # y1 = a ^ (a >> (22-13)
  140. xor g, y2 # y2 = f^g
  141. paddd X0, XTMP0 # XTMP0 = W[-7] + W[-16]
  142. xor e, y0 # y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
  143. and e, y2 # y2 = (f^g)&e
  144. ror $(13-2), y1 # y1 = (a >> (13-2)) ^ (a >> (22-2))
  145. ## compute s0
  146. palignr $4, X0, XTMP1 # XTMP1 = W[-15]
  147. xor a, y1 # y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
  148. ror $6, y0 # y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
  149. xor g, y2 # y2 = CH = ((f^g)&e)^g
  150. movdqa XTMP1, XTMP2 # XTMP2 = W[-15]
  151. ror $2, y1 # y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
  152. add y0, y2 # y2 = S1 + CH
  153. add _XFER(%rsp) , y2 # y2 = k + w + S1 + CH
  154. movdqa XTMP1, XTMP3 # XTMP3 = W[-15]
  155. mov a, y0 # y0 = a
  156. add y2, h # h = h + S1 + CH + k + w
  157. mov a, y2 # y2 = a
  158. pslld $(32-7), XTMP1 #
  159. or c, y0 # y0 = a|c
  160. add h, d # d = d + h + S1 + CH + k + w
  161. and c, y2 # y2 = a&c
  162. psrld $7, XTMP2 #
  163. and b, y0 # y0 = (a|c)&b
  164. add y1, h # h = h + S1 + CH + k + w + S0
  165. por XTMP2, XTMP1 # XTMP1 = W[-15] ror 7
  166. or y2, y0 # y0 = MAJ = (a|c)&b)|(a&c)
  167. add y0, h # h = h + S1 + CH + k + w + S0 + MAJ
  168. #
  169. ROTATE_ARGS #
  170. movdqa XTMP3, XTMP2 # XTMP2 = W[-15]
  171. mov e, y0 # y0 = e
  172. mov a, y1 # y1 = a
  173. movdqa XTMP3, XTMP4 # XTMP4 = W[-15]
  174. ror $(25-11), y0 # y0 = e >> (25-11)
  175. xor e, y0 # y0 = e ^ (e >> (25-11))
  176. mov f, y2 # y2 = f
  177. ror $(22-13), y1 # y1 = a >> (22-13)
  178. pslld $(32-18), XTMP3 #
  179. xor a, y1 # y1 = a ^ (a >> (22-13)
  180. ror $(11-6), y0 # y0 = (e >> (11-6)) ^ (e >> (25-6))
  181. xor g, y2 # y2 = f^g
  182. psrld $18, XTMP2 #
  183. ror $(13-2), y1 # y1 = (a >> (13-2)) ^ (a >> (22-2))
  184. xor e, y0 # y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
  185. and e, y2 # y2 = (f^g)&e
  186. ror $6, y0 # y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
  187. pxor XTMP3, XTMP1
  188. xor a, y1 # y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
  189. xor g, y2 # y2 = CH = ((f^g)&e)^g
  190. psrld $3, XTMP4 # XTMP4 = W[-15] >> 3
  191. add y0, y2 # y2 = S1 + CH
  192. add (1*4 + _XFER)(%rsp), y2 # y2 = k + w + S1 + CH
  193. ror $2, y1 # y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
  194. pxor XTMP2, XTMP1 # XTMP1 = W[-15] ror 7 ^ W[-15] ror 18
  195. mov a, y0 # y0 = a
  196. add y2, h # h = h + S1 + CH + k + w
  197. mov a, y2 # y2 = a
  198. pxor XTMP4, XTMP1 # XTMP1 = s0
  199. or c, y0 # y0 = a|c
  200. add h, d # d = d + h + S1 + CH + k + w
  201. and c, y2 # y2 = a&c
  202. ## compute low s1
  203. pshufd $0b11111010, X3, XTMP2 # XTMP2 = W[-2] {BBAA}
  204. and b, y0 # y0 = (a|c)&b
  205. add y1, h # h = h + S1 + CH + k + w + S0
  206. paddd XTMP1, XTMP0 # XTMP0 = W[-16] + W[-7] + s0
  207. or y2, y0 # y0 = MAJ = (a|c)&b)|(a&c)
  208. add y0, h # h = h + S1 + CH + k + w + S0 + MAJ
  209. ROTATE_ARGS
  210. movdqa XTMP2, XTMP3 # XTMP3 = W[-2] {BBAA}
  211. mov e, y0 # y0 = e
  212. mov a, y1 # y1 = a
  213. ror $(25-11), y0 # y0 = e >> (25-11)
  214. movdqa XTMP2, XTMP4 # XTMP4 = W[-2] {BBAA}
  215. xor e, y0 # y0 = e ^ (e >> (25-11))
  216. ror $(22-13), y1 # y1 = a >> (22-13)
  217. mov f, y2 # y2 = f
  218. xor a, y1 # y1 = a ^ (a >> (22-13)
  219. ror $(11-6), y0 # y0 = (e >> (11-6)) ^ (e >> (25-6))
  220. psrlq $17, XTMP2 # XTMP2 = W[-2] ror 17 {xBxA}
  221. xor g, y2 # y2 = f^g
  222. psrlq $19, XTMP3 # XTMP3 = W[-2] ror 19 {xBxA}
  223. xor e, y0 # y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
  224. and e, y2 # y2 = (f^g)&e
  225. psrld $10, XTMP4 # XTMP4 = W[-2] >> 10 {BBAA}
  226. ror $(13-2), y1 # y1 = (a >> (13-2)) ^ (a >> (22-2))
  227. xor a, y1 # y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
  228. xor g, y2 # y2 = CH = ((f^g)&e)^g
  229. ror $6, y0 # y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
  230. pxor XTMP3, XTMP2
  231. add y0, y2 # y2 = S1 + CH
  232. ror $2, y1 # y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
  233. add (2*4 + _XFER)(%rsp), y2 # y2 = k + w + S1 + CH
  234. pxor XTMP2, XTMP4 # XTMP4 = s1 {xBxA}
  235. mov a, y0 # y0 = a
  236. add y2, h # h = h + S1 + CH + k + w
  237. mov a, y2 # y2 = a
  238. pshufb SHUF_00BA, XTMP4 # XTMP4 = s1 {00BA}
  239. or c, y0 # y0 = a|c
  240. add h, d # d = d + h + S1 + CH + k + w
  241. and c, y2 # y2 = a&c
  242. paddd XTMP4, XTMP0 # XTMP0 = {..., ..., W[1], W[0]}
  243. and b, y0 # y0 = (a|c)&b
  244. add y1, h # h = h + S1 + CH + k + w + S0
  245. ## compute high s1
  246. pshufd $0b01010000, XTMP0, XTMP2 # XTMP2 = W[-2] {BBAA}
  247. or y2, y0 # y0 = MAJ = (a|c)&b)|(a&c)
  248. add y0, h # h = h + S1 + CH + k + w + S0 + MAJ
  249. #
  250. ROTATE_ARGS #
  251. movdqa XTMP2, XTMP3 # XTMP3 = W[-2] {DDCC}
  252. mov e, y0 # y0 = e
  253. ror $(25-11), y0 # y0 = e >> (25-11)
  254. mov a, y1 # y1 = a
  255. movdqa XTMP2, X0 # X0 = W[-2] {DDCC}
  256. ror $(22-13), y1 # y1 = a >> (22-13)
  257. xor e, y0 # y0 = e ^ (e >> (25-11))
  258. mov f, y2 # y2 = f
  259. ror $(11-6), y0 # y0 = (e >> (11-6)) ^ (e >> (25-6))
  260. psrlq $17, XTMP2 # XTMP2 = W[-2] ror 17 {xDxC}
  261. xor a, y1 # y1 = a ^ (a >> (22-13)
  262. xor g, y2 # y2 = f^g
  263. psrlq $19, XTMP3 # XTMP3 = W[-2] ror 19 {xDxC}
  264. xor e, y0 # y0 = e ^ (e >> (11-6)) ^ (e >> (25
  265. and e, y2 # y2 = (f^g)&e
  266. ror $(13-2), y1 # y1 = (a >> (13-2)) ^ (a >> (22-2))
  267. psrld $10, X0 # X0 = W[-2] >> 10 {DDCC}
  268. xor a, y1 # y1 = a ^ (a >> (13-2)) ^ (a >> (22
  269. ror $6, y0 # y0 = S1 = (e>>6) & (e>>11) ^ (e>>2
  270. xor g, y2 # y2 = CH = ((f^g)&e)^g
  271. pxor XTMP3, XTMP2 #
  272. ror $2, y1 # y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>2
  273. add y0, y2 # y2 = S1 + CH
  274. add (3*4 + _XFER)(%rsp), y2 # y2 = k + w + S1 + CH
  275. pxor XTMP2, X0 # X0 = s1 {xDxC}
  276. mov a, y0 # y0 = a
  277. add y2, h # h = h + S1 + CH + k + w
  278. mov a, y2 # y2 = a
  279. pshufb SHUF_DC00, X0 # X0 = s1 {DC00}
  280. or c, y0 # y0 = a|c
  281. add h, d # d = d + h + S1 + CH + k + w
  282. and c, y2 # y2 = a&c
  283. paddd XTMP0, X0 # X0 = {W[3], W[2], W[1], W[0]}
  284. and b, y0 # y0 = (a|c)&b
  285. add y1, h # h = h + S1 + CH + k + w + S0
  286. or y2, y0 # y0 = MAJ = (a|c)&b)|(a&c)
  287. add y0, h # h = h + S1 + CH + k + w + S0 + MAJ
  288. ROTATE_ARGS
  289. rotate_Xs
  290. .endm
  291. ## input is [rsp + _XFER + %1 * 4]
  292. .macro DO_ROUND round
  293. mov e, y0 # y0 = e
  294. ror $(25-11), y0 # y0 = e >> (25-11)
  295. mov a, y1 # y1 = a
  296. xor e, y0 # y0 = e ^ (e >> (25-11))
  297. ror $(22-13), y1 # y1 = a >> (22-13)
  298. mov f, y2 # y2 = f
  299. xor a, y1 # y1 = a ^ (a >> (22-13)
  300. ror $(11-6), y0 # y0 = (e >> (11-6)) ^ (e >> (25-6))
  301. xor g, y2 # y2 = f^g
  302. xor e, y0 # y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
  303. ror $(13-2), y1 # y1 = (a >> (13-2)) ^ (a >> (22-2))
  304. and e, y2 # y2 = (f^g)&e
  305. xor a, y1 # y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
  306. ror $6, y0 # y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
  307. xor g, y2 # y2 = CH = ((f^g)&e)^g
  308. add y0, y2 # y2 = S1 + CH
  309. ror $2, y1 # y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
  310. offset = \round * 4 + _XFER
  311. add offset(%rsp), y2 # y2 = k + w + S1 + CH
  312. mov a, y0 # y0 = a
  313. add y2, h # h = h + S1 + CH + k + w
  314. mov a, y2 # y2 = a
  315. or c, y0 # y0 = a|c
  316. add h, d # d = d + h + S1 + CH + k + w
  317. and c, y2 # y2 = a&c
  318. and b, y0 # y0 = (a|c)&b
  319. add y1, h # h = h + S1 + CH + k + w + S0
  320. or y2, y0 # y0 = MAJ = (a|c)&b)|(a&c)
  321. add y0, h # h = h + S1 + CH + k + w + S0 + MAJ
  322. ROTATE_ARGS
  323. .endm
  324. ########################################################################
  325. ## void sha256_transform_ssse3(void *input_data, UINT32 digest[8], UINT64 num_blks)
  326. ## arg 1 : pointer to digest
  327. ## arg 2 : pointer to input data
  328. ## arg 3 : Num blocks
  329. ########################################################################
  330. .text
  331. ENTRY(sha256_transform_ssse3)
  332. .align 32
  333. pushq %rbx
  334. pushq %r12
  335. pushq %r13
  336. pushq %r14
  337. pushq %r15
  338. pushq %rbp
  339. mov %rsp, %rbp
  340. subq $STACK_SIZE, %rsp
  341. and $~15, %rsp
  342. shl $6, NUM_BLKS # convert to bytes
  343. jz done_hash
  344. add INP, NUM_BLKS
  345. mov NUM_BLKS, _INP_END(%rsp) # pointer to end of data
  346. ## load initial digest
  347. mov 4*0(CTX), a
  348. mov 4*1(CTX), b
  349. mov 4*2(CTX), c
  350. mov 4*3(CTX), d
  351. mov 4*4(CTX), e
  352. mov 4*5(CTX), f
  353. mov 4*6(CTX), g
  354. mov 4*7(CTX), h
  355. movdqa PSHUFFLE_BYTE_FLIP_MASK(%rip), BYTE_FLIP_MASK
  356. movdqa _SHUF_00BA(%rip), SHUF_00BA
  357. movdqa _SHUF_DC00(%rip), SHUF_DC00
  358. loop0:
  359. lea K256(%rip), TBL
  360. ## byte swap first 16 dwords
  361. COPY_XMM_AND_BSWAP X0, 0*16(INP), BYTE_FLIP_MASK
  362. COPY_XMM_AND_BSWAP X1, 1*16(INP), BYTE_FLIP_MASK
  363. COPY_XMM_AND_BSWAP X2, 2*16(INP), BYTE_FLIP_MASK
  364. COPY_XMM_AND_BSWAP X3, 3*16(INP), BYTE_FLIP_MASK
  365. mov INP, _INP(%rsp)
  366. ## schedule 48 input dwords, by doing 3 rounds of 16 each
  367. mov $3, SRND
  368. .align 16
  369. loop1:
  370. movdqa (TBL), XFER
  371. paddd X0, XFER
  372. movdqa XFER, _XFER(%rsp)
  373. FOUR_ROUNDS_AND_SCHED
  374. movdqa 1*16(TBL), XFER
  375. paddd X0, XFER
  376. movdqa XFER, _XFER(%rsp)
  377. FOUR_ROUNDS_AND_SCHED
  378. movdqa 2*16(TBL), XFER
  379. paddd X0, XFER
  380. movdqa XFER, _XFER(%rsp)
  381. FOUR_ROUNDS_AND_SCHED
  382. movdqa 3*16(TBL), XFER
  383. paddd X0, XFER
  384. movdqa XFER, _XFER(%rsp)
  385. add $4*16, TBL
  386. FOUR_ROUNDS_AND_SCHED
  387. sub $1, SRND
  388. jne loop1
  389. mov $2, SRND
  390. loop2:
  391. paddd (TBL), X0
  392. movdqa X0, _XFER(%rsp)
  393. DO_ROUND 0
  394. DO_ROUND 1
  395. DO_ROUND 2
  396. DO_ROUND 3
  397. paddd 1*16(TBL), X1
  398. movdqa X1, _XFER(%rsp)
  399. add $2*16, TBL
  400. DO_ROUND 0
  401. DO_ROUND 1
  402. DO_ROUND 2
  403. DO_ROUND 3
  404. movdqa X2, X0
  405. movdqa X3, X1
  406. sub $1, SRND
  407. jne loop2
  408. addm (4*0)(CTX),a
  409. addm (4*1)(CTX),b
  410. addm (4*2)(CTX),c
  411. addm (4*3)(CTX),d
  412. addm (4*4)(CTX),e
  413. addm (4*5)(CTX),f
  414. addm (4*6)(CTX),g
  415. addm (4*7)(CTX),h
  416. mov _INP(%rsp), INP
  417. add $64, INP
  418. cmp _INP_END(%rsp), INP
  419. jne loop0
  420. done_hash:
  421. mov %rbp, %rsp
  422. popq %rbp
  423. popq %r15
  424. popq %r14
  425. popq %r13
  426. popq %r12
  427. popq %rbx
  428. ret
  429. ENDPROC(sha256_transform_ssse3)
  430. .section .rodata.cst256.K256, "aM", @progbits, 256
  431. .align 64
  432. K256:
  433. .long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
  434. .long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
  435. .long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
  436. .long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
  437. .long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
  438. .long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
  439. .long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
  440. .long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
  441. .long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
  442. .long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
  443. .long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
  444. .long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
  445. .long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
  446. .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
  447. .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
  448. .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
  449. .section .rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
  450. .align 16
  451. PSHUFFLE_BYTE_FLIP_MASK:
  452. .octa 0x0c0d0e0f08090a0b0405060700010203
  453. .section .rodata.cst16._SHUF_00BA, "aM", @progbits, 16
  454. .align 16
  455. # shuffle xBxA -> 00BA
  456. _SHUF_00BA:
  457. .octa 0xFFFFFFFFFFFFFFFF0b0a090803020100
  458. .section .rodata.cst16._SHUF_DC00, "aM", @progbits, 16
  459. .align 16
  460. # shuffle xDxC -> DC00
  461. _SHUF_DC00:
  462. .octa 0x0b0a090803020100FFFFFFFFFFFFFFFF