1 | %ifidn __OUTPUT_FORMAT__,obj
|
---|
2 | section code use32 class=code align=64
|
---|
3 | %elifidn __OUTPUT_FORMAT__,win32
|
---|
4 | section .text code align=64
|
---|
5 | %else
|
---|
6 | section .text code
|
---|
7 | %endif
|
---|
8 | ;extern _OPENSSL_ia32cap_P
|
---|
9 | global _aesni_encrypt
|
---|
10 | align 16
|
---|
11 | _aesni_encrypt:
|
---|
12 | L$_aesni_encrypt_begin:
|
---|
13 | mov eax,DWORD [4+esp]
|
---|
14 | mov edx,DWORD [12+esp]
|
---|
15 | movups xmm2,[eax]
|
---|
16 | mov ecx,DWORD [240+edx]
|
---|
17 | mov eax,DWORD [8+esp]
|
---|
18 | movups xmm0,[edx]
|
---|
19 | movups xmm1,[16+edx]
|
---|
20 | lea edx,[32+edx]
|
---|
21 | xorps xmm2,xmm0
|
---|
22 | L$000enc1_loop_1:
|
---|
23 | db 102,15,56,220,209
|
---|
24 | dec ecx
|
---|
25 | movups xmm1,[edx]
|
---|
26 | lea edx,[16+edx]
|
---|
27 | jnz NEAR L$000enc1_loop_1
|
---|
28 | db 102,15,56,221,209
|
---|
29 | pxor xmm0,xmm0
|
---|
30 | pxor xmm1,xmm1
|
---|
31 | movups [eax],xmm2
|
---|
32 | pxor xmm2,xmm2
|
---|
33 | ret
|
---|
34 | global _aesni_decrypt
|
---|
35 | align 16
|
---|
36 | _aesni_decrypt:
|
---|
37 | L$_aesni_decrypt_begin:
|
---|
38 | mov eax,DWORD [4+esp]
|
---|
39 | mov edx,DWORD [12+esp]
|
---|
40 | movups xmm2,[eax]
|
---|
41 | mov ecx,DWORD [240+edx]
|
---|
42 | mov eax,DWORD [8+esp]
|
---|
43 | movups xmm0,[edx]
|
---|
44 | movups xmm1,[16+edx]
|
---|
45 | lea edx,[32+edx]
|
---|
46 | xorps xmm2,xmm0
|
---|
47 | L$001dec1_loop_2:
|
---|
48 | db 102,15,56,222,209
|
---|
49 | dec ecx
|
---|
50 | movups xmm1,[edx]
|
---|
51 | lea edx,[16+edx]
|
---|
52 | jnz NEAR L$001dec1_loop_2
|
---|
53 | db 102,15,56,223,209
|
---|
54 | pxor xmm0,xmm0
|
---|
55 | pxor xmm1,xmm1
|
---|
56 | movups [eax],xmm2
|
---|
57 | pxor xmm2,xmm2
|
---|
58 | ret
|
---|
59 | align 16
|
---|
60 | __aesni_encrypt2:
|
---|
61 | movups xmm0,[edx]
|
---|
62 | shl ecx,4
|
---|
63 | movups xmm1,[16+edx]
|
---|
64 | xorps xmm2,xmm0
|
---|
65 | pxor xmm3,xmm0
|
---|
66 | movups xmm0,[32+edx]
|
---|
67 | lea edx,[32+ecx*1+edx]
|
---|
68 | neg ecx
|
---|
69 | add ecx,16
|
---|
70 | L$002enc2_loop:
|
---|
71 | db 102,15,56,220,209
|
---|
72 | db 102,15,56,220,217
|
---|
73 | movups xmm1,[ecx*1+edx]
|
---|
74 | add ecx,32
|
---|
75 | db 102,15,56,220,208
|
---|
76 | db 102,15,56,220,216
|
---|
77 | movups xmm0,[ecx*1+edx-16]
|
---|
78 | jnz NEAR L$002enc2_loop
|
---|
79 | db 102,15,56,220,209
|
---|
80 | db 102,15,56,220,217
|
---|
81 | db 102,15,56,221,208
|
---|
82 | db 102,15,56,221,216
|
---|
83 | ret
|
---|
84 | align 16
|
---|
85 | __aesni_decrypt2:
|
---|
86 | movups xmm0,[edx]
|
---|
87 | shl ecx,4
|
---|
88 | movups xmm1,[16+edx]
|
---|
89 | xorps xmm2,xmm0
|
---|
90 | pxor xmm3,xmm0
|
---|
91 | movups xmm0,[32+edx]
|
---|
92 | lea edx,[32+ecx*1+edx]
|
---|
93 | neg ecx
|
---|
94 | add ecx,16
|
---|
95 | L$003dec2_loop:
|
---|
96 | db 102,15,56,222,209
|
---|
97 | db 102,15,56,222,217
|
---|
98 | movups xmm1,[ecx*1+edx]
|
---|
99 | add ecx,32
|
---|
100 | db 102,15,56,222,208
|
---|
101 | db 102,15,56,222,216
|
---|
102 | movups xmm0,[ecx*1+edx-16]
|
---|
103 | jnz NEAR L$003dec2_loop
|
---|
104 | db 102,15,56,222,209
|
---|
105 | db 102,15,56,222,217
|
---|
106 | db 102,15,56,223,208
|
---|
107 | db 102,15,56,223,216
|
---|
108 | ret
|
---|
109 | align 16
|
---|
110 | __aesni_encrypt3:
|
---|
111 | movups xmm0,[edx]
|
---|
112 | shl ecx,4
|
---|
113 | movups xmm1,[16+edx]
|
---|
114 | xorps xmm2,xmm0
|
---|
115 | pxor xmm3,xmm0
|
---|
116 | pxor xmm4,xmm0
|
---|
117 | movups xmm0,[32+edx]
|
---|
118 | lea edx,[32+ecx*1+edx]
|
---|
119 | neg ecx
|
---|
120 | add ecx,16
|
---|
121 | L$004enc3_loop:
|
---|
122 | db 102,15,56,220,209
|
---|
123 | db 102,15,56,220,217
|
---|
124 | db 102,15,56,220,225
|
---|
125 | movups xmm1,[ecx*1+edx]
|
---|
126 | add ecx,32
|
---|
127 | db 102,15,56,220,208
|
---|
128 | db 102,15,56,220,216
|
---|
129 | db 102,15,56,220,224
|
---|
130 | movups xmm0,[ecx*1+edx-16]
|
---|
131 | jnz NEAR L$004enc3_loop
|
---|
132 | db 102,15,56,220,209
|
---|
133 | db 102,15,56,220,217
|
---|
134 | db 102,15,56,220,225
|
---|
135 | db 102,15,56,221,208
|
---|
136 | db 102,15,56,221,216
|
---|
137 | db 102,15,56,221,224
|
---|
138 | ret
|
---|
139 | align 16
|
---|
140 | __aesni_decrypt3:
|
---|
141 | movups xmm0,[edx]
|
---|
142 | shl ecx,4
|
---|
143 | movups xmm1,[16+edx]
|
---|
144 | xorps xmm2,xmm0
|
---|
145 | pxor xmm3,xmm0
|
---|
146 | pxor xmm4,xmm0
|
---|
147 | movups xmm0,[32+edx]
|
---|
148 | lea edx,[32+ecx*1+edx]
|
---|
149 | neg ecx
|
---|
150 | add ecx,16
|
---|
151 | L$005dec3_loop:
|
---|
152 | db 102,15,56,222,209
|
---|
153 | db 102,15,56,222,217
|
---|
154 | db 102,15,56,222,225
|
---|
155 | movups xmm1,[ecx*1+edx]
|
---|
156 | add ecx,32
|
---|
157 | db 102,15,56,222,208
|
---|
158 | db 102,15,56,222,216
|
---|
159 | db 102,15,56,222,224
|
---|
160 | movups xmm0,[ecx*1+edx-16]
|
---|
161 | jnz NEAR L$005dec3_loop
|
---|
162 | db 102,15,56,222,209
|
---|
163 | db 102,15,56,222,217
|
---|
164 | db 102,15,56,222,225
|
---|
165 | db 102,15,56,223,208
|
---|
166 | db 102,15,56,223,216
|
---|
167 | db 102,15,56,223,224
|
---|
168 | ret
|
---|
169 | align 16
|
---|
170 | __aesni_encrypt4:
|
---|
171 | movups xmm0,[edx]
|
---|
172 | movups xmm1,[16+edx]
|
---|
173 | shl ecx,4
|
---|
174 | xorps xmm2,xmm0
|
---|
175 | pxor xmm3,xmm0
|
---|
176 | pxor xmm4,xmm0
|
---|
177 | pxor xmm5,xmm0
|
---|
178 | movups xmm0,[32+edx]
|
---|
179 | lea edx,[32+ecx*1+edx]
|
---|
180 | neg ecx
|
---|
181 | db 15,31,64,0
|
---|
182 | add ecx,16
|
---|
183 | L$006enc4_loop:
|
---|
184 | db 102,15,56,220,209
|
---|
185 | db 102,15,56,220,217
|
---|
186 | db 102,15,56,220,225
|
---|
187 | db 102,15,56,220,233
|
---|
188 | movups xmm1,[ecx*1+edx]
|
---|
189 | add ecx,32
|
---|
190 | db 102,15,56,220,208
|
---|
191 | db 102,15,56,220,216
|
---|
192 | db 102,15,56,220,224
|
---|
193 | db 102,15,56,220,232
|
---|
194 | movups xmm0,[ecx*1+edx-16]
|
---|
195 | jnz NEAR L$006enc4_loop
|
---|
196 | db 102,15,56,220,209
|
---|
197 | db 102,15,56,220,217
|
---|
198 | db 102,15,56,220,225
|
---|
199 | db 102,15,56,220,233
|
---|
200 | db 102,15,56,221,208
|
---|
201 | db 102,15,56,221,216
|
---|
202 | db 102,15,56,221,224
|
---|
203 | db 102,15,56,221,232
|
---|
204 | ret
|
---|
205 | align 16
|
---|
206 | __aesni_decrypt4:
|
---|
207 | movups xmm0,[edx]
|
---|
208 | movups xmm1,[16+edx]
|
---|
209 | shl ecx,4
|
---|
210 | xorps xmm2,xmm0
|
---|
211 | pxor xmm3,xmm0
|
---|
212 | pxor xmm4,xmm0
|
---|
213 | pxor xmm5,xmm0
|
---|
214 | movups xmm0,[32+edx]
|
---|
215 | lea edx,[32+ecx*1+edx]
|
---|
216 | neg ecx
|
---|
217 | db 15,31,64,0
|
---|
218 | add ecx,16
|
---|
219 | L$007dec4_loop:
|
---|
220 | db 102,15,56,222,209
|
---|
221 | db 102,15,56,222,217
|
---|
222 | db 102,15,56,222,225
|
---|
223 | db 102,15,56,222,233
|
---|
224 | movups xmm1,[ecx*1+edx]
|
---|
225 | add ecx,32
|
---|
226 | db 102,15,56,222,208
|
---|
227 | db 102,15,56,222,216
|
---|
228 | db 102,15,56,222,224
|
---|
229 | db 102,15,56,222,232
|
---|
230 | movups xmm0,[ecx*1+edx-16]
|
---|
231 | jnz NEAR L$007dec4_loop
|
---|
232 | db 102,15,56,222,209
|
---|
233 | db 102,15,56,222,217
|
---|
234 | db 102,15,56,222,225
|
---|
235 | db 102,15,56,222,233
|
---|
236 | db 102,15,56,223,208
|
---|
237 | db 102,15,56,223,216
|
---|
238 | db 102,15,56,223,224
|
---|
239 | db 102,15,56,223,232
|
---|
240 | ret
|
---|
241 | align 16
|
---|
242 | __aesni_encrypt6:
|
---|
243 | movups xmm0,[edx]
|
---|
244 | shl ecx,4
|
---|
245 | movups xmm1,[16+edx]
|
---|
246 | xorps xmm2,xmm0
|
---|
247 | pxor xmm3,xmm0
|
---|
248 | pxor xmm4,xmm0
|
---|
249 | db 102,15,56,220,209
|
---|
250 | pxor xmm5,xmm0
|
---|
251 | pxor xmm6,xmm0
|
---|
252 | db 102,15,56,220,217
|
---|
253 | lea edx,[32+ecx*1+edx]
|
---|
254 | neg ecx
|
---|
255 | db 102,15,56,220,225
|
---|
256 | pxor xmm7,xmm0
|
---|
257 | movups xmm0,[ecx*1+edx]
|
---|
258 | add ecx,16
|
---|
259 | jmp NEAR L$008_aesni_encrypt6_inner
|
---|
260 | align 16
|
---|
261 | L$009enc6_loop:
|
---|
262 | db 102,15,56,220,209
|
---|
263 | db 102,15,56,220,217
|
---|
264 | db 102,15,56,220,225
|
---|
265 | L$008_aesni_encrypt6_inner:
|
---|
266 | db 102,15,56,220,233
|
---|
267 | db 102,15,56,220,241
|
---|
268 | db 102,15,56,220,249
|
---|
269 | L$_aesni_encrypt6_enter:
|
---|
270 | movups xmm1,[ecx*1+edx]
|
---|
271 | add ecx,32
|
---|
272 | db 102,15,56,220,208
|
---|
273 | db 102,15,56,220,216
|
---|
274 | db 102,15,56,220,224
|
---|
275 | db 102,15,56,220,232
|
---|
276 | db 102,15,56,220,240
|
---|
277 | db 102,15,56,220,248
|
---|
278 | movups xmm0,[ecx*1+edx-16]
|
---|
279 | jnz NEAR L$009enc6_loop
|
---|
280 | db 102,15,56,220,209
|
---|
281 | db 102,15,56,220,217
|
---|
282 | db 102,15,56,220,225
|
---|
283 | db 102,15,56,220,233
|
---|
284 | db 102,15,56,220,241
|
---|
285 | db 102,15,56,220,249
|
---|
286 | db 102,15,56,221,208
|
---|
287 | db 102,15,56,221,216
|
---|
288 | db 102,15,56,221,224
|
---|
289 | db 102,15,56,221,232
|
---|
290 | db 102,15,56,221,240
|
---|
291 | db 102,15,56,221,248
|
---|
292 | ret
|
---|
293 | align 16
|
---|
294 | __aesni_decrypt6:
|
---|
295 | movups xmm0,[edx]
|
---|
296 | shl ecx,4
|
---|
297 | movups xmm1,[16+edx]
|
---|
298 | xorps xmm2,xmm0
|
---|
299 | pxor xmm3,xmm0
|
---|
300 | pxor xmm4,xmm0
|
---|
301 | db 102,15,56,222,209
|
---|
302 | pxor xmm5,xmm0
|
---|
303 | pxor xmm6,xmm0
|
---|
304 | db 102,15,56,222,217
|
---|
305 | lea edx,[32+ecx*1+edx]
|
---|
306 | neg ecx
|
---|
307 | db 102,15,56,222,225
|
---|
308 | pxor xmm7,xmm0
|
---|
309 | movups xmm0,[ecx*1+edx]
|
---|
310 | add ecx,16
|
---|
311 | jmp NEAR L$010_aesni_decrypt6_inner
|
---|
312 | align 16
|
---|
313 | L$011dec6_loop:
|
---|
314 | db 102,15,56,222,209
|
---|
315 | db 102,15,56,222,217
|
---|
316 | db 102,15,56,222,225
|
---|
317 | L$010_aesni_decrypt6_inner:
|
---|
318 | db 102,15,56,222,233
|
---|
319 | db 102,15,56,222,241
|
---|
320 | db 102,15,56,222,249
|
---|
321 | L$_aesni_decrypt6_enter:
|
---|
322 | movups xmm1,[ecx*1+edx]
|
---|
323 | add ecx,32
|
---|
324 | db 102,15,56,222,208
|
---|
325 | db 102,15,56,222,216
|
---|
326 | db 102,15,56,222,224
|
---|
327 | db 102,15,56,222,232
|
---|
328 | db 102,15,56,222,240
|
---|
329 | db 102,15,56,222,248
|
---|
330 | movups xmm0,[ecx*1+edx-16]
|
---|
331 | jnz NEAR L$011dec6_loop
|
---|
332 | db 102,15,56,222,209
|
---|
333 | db 102,15,56,222,217
|
---|
334 | db 102,15,56,222,225
|
---|
335 | db 102,15,56,222,233
|
---|
336 | db 102,15,56,222,241
|
---|
337 | db 102,15,56,222,249
|
---|
338 | db 102,15,56,223,208
|
---|
339 | db 102,15,56,223,216
|
---|
340 | db 102,15,56,223,224
|
---|
341 | db 102,15,56,223,232
|
---|
342 | db 102,15,56,223,240
|
---|
343 | db 102,15,56,223,248
|
---|
344 | ret
|
---|
345 | global _aesni_ecb_encrypt
|
---|
346 | align 16
|
---|
347 | _aesni_ecb_encrypt:
|
---|
348 | L$_aesni_ecb_encrypt_begin:
|
---|
349 | push ebp
|
---|
350 | push ebx
|
---|
351 | push esi
|
---|
352 | push edi
|
---|
353 | mov esi,DWORD [20+esp]
|
---|
354 | mov edi,DWORD [24+esp]
|
---|
355 | mov eax,DWORD [28+esp]
|
---|
356 | mov edx,DWORD [32+esp]
|
---|
357 | mov ebx,DWORD [36+esp]
|
---|
358 | and eax,-16
|
---|
359 | jz NEAR L$012ecb_ret
|
---|
360 | mov ecx,DWORD [240+edx]
|
---|
361 | test ebx,ebx
|
---|
362 | jz NEAR L$013ecb_decrypt
|
---|
363 | mov ebp,edx
|
---|
364 | mov ebx,ecx
|
---|
365 | cmp eax,96
|
---|
366 | jb NEAR L$014ecb_enc_tail
|
---|
367 | movdqu xmm2,[esi]
|
---|
368 | movdqu xmm3,[16+esi]
|
---|
369 | movdqu xmm4,[32+esi]
|
---|
370 | movdqu xmm5,[48+esi]
|
---|
371 | movdqu xmm6,[64+esi]
|
---|
372 | movdqu xmm7,[80+esi]
|
---|
373 | lea esi,[96+esi]
|
---|
374 | sub eax,96
|
---|
375 | jmp NEAR L$015ecb_enc_loop6_enter
|
---|
376 | align 16
|
---|
377 | L$016ecb_enc_loop6:
|
---|
378 | movups [edi],xmm2
|
---|
379 | movdqu xmm2,[esi]
|
---|
380 | movups [16+edi],xmm3
|
---|
381 | movdqu xmm3,[16+esi]
|
---|
382 | movups [32+edi],xmm4
|
---|
383 | movdqu xmm4,[32+esi]
|
---|
384 | movups [48+edi],xmm5
|
---|
385 | movdqu xmm5,[48+esi]
|
---|
386 | movups [64+edi],xmm6
|
---|
387 | movdqu xmm6,[64+esi]
|
---|
388 | movups [80+edi],xmm7
|
---|
389 | lea edi,[96+edi]
|
---|
390 | movdqu xmm7,[80+esi]
|
---|
391 | lea esi,[96+esi]
|
---|
392 | L$015ecb_enc_loop6_enter:
|
---|
393 | call __aesni_encrypt6
|
---|
394 | mov edx,ebp
|
---|
395 | mov ecx,ebx
|
---|
396 | sub eax,96
|
---|
397 | jnc NEAR L$016ecb_enc_loop6
|
---|
398 | movups [edi],xmm2
|
---|
399 | movups [16+edi],xmm3
|
---|
400 | movups [32+edi],xmm4
|
---|
401 | movups [48+edi],xmm5
|
---|
402 | movups [64+edi],xmm6
|
---|
403 | movups [80+edi],xmm7
|
---|
404 | lea edi,[96+edi]
|
---|
405 | add eax,96
|
---|
406 | jz NEAR L$012ecb_ret
|
---|
407 | L$014ecb_enc_tail:
|
---|
408 | movups xmm2,[esi]
|
---|
409 | cmp eax,32
|
---|
410 | jb NEAR L$017ecb_enc_one
|
---|
411 | movups xmm3,[16+esi]
|
---|
412 | je NEAR L$018ecb_enc_two
|
---|
413 | movups xmm4,[32+esi]
|
---|
414 | cmp eax,64
|
---|
415 | jb NEAR L$019ecb_enc_three
|
---|
416 | movups xmm5,[48+esi]
|
---|
417 | je NEAR L$020ecb_enc_four
|
---|
418 | movups xmm6,[64+esi]
|
---|
419 | xorps xmm7,xmm7
|
---|
420 | call __aesni_encrypt6
|
---|
421 | movups [edi],xmm2
|
---|
422 | movups [16+edi],xmm3
|
---|
423 | movups [32+edi],xmm4
|
---|
424 | movups [48+edi],xmm5
|
---|
425 | movups [64+edi],xmm6
|
---|
426 | jmp NEAR L$012ecb_ret
|
---|
427 | align 16
|
---|
428 | L$017ecb_enc_one:
|
---|
429 | movups xmm0,[edx]
|
---|
430 | movups xmm1,[16+edx]
|
---|
431 | lea edx,[32+edx]
|
---|
432 | xorps xmm2,xmm0
|
---|
433 | L$021enc1_loop_3:
|
---|
434 | db 102,15,56,220,209
|
---|
435 | dec ecx
|
---|
436 | movups xmm1,[edx]
|
---|
437 | lea edx,[16+edx]
|
---|
438 | jnz NEAR L$021enc1_loop_3
|
---|
439 | db 102,15,56,221,209
|
---|
440 | movups [edi],xmm2
|
---|
441 | jmp NEAR L$012ecb_ret
|
---|
442 | align 16
|
---|
443 | L$018ecb_enc_two:
|
---|
444 | call __aesni_encrypt2
|
---|
445 | movups [edi],xmm2
|
---|
446 | movups [16+edi],xmm3
|
---|
447 | jmp NEAR L$012ecb_ret
|
---|
448 | align 16
|
---|
449 | L$019ecb_enc_three:
|
---|
450 | call __aesni_encrypt3
|
---|
451 | movups [edi],xmm2
|
---|
452 | movups [16+edi],xmm3
|
---|
453 | movups [32+edi],xmm4
|
---|
454 | jmp NEAR L$012ecb_ret
|
---|
455 | align 16
|
---|
456 | L$020ecb_enc_four:
|
---|
457 | call __aesni_encrypt4
|
---|
458 | movups [edi],xmm2
|
---|
459 | movups [16+edi],xmm3
|
---|
460 | movups [32+edi],xmm4
|
---|
461 | movups [48+edi],xmm5
|
---|
462 | jmp NEAR L$012ecb_ret
|
---|
463 | align 16
|
---|
464 | L$013ecb_decrypt:
|
---|
465 | mov ebp,edx
|
---|
466 | mov ebx,ecx
|
---|
467 | cmp eax,96
|
---|
468 | jb NEAR L$022ecb_dec_tail
|
---|
469 | movdqu xmm2,[esi]
|
---|
470 | movdqu xmm3,[16+esi]
|
---|
471 | movdqu xmm4,[32+esi]
|
---|
472 | movdqu xmm5,[48+esi]
|
---|
473 | movdqu xmm6,[64+esi]
|
---|
474 | movdqu xmm7,[80+esi]
|
---|
475 | lea esi,[96+esi]
|
---|
476 | sub eax,96
|
---|
477 | jmp NEAR L$023ecb_dec_loop6_enter
|
---|
478 | align 16
|
---|
479 | L$024ecb_dec_loop6:
|
---|
480 | movups [edi],xmm2
|
---|
481 | movdqu xmm2,[esi]
|
---|
482 | movups [16+edi],xmm3
|
---|
483 | movdqu xmm3,[16+esi]
|
---|
484 | movups [32+edi],xmm4
|
---|
485 | movdqu xmm4,[32+esi]
|
---|
486 | movups [48+edi],xmm5
|
---|
487 | movdqu xmm5,[48+esi]
|
---|
488 | movups [64+edi],xmm6
|
---|
489 | movdqu xmm6,[64+esi]
|
---|
490 | movups [80+edi],xmm7
|
---|
491 | lea edi,[96+edi]
|
---|
492 | movdqu xmm7,[80+esi]
|
---|
493 | lea esi,[96+esi]
|
---|
494 | L$023ecb_dec_loop6_enter:
|
---|
495 | call __aesni_decrypt6
|
---|
496 | mov edx,ebp
|
---|
497 | mov ecx,ebx
|
---|
498 | sub eax,96
|
---|
499 | jnc NEAR L$024ecb_dec_loop6
|
---|
500 | movups [edi],xmm2
|
---|
501 | movups [16+edi],xmm3
|
---|
502 | movups [32+edi],xmm4
|
---|
503 | movups [48+edi],xmm5
|
---|
504 | movups [64+edi],xmm6
|
---|
505 | movups [80+edi],xmm7
|
---|
506 | lea edi,[96+edi]
|
---|
507 | add eax,96
|
---|
508 | jz NEAR L$012ecb_ret
|
---|
509 | L$022ecb_dec_tail:
|
---|
510 | movups xmm2,[esi]
|
---|
511 | cmp eax,32
|
---|
512 | jb NEAR L$025ecb_dec_one
|
---|
513 | movups xmm3,[16+esi]
|
---|
514 | je NEAR L$026ecb_dec_two
|
---|
515 | movups xmm4,[32+esi]
|
---|
516 | cmp eax,64
|
---|
517 | jb NEAR L$027ecb_dec_three
|
---|
518 | movups xmm5,[48+esi]
|
---|
519 | je NEAR L$028ecb_dec_four
|
---|
520 | movups xmm6,[64+esi]
|
---|
521 | xorps xmm7,xmm7
|
---|
522 | call __aesni_decrypt6
|
---|
523 | movups [edi],xmm2
|
---|
524 | movups [16+edi],xmm3
|
---|
525 | movups [32+edi],xmm4
|
---|
526 | movups [48+edi],xmm5
|
---|
527 | movups [64+edi],xmm6
|
---|
528 | jmp NEAR L$012ecb_ret
|
---|
529 | align 16
|
---|
530 | L$025ecb_dec_one:
|
---|
531 | movups xmm0,[edx]
|
---|
532 | movups xmm1,[16+edx]
|
---|
533 | lea edx,[32+edx]
|
---|
534 | xorps xmm2,xmm0
|
---|
535 | L$029dec1_loop_4:
|
---|
536 | db 102,15,56,222,209
|
---|
537 | dec ecx
|
---|
538 | movups xmm1,[edx]
|
---|
539 | lea edx,[16+edx]
|
---|
540 | jnz NEAR L$029dec1_loop_4
|
---|
541 | db 102,15,56,223,209
|
---|
542 | movups [edi],xmm2
|
---|
543 | jmp NEAR L$012ecb_ret
|
---|
544 | align 16
|
---|
545 | L$026ecb_dec_two:
|
---|
546 | call __aesni_decrypt2
|
---|
547 | movups [edi],xmm2
|
---|
548 | movups [16+edi],xmm3
|
---|
549 | jmp NEAR L$012ecb_ret
|
---|
550 | align 16
|
---|
551 | L$027ecb_dec_three:
|
---|
552 | call __aesni_decrypt3
|
---|
553 | movups [edi],xmm2
|
---|
554 | movups [16+edi],xmm3
|
---|
555 | movups [32+edi],xmm4
|
---|
556 | jmp NEAR L$012ecb_ret
|
---|
557 | align 16
|
---|
558 | L$028ecb_dec_four:
|
---|
559 | call __aesni_decrypt4
|
---|
560 | movups [edi],xmm2
|
---|
561 | movups [16+edi],xmm3
|
---|
562 | movups [32+edi],xmm4
|
---|
563 | movups [48+edi],xmm5
|
---|
564 | L$012ecb_ret:
|
---|
565 | pxor xmm0,xmm0
|
---|
566 | pxor xmm1,xmm1
|
---|
567 | pxor xmm2,xmm2
|
---|
568 | pxor xmm3,xmm3
|
---|
569 | pxor xmm4,xmm4
|
---|
570 | pxor xmm5,xmm5
|
---|
571 | pxor xmm6,xmm6
|
---|
572 | pxor xmm7,xmm7
|
---|
573 | pop edi
|
---|
574 | pop esi
|
---|
575 | pop ebx
|
---|
576 | pop ebp
|
---|
577 | ret
|
---|
578 | global _aesni_ccm64_encrypt_blocks
|
---|
579 | align 16
|
---|
580 | _aesni_ccm64_encrypt_blocks:
|
---|
581 | L$_aesni_ccm64_encrypt_blocks_begin:
|
---|
582 | push ebp
|
---|
583 | push ebx
|
---|
584 | push esi
|
---|
585 | push edi
|
---|
586 | mov esi,DWORD [20+esp]
|
---|
587 | mov edi,DWORD [24+esp]
|
---|
588 | mov eax,DWORD [28+esp]
|
---|
589 | mov edx,DWORD [32+esp]
|
---|
590 | mov ebx,DWORD [36+esp]
|
---|
591 | mov ecx,DWORD [40+esp]
|
---|
592 | mov ebp,esp
|
---|
593 | sub esp,60
|
---|
594 | and esp,-16
|
---|
595 | mov DWORD [48+esp],ebp
|
---|
596 | movdqu xmm7,[ebx]
|
---|
597 | movdqu xmm3,[ecx]
|
---|
598 | mov ecx,DWORD [240+edx]
|
---|
599 | mov DWORD [esp],202182159
|
---|
600 | mov DWORD [4+esp],134810123
|
---|
601 | mov DWORD [8+esp],67438087
|
---|
602 | mov DWORD [12+esp],66051
|
---|
603 | mov ebx,1
|
---|
604 | xor ebp,ebp
|
---|
605 | mov DWORD [16+esp],ebx
|
---|
606 | mov DWORD [20+esp],ebp
|
---|
607 | mov DWORD [24+esp],ebp
|
---|
608 | mov DWORD [28+esp],ebp
|
---|
609 | shl ecx,4
|
---|
610 | mov ebx,16
|
---|
611 | lea ebp,[edx]
|
---|
612 | movdqa xmm5,[esp]
|
---|
613 | movdqa xmm2,xmm7
|
---|
614 | lea edx,[32+ecx*1+edx]
|
---|
615 | sub ebx,ecx
|
---|
616 | db 102,15,56,0,253
|
---|
617 | L$030ccm64_enc_outer:
|
---|
618 | movups xmm0,[ebp]
|
---|
619 | mov ecx,ebx
|
---|
620 | movups xmm6,[esi]
|
---|
621 | xorps xmm2,xmm0
|
---|
622 | movups xmm1,[16+ebp]
|
---|
623 | xorps xmm0,xmm6
|
---|
624 | xorps xmm3,xmm0
|
---|
625 | movups xmm0,[32+ebp]
|
---|
626 | L$031ccm64_enc2_loop:
|
---|
627 | db 102,15,56,220,209
|
---|
628 | db 102,15,56,220,217
|
---|
629 | movups xmm1,[ecx*1+edx]
|
---|
630 | add ecx,32
|
---|
631 | db 102,15,56,220,208
|
---|
632 | db 102,15,56,220,216
|
---|
633 | movups xmm0,[ecx*1+edx-16]
|
---|
634 | jnz NEAR L$031ccm64_enc2_loop
|
---|
635 | db 102,15,56,220,209
|
---|
636 | db 102,15,56,220,217
|
---|
637 | paddq xmm7,[16+esp]
|
---|
638 | dec eax
|
---|
639 | db 102,15,56,221,208
|
---|
640 | db 102,15,56,221,216
|
---|
641 | lea esi,[16+esi]
|
---|
642 | xorps xmm6,xmm2
|
---|
643 | movdqa xmm2,xmm7
|
---|
644 | movups [edi],xmm6
|
---|
645 | db 102,15,56,0,213
|
---|
646 | lea edi,[16+edi]
|
---|
647 | jnz NEAR L$030ccm64_enc_outer
|
---|
648 | mov esp,DWORD [48+esp]
|
---|
649 | mov edi,DWORD [40+esp]
|
---|
650 | movups [edi],xmm3
|
---|
651 | pxor xmm0,xmm0
|
---|
652 | pxor xmm1,xmm1
|
---|
653 | pxor xmm2,xmm2
|
---|
654 | pxor xmm3,xmm3
|
---|
655 | pxor xmm4,xmm4
|
---|
656 | pxor xmm5,xmm5
|
---|
657 | pxor xmm6,xmm6
|
---|
658 | pxor xmm7,xmm7
|
---|
659 | pop edi
|
---|
660 | pop esi
|
---|
661 | pop ebx
|
---|
662 | pop ebp
|
---|
663 | ret
|
---|
664 | global _aesni_ccm64_decrypt_blocks
|
---|
665 | align 16
|
---|
666 | _aesni_ccm64_decrypt_blocks:
|
---|
667 | L$_aesni_ccm64_decrypt_blocks_begin:
|
---|
668 | push ebp
|
---|
669 | push ebx
|
---|
670 | push esi
|
---|
671 | push edi
|
---|
672 | mov esi,DWORD [20+esp]
|
---|
673 | mov edi,DWORD [24+esp]
|
---|
674 | mov eax,DWORD [28+esp]
|
---|
675 | mov edx,DWORD [32+esp]
|
---|
676 | mov ebx,DWORD [36+esp]
|
---|
677 | mov ecx,DWORD [40+esp]
|
---|
678 | mov ebp,esp
|
---|
679 | sub esp,60
|
---|
680 | and esp,-16
|
---|
681 | mov DWORD [48+esp],ebp
|
---|
682 | movdqu xmm7,[ebx]
|
---|
683 | movdqu xmm3,[ecx]
|
---|
684 | mov ecx,DWORD [240+edx]
|
---|
685 | mov DWORD [esp],202182159
|
---|
686 | mov DWORD [4+esp],134810123
|
---|
687 | mov DWORD [8+esp],67438087
|
---|
688 | mov DWORD [12+esp],66051
|
---|
689 | mov ebx,1
|
---|
690 | xor ebp,ebp
|
---|
691 | mov DWORD [16+esp],ebx
|
---|
692 | mov DWORD [20+esp],ebp
|
---|
693 | mov DWORD [24+esp],ebp
|
---|
694 | mov DWORD [28+esp],ebp
|
---|
695 | movdqa xmm5,[esp]
|
---|
696 | movdqa xmm2,xmm7
|
---|
697 | mov ebp,edx
|
---|
698 | mov ebx,ecx
|
---|
699 | db 102,15,56,0,253
|
---|
700 | movups xmm0,[edx]
|
---|
701 | movups xmm1,[16+edx]
|
---|
702 | lea edx,[32+edx]
|
---|
703 | xorps xmm2,xmm0
|
---|
704 | L$032enc1_loop_5:
|
---|
705 | db 102,15,56,220,209
|
---|
706 | dec ecx
|
---|
707 | movups xmm1,[edx]
|
---|
708 | lea edx,[16+edx]
|
---|
709 | jnz NEAR L$032enc1_loop_5
|
---|
710 | db 102,15,56,221,209
|
---|
711 | shl ebx,4
|
---|
712 | mov ecx,16
|
---|
713 | movups xmm6,[esi]
|
---|
714 | paddq xmm7,[16+esp]
|
---|
715 | lea esi,[16+esi]
|
---|
716 | sub ecx,ebx
|
---|
717 | lea edx,[32+ebx*1+ebp]
|
---|
718 | mov ebx,ecx
|
---|
719 | jmp NEAR L$033ccm64_dec_outer
|
---|
720 | align 16
|
---|
721 | L$033ccm64_dec_outer:
|
---|
722 | xorps xmm6,xmm2
|
---|
723 | movdqa xmm2,xmm7
|
---|
724 | movups [edi],xmm6
|
---|
725 | lea edi,[16+edi]
|
---|
726 | db 102,15,56,0,213
|
---|
727 | sub eax,1
|
---|
728 | jz NEAR L$034ccm64_dec_break
|
---|
729 | movups xmm0,[ebp]
|
---|
730 | mov ecx,ebx
|
---|
731 | movups xmm1,[16+ebp]
|
---|
732 | xorps xmm6,xmm0
|
---|
733 | xorps xmm2,xmm0
|
---|
734 | xorps xmm3,xmm6
|
---|
735 | movups xmm0,[32+ebp]
|
---|
736 | L$035ccm64_dec2_loop:
|
---|
737 | db 102,15,56,220,209
|
---|
738 | db 102,15,56,220,217
|
---|
739 | movups xmm1,[ecx*1+edx]
|
---|
740 | add ecx,32
|
---|
741 | db 102,15,56,220,208
|
---|
742 | db 102,15,56,220,216
|
---|
743 | movups xmm0,[ecx*1+edx-16]
|
---|
744 | jnz NEAR L$035ccm64_dec2_loop
|
---|
745 | movups xmm6,[esi]
|
---|
746 | paddq xmm7,[16+esp]
|
---|
747 | db 102,15,56,220,209
|
---|
748 | db 102,15,56,220,217
|
---|
749 | db 102,15,56,221,208
|
---|
750 | db 102,15,56,221,216
|
---|
751 | lea esi,[16+esi]
|
---|
752 | jmp NEAR L$033ccm64_dec_outer
|
---|
753 | align 16
|
---|
754 | L$034ccm64_dec_break:
|
---|
755 | mov ecx,DWORD [240+ebp]
|
---|
756 | mov edx,ebp
|
---|
757 | movups xmm0,[edx]
|
---|
758 | movups xmm1,[16+edx]
|
---|
759 | xorps xmm6,xmm0
|
---|
760 | lea edx,[32+edx]
|
---|
761 | xorps xmm3,xmm6
|
---|
762 | L$036enc1_loop_6:
|
---|
763 | db 102,15,56,220,217
|
---|
764 | dec ecx
|
---|
765 | movups xmm1,[edx]
|
---|
766 | lea edx,[16+edx]
|
---|
767 | jnz NEAR L$036enc1_loop_6
|
---|
768 | db 102,15,56,221,217
|
---|
769 | mov esp,DWORD [48+esp]
|
---|
770 | mov edi,DWORD [40+esp]
|
---|
771 | movups [edi],xmm3
|
---|
772 | pxor xmm0,xmm0
|
---|
773 | pxor xmm1,xmm1
|
---|
774 | pxor xmm2,xmm2
|
---|
775 | pxor xmm3,xmm3
|
---|
776 | pxor xmm4,xmm4
|
---|
777 | pxor xmm5,xmm5
|
---|
778 | pxor xmm6,xmm6
|
---|
779 | pxor xmm7,xmm7
|
---|
780 | pop edi
|
---|
781 | pop esi
|
---|
782 | pop ebx
|
---|
783 | pop ebp
|
---|
784 | ret
|
---|
785 | global _aesni_ctr32_encrypt_blocks
|
---|
786 | align 16
|
---|
787 | _aesni_ctr32_encrypt_blocks:
|
---|
788 | L$_aesni_ctr32_encrypt_blocks_begin:
|
---|
789 | push ebp
|
---|
790 | push ebx
|
---|
791 | push esi
|
---|
792 | push edi
|
---|
793 | mov esi,DWORD [20+esp]
|
---|
794 | mov edi,DWORD [24+esp]
|
---|
795 | mov eax,DWORD [28+esp]
|
---|
796 | mov edx,DWORD [32+esp]
|
---|
797 | mov ebx,DWORD [36+esp]
|
---|
798 | mov ebp,esp
|
---|
799 | sub esp,88
|
---|
800 | and esp,-16
|
---|
801 | mov DWORD [80+esp],ebp
|
---|
802 | cmp eax,1
|
---|
803 | je NEAR L$037ctr32_one_shortcut
|
---|
804 | movdqu xmm7,[ebx]
|
---|
805 | mov DWORD [esp],202182159
|
---|
806 | mov DWORD [4+esp],134810123
|
---|
807 | mov DWORD [8+esp],67438087
|
---|
808 | mov DWORD [12+esp],66051
|
---|
809 | mov ecx,6
|
---|
810 | xor ebp,ebp
|
---|
811 | mov DWORD [16+esp],ecx
|
---|
812 | mov DWORD [20+esp],ecx
|
---|
813 | mov DWORD [24+esp],ecx
|
---|
814 | mov DWORD [28+esp],ebp
|
---|
815 | db 102,15,58,22,251,3
|
---|
816 | db 102,15,58,34,253,3
|
---|
817 | mov ecx,DWORD [240+edx]
|
---|
818 | bswap ebx
|
---|
819 | pxor xmm0,xmm0
|
---|
820 | pxor xmm1,xmm1
|
---|
821 | movdqa xmm2,[esp]
|
---|
822 | db 102,15,58,34,195,0
|
---|
823 | lea ebp,[3+ebx]
|
---|
824 | db 102,15,58,34,205,0
|
---|
825 | inc ebx
|
---|
826 | db 102,15,58,34,195,1
|
---|
827 | inc ebp
|
---|
828 | db 102,15,58,34,205,1
|
---|
829 | inc ebx
|
---|
830 | db 102,15,58,34,195,2
|
---|
831 | inc ebp
|
---|
832 | db 102,15,58,34,205,2
|
---|
833 | movdqa [48+esp],xmm0
|
---|
834 | db 102,15,56,0,194
|
---|
835 | movdqu xmm6,[edx]
|
---|
836 | movdqa [64+esp],xmm1
|
---|
837 | db 102,15,56,0,202
|
---|
838 | pshufd xmm2,xmm0,192
|
---|
839 | pshufd xmm3,xmm0,128
|
---|
840 | cmp eax,6
|
---|
841 | jb NEAR L$038ctr32_tail
|
---|
842 | pxor xmm7,xmm6
|
---|
843 | shl ecx,4
|
---|
844 | mov ebx,16
|
---|
845 | movdqa [32+esp],xmm7
|
---|
846 | mov ebp,edx
|
---|
847 | sub ebx,ecx
|
---|
848 | lea edx,[32+ecx*1+edx]
|
---|
849 | sub eax,6
|
---|
850 | jmp NEAR L$039ctr32_loop6
|
---|
851 | align 16
|
---|
852 | L$039ctr32_loop6:
|
---|
853 | pshufd xmm4,xmm0,64
|
---|
854 | movdqa xmm0,[32+esp]
|
---|
855 | pshufd xmm5,xmm1,192
|
---|
856 | pxor xmm2,xmm0
|
---|
857 | pshufd xmm6,xmm1,128
|
---|
858 | pxor xmm3,xmm0
|
---|
859 | pshufd xmm7,xmm1,64
|
---|
860 | movups xmm1,[16+ebp]
|
---|
861 | pxor xmm4,xmm0
|
---|
862 | pxor xmm5,xmm0
|
---|
863 | db 102,15,56,220,209
|
---|
864 | pxor xmm6,xmm0
|
---|
865 | pxor xmm7,xmm0
|
---|
866 | db 102,15,56,220,217
|
---|
867 | movups xmm0,[32+ebp]
|
---|
868 | mov ecx,ebx
|
---|
869 | db 102,15,56,220,225
|
---|
870 | db 102,15,56,220,233
|
---|
871 | db 102,15,56,220,241
|
---|
872 | db 102,15,56,220,249
|
---|
873 | call L$_aesni_encrypt6_enter
|
---|
874 | movups xmm1,[esi]
|
---|
875 | movups xmm0,[16+esi]
|
---|
876 | xorps xmm2,xmm1
|
---|
877 | movups xmm1,[32+esi]
|
---|
878 | xorps xmm3,xmm0
|
---|
879 | movups [edi],xmm2
|
---|
880 | movdqa xmm0,[16+esp]
|
---|
881 | xorps xmm4,xmm1
|
---|
882 | movdqa xmm1,[64+esp]
|
---|
883 | movups [16+edi],xmm3
|
---|
884 | movups [32+edi],xmm4
|
---|
885 | paddd xmm1,xmm0
|
---|
886 | paddd xmm0,[48+esp]
|
---|
887 | movdqa xmm2,[esp]
|
---|
888 | movups xmm3,[48+esi]
|
---|
889 | movups xmm4,[64+esi]
|
---|
890 | xorps xmm5,xmm3
|
---|
891 | movups xmm3,[80+esi]
|
---|
892 | lea esi,[96+esi]
|
---|
893 | movdqa [48+esp],xmm0
|
---|
894 | db 102,15,56,0,194
|
---|
895 | xorps xmm6,xmm4
|
---|
896 | movups [48+edi],xmm5
|
---|
897 | xorps xmm7,xmm3
|
---|
898 | movdqa [64+esp],xmm1
|
---|
899 | db 102,15,56,0,202
|
---|
900 | movups [64+edi],xmm6
|
---|
901 | pshufd xmm2,xmm0,192
|
---|
902 | movups [80+edi],xmm7
|
---|
903 | lea edi,[96+edi]
|
---|
904 | pshufd xmm3,xmm0,128
|
---|
905 | sub eax,6
|
---|
906 | jnc NEAR L$039ctr32_loop6
|
---|
907 | add eax,6
|
---|
908 | jz NEAR L$040ctr32_ret
|
---|
909 | movdqu xmm7,[ebp]
|
---|
910 | mov edx,ebp
|
---|
911 | pxor xmm7,[32+esp]
|
---|
912 | mov ecx,DWORD [240+ebp]
|
---|
913 | L$038ctr32_tail:
|
---|
914 | por xmm2,xmm7
|
---|
915 | cmp eax,2
|
---|
916 | jb NEAR L$041ctr32_one
|
---|
917 | pshufd xmm4,xmm0,64
|
---|
918 | por xmm3,xmm7
|
---|
919 | je NEAR L$042ctr32_two
|
---|
920 | pshufd xmm5,xmm1,192
|
---|
921 | por xmm4,xmm7
|
---|
922 | cmp eax,4
|
---|
923 | jb NEAR L$043ctr32_three
|
---|
924 | pshufd xmm6,xmm1,128
|
---|
925 | por xmm5,xmm7
|
---|
926 | je NEAR L$044ctr32_four
|
---|
927 | por xmm6,xmm7
|
---|
928 | call __aesni_encrypt6
|
---|
929 | movups xmm1,[esi]
|
---|
930 | movups xmm0,[16+esi]
|
---|
931 | xorps xmm2,xmm1
|
---|
932 | movups xmm1,[32+esi]
|
---|
933 | xorps xmm3,xmm0
|
---|
934 | movups xmm0,[48+esi]
|
---|
935 | xorps xmm4,xmm1
|
---|
936 | movups xmm1,[64+esi]
|
---|
937 | xorps xmm5,xmm0
|
---|
938 | movups [edi],xmm2
|
---|
939 | xorps xmm6,xmm1
|
---|
940 | movups [16+edi],xmm3
|
---|
941 | movups [32+edi],xmm4
|
---|
942 | movups [48+edi],xmm5
|
---|
943 | movups [64+edi],xmm6
|
---|
944 | jmp NEAR L$040ctr32_ret
|
---|
945 | align 16
|
---|
946 | L$037ctr32_one_shortcut:
|
---|
947 | movups xmm2,[ebx]
|
---|
948 | mov ecx,DWORD [240+edx]
|
---|
949 | L$041ctr32_one:
|
---|
950 | movups xmm0,[edx]
|
---|
951 | movups xmm1,[16+edx]
|
---|
952 | lea edx,[32+edx]
|
---|
953 | xorps xmm2,xmm0
|
---|
954 | L$045enc1_loop_7:
|
---|
955 | db 102,15,56,220,209
|
---|
956 | dec ecx
|
---|
957 | movups xmm1,[edx]
|
---|
958 | lea edx,[16+edx]
|
---|
959 | jnz NEAR L$045enc1_loop_7
|
---|
960 | db 102,15,56,221,209
|
---|
961 | movups xmm6,[esi]
|
---|
962 | xorps xmm6,xmm2
|
---|
963 | movups [edi],xmm6
|
---|
964 | jmp NEAR L$040ctr32_ret
|
---|
965 | align 16
|
---|
966 | L$042ctr32_two:
|
---|
967 | call __aesni_encrypt2
|
---|
968 | movups xmm5,[esi]
|
---|
969 | movups xmm6,[16+esi]
|
---|
970 | xorps xmm2,xmm5
|
---|
971 | xorps xmm3,xmm6
|
---|
972 | movups [edi],xmm2
|
---|
973 | movups [16+edi],xmm3
|
---|
974 | jmp NEAR L$040ctr32_ret
|
---|
975 | align 16
|
---|
976 | L$043ctr32_three:
|
---|
977 | call __aesni_encrypt3
|
---|
978 | movups xmm5,[esi]
|
---|
979 | movups xmm6,[16+esi]
|
---|
980 | xorps xmm2,xmm5
|
---|
981 | movups xmm7,[32+esi]
|
---|
982 | xorps xmm3,xmm6
|
---|
983 | movups [edi],xmm2
|
---|
984 | xorps xmm4,xmm7
|
---|
985 | movups [16+edi],xmm3
|
---|
986 | movups [32+edi],xmm4
|
---|
987 | jmp NEAR L$040ctr32_ret
|
---|
988 | align 16
|
---|
989 | L$044ctr32_four:
|
---|
990 | call __aesni_encrypt4
|
---|
991 | movups xmm6,[esi]
|
---|
992 | movups xmm7,[16+esi]
|
---|
993 | movups xmm1,[32+esi]
|
---|
994 | xorps xmm2,xmm6
|
---|
995 | movups xmm0,[48+esi]
|
---|
996 | xorps xmm3,xmm7
|
---|
997 | movups [edi],xmm2
|
---|
998 | xorps xmm4,xmm1
|
---|
999 | movups [16+edi],xmm3
|
---|
1000 | xorps xmm5,xmm0
|
---|
1001 | movups [32+edi],xmm4
|
---|
1002 | movups [48+edi],xmm5
|
---|
1003 | L$040ctr32_ret:
|
---|
1004 | pxor xmm0,xmm0
|
---|
1005 | pxor xmm1,xmm1
|
---|
1006 | pxor xmm2,xmm2
|
---|
1007 | pxor xmm3,xmm3
|
---|
1008 | pxor xmm4,xmm4
|
---|
1009 | movdqa [32+esp],xmm0
|
---|
1010 | pxor xmm5,xmm5
|
---|
1011 | movdqa [48+esp],xmm0
|
---|
1012 | pxor xmm6,xmm6
|
---|
1013 | movdqa [64+esp],xmm0
|
---|
1014 | pxor xmm7,xmm7
|
---|
1015 | mov esp,DWORD [80+esp]
|
---|
1016 | pop edi
|
---|
1017 | pop esi
|
---|
1018 | pop ebx
|
---|
1019 | pop ebp
|
---|
1020 | ret
|
---|
1021 | global _aesni_xts_encrypt
|
---|
1022 | align 16
|
---|
1023 | _aesni_xts_encrypt:
|
---|
1024 | L$_aesni_xts_encrypt_begin:
|
---|
1025 | push ebp
|
---|
1026 | push ebx
|
---|
1027 | push esi
|
---|
1028 | push edi
|
---|
1029 | mov edx,DWORD [36+esp]
|
---|
1030 | mov esi,DWORD [40+esp]
|
---|
1031 | mov ecx,DWORD [240+edx]
|
---|
1032 | movups xmm2,[esi]
|
---|
1033 | movups xmm0,[edx]
|
---|
1034 | movups xmm1,[16+edx]
|
---|
1035 | lea edx,[32+edx]
|
---|
1036 | xorps xmm2,xmm0
|
---|
1037 | L$046enc1_loop_8:
|
---|
1038 | db 102,15,56,220,209
|
---|
1039 | dec ecx
|
---|
1040 | movups xmm1,[edx]
|
---|
1041 | lea edx,[16+edx]
|
---|
1042 | jnz NEAR L$046enc1_loop_8
|
---|
1043 | db 102,15,56,221,209
|
---|
1044 | mov esi,DWORD [20+esp]
|
---|
1045 | mov edi,DWORD [24+esp]
|
---|
1046 | mov eax,DWORD [28+esp]
|
---|
1047 | mov edx,DWORD [32+esp]
|
---|
1048 | mov ebp,esp
|
---|
1049 | sub esp,120
|
---|
1050 | mov ecx,DWORD [240+edx]
|
---|
1051 | and esp,-16
|
---|
1052 | mov DWORD [96+esp],135
|
---|
1053 | mov DWORD [100+esp],0
|
---|
1054 | mov DWORD [104+esp],1
|
---|
1055 | mov DWORD [108+esp],0
|
---|
1056 | mov DWORD [112+esp],eax
|
---|
1057 | mov DWORD [116+esp],ebp
|
---|
1058 | movdqa xmm1,xmm2
|
---|
1059 | pxor xmm0,xmm0
|
---|
1060 | movdqa xmm3,[96+esp]
|
---|
1061 | pcmpgtd xmm0,xmm1
|
---|
1062 | and eax,-16
|
---|
1063 | mov ebp,edx
|
---|
1064 | mov ebx,ecx
|
---|
1065 | sub eax,96
|
---|
1066 | jc NEAR L$047xts_enc_short
|
---|
1067 | shl ecx,4
|
---|
1068 | mov ebx,16
|
---|
1069 | sub ebx,ecx
|
---|
1070 | lea edx,[32+ecx*1+edx]
|
---|
1071 | jmp NEAR L$048xts_enc_loop6
|
---|
1072 | align 16
|
---|
1073 | L$048xts_enc_loop6:
|
---|
1074 | pshufd xmm2,xmm0,19
|
---|
1075 | pxor xmm0,xmm0
|
---|
1076 | movdqa [esp],xmm1
|
---|
1077 | paddq xmm1,xmm1
|
---|
1078 | pand xmm2,xmm3
|
---|
1079 | pcmpgtd xmm0,xmm1
|
---|
1080 | pxor xmm1,xmm2
|
---|
1081 | pshufd xmm2,xmm0,19
|
---|
1082 | pxor xmm0,xmm0
|
---|
1083 | movdqa [16+esp],xmm1
|
---|
1084 | paddq xmm1,xmm1
|
---|
1085 | pand xmm2,xmm3
|
---|
1086 | pcmpgtd xmm0,xmm1
|
---|
1087 | pxor xmm1,xmm2
|
---|
1088 | pshufd xmm2,xmm0,19
|
---|
1089 | pxor xmm0,xmm0
|
---|
1090 | movdqa [32+esp],xmm1
|
---|
1091 | paddq xmm1,xmm1
|
---|
1092 | pand xmm2,xmm3
|
---|
1093 | pcmpgtd xmm0,xmm1
|
---|
1094 | pxor xmm1,xmm2
|
---|
1095 | pshufd xmm2,xmm0,19
|
---|
1096 | pxor xmm0,xmm0
|
---|
1097 | movdqa [48+esp],xmm1
|
---|
1098 | paddq xmm1,xmm1
|
---|
1099 | pand xmm2,xmm3
|
---|
1100 | pcmpgtd xmm0,xmm1
|
---|
1101 | pxor xmm1,xmm2
|
---|
1102 | pshufd xmm7,xmm0,19
|
---|
1103 | movdqa [64+esp],xmm1
|
---|
1104 | paddq xmm1,xmm1
|
---|
1105 | movups xmm0,[ebp]
|
---|
1106 | pand xmm7,xmm3
|
---|
1107 | movups xmm2,[esi]
|
---|
1108 | pxor xmm7,xmm1
|
---|
1109 | mov ecx,ebx
|
---|
1110 | movdqu xmm3,[16+esi]
|
---|
1111 | xorps xmm2,xmm0
|
---|
1112 | movdqu xmm4,[32+esi]
|
---|
1113 | pxor xmm3,xmm0
|
---|
1114 | movdqu xmm5,[48+esi]
|
---|
1115 | pxor xmm4,xmm0
|
---|
1116 | movdqu xmm6,[64+esi]
|
---|
1117 | pxor xmm5,xmm0
|
---|
1118 | movdqu xmm1,[80+esi]
|
---|
1119 | pxor xmm6,xmm0
|
---|
1120 | lea esi,[96+esi]
|
---|
1121 | pxor xmm2,[esp]
|
---|
1122 | movdqa [80+esp],xmm7
|
---|
1123 | pxor xmm7,xmm1
|
---|
1124 | movups xmm1,[16+ebp]
|
---|
1125 | pxor xmm3,[16+esp]
|
---|
1126 | pxor xmm4,[32+esp]
|
---|
1127 | db 102,15,56,220,209
|
---|
1128 | pxor xmm5,[48+esp]
|
---|
1129 | pxor xmm6,[64+esp]
|
---|
1130 | db 102,15,56,220,217
|
---|
1131 | pxor xmm7,xmm0
|
---|
1132 | movups xmm0,[32+ebp]
|
---|
1133 | db 102,15,56,220,225
|
---|
1134 | db 102,15,56,220,233
|
---|
1135 | db 102,15,56,220,241
|
---|
1136 | db 102,15,56,220,249
|
---|
1137 | call L$_aesni_encrypt6_enter
|
---|
1138 | movdqa xmm1,[80+esp]
|
---|
1139 | pxor xmm0,xmm0
|
---|
1140 | xorps xmm2,[esp]
|
---|
1141 | pcmpgtd xmm0,xmm1
|
---|
1142 | xorps xmm3,[16+esp]
|
---|
1143 | movups [edi],xmm2
|
---|
1144 | xorps xmm4,[32+esp]
|
---|
1145 | movups [16+edi],xmm3
|
---|
1146 | xorps xmm5,[48+esp]
|
---|
1147 | movups [32+edi],xmm4
|
---|
1148 | xorps xmm6,[64+esp]
|
---|
1149 | movups [48+edi],xmm5
|
---|
1150 | xorps xmm7,xmm1
|
---|
1151 | movups [64+edi],xmm6
|
---|
1152 | pshufd xmm2,xmm0,19
|
---|
1153 | movups [80+edi],xmm7
|
---|
1154 | lea edi,[96+edi]
|
---|
1155 | movdqa xmm3,[96+esp]
|
---|
1156 | pxor xmm0,xmm0
|
---|
1157 | paddq xmm1,xmm1
|
---|
1158 | pand xmm2,xmm3
|
---|
1159 | pcmpgtd xmm0,xmm1
|
---|
1160 | pxor xmm1,xmm2
|
---|
1161 | sub eax,96
|
---|
1162 | jnc NEAR L$048xts_enc_loop6
|
---|
1163 | mov ecx,DWORD [240+ebp]
|
---|
1164 | mov edx,ebp
|
---|
1165 | mov ebx,ecx
|
---|
1166 | L$047xts_enc_short:
|
---|
1167 | add eax,96
|
---|
1168 | jz NEAR L$049xts_enc_done6x
|
---|
1169 | movdqa xmm5,xmm1
|
---|
1170 | cmp eax,32
|
---|
1171 | jb NEAR L$050xts_enc_one
|
---|
1172 | pshufd xmm2,xmm0,19
|
---|
1173 | pxor xmm0,xmm0
|
---|
1174 | paddq xmm1,xmm1
|
---|
1175 | pand xmm2,xmm3
|
---|
1176 | pcmpgtd xmm0,xmm1
|
---|
1177 | pxor xmm1,xmm2
|
---|
1178 | je NEAR L$051xts_enc_two
|
---|
1179 | pshufd xmm2,xmm0,19
|
---|
1180 | pxor xmm0,xmm0
|
---|
1181 | movdqa xmm6,xmm1
|
---|
1182 | paddq xmm1,xmm1
|
---|
1183 | pand xmm2,xmm3
|
---|
1184 | pcmpgtd xmm0,xmm1
|
---|
1185 | pxor xmm1,xmm2
|
---|
1186 | cmp eax,64
|
---|
1187 | jb NEAR L$052xts_enc_three
|
---|
1188 | pshufd xmm2,xmm0,19
|
---|
1189 | pxor xmm0,xmm0
|
---|
1190 | movdqa xmm7,xmm1
|
---|
1191 | paddq xmm1,xmm1
|
---|
1192 | pand xmm2,xmm3
|
---|
1193 | pcmpgtd xmm0,xmm1
|
---|
1194 | pxor xmm1,xmm2
|
---|
1195 | movdqa [esp],xmm5
|
---|
1196 | movdqa [16+esp],xmm6
|
---|
1197 | je NEAR L$053xts_enc_four
|
---|
1198 | movdqa [32+esp],xmm7
|
---|
1199 | pshufd xmm7,xmm0,19
|
---|
1200 | movdqa [48+esp],xmm1
|
---|
1201 | paddq xmm1,xmm1
|
---|
1202 | pand xmm7,xmm3
|
---|
1203 | pxor xmm7,xmm1
|
---|
1204 | movdqu xmm2,[esi]
|
---|
1205 | movdqu xmm3,[16+esi]
|
---|
1206 | movdqu xmm4,[32+esi]
|
---|
1207 | pxor xmm2,[esp]
|
---|
1208 | movdqu xmm5,[48+esi]
|
---|
1209 | pxor xmm3,[16+esp]
|
---|
1210 | movdqu xmm6,[64+esi]
|
---|
1211 | pxor xmm4,[32+esp]
|
---|
1212 | lea esi,[80+esi]
|
---|
1213 | pxor xmm5,[48+esp]
|
---|
1214 | movdqa [64+esp],xmm7
|
---|
1215 | pxor xmm6,xmm7
|
---|
1216 | call __aesni_encrypt6
|
---|
1217 | movaps xmm1,[64+esp]
|
---|
1218 | xorps xmm2,[esp]
|
---|
1219 | xorps xmm3,[16+esp]
|
---|
1220 | xorps xmm4,[32+esp]
|
---|
1221 | movups [edi],xmm2
|
---|
1222 | xorps xmm5,[48+esp]
|
---|
1223 | movups [16+edi],xmm3
|
---|
1224 | xorps xmm6,xmm1
|
---|
1225 | movups [32+edi],xmm4
|
---|
1226 | movups [48+edi],xmm5
|
---|
1227 | movups [64+edi],xmm6
|
---|
1228 | lea edi,[80+edi]
|
---|
1229 | jmp NEAR L$054xts_enc_done
|
---|
1230 | align 16
|
---|
1231 | L$050xts_enc_one:
|
---|
1232 | movups xmm2,[esi]
|
---|
1233 | lea esi,[16+esi]
|
---|
1234 | xorps xmm2,xmm5
|
---|
1235 | movups xmm0,[edx]
|
---|
1236 | movups xmm1,[16+edx]
|
---|
1237 | lea edx,[32+edx]
|
---|
1238 | xorps xmm2,xmm0
|
---|
1239 | L$055enc1_loop_9:
|
---|
1240 | db 102,15,56,220,209
|
---|
1241 | dec ecx
|
---|
1242 | movups xmm1,[edx]
|
---|
1243 | lea edx,[16+edx]
|
---|
1244 | jnz NEAR L$055enc1_loop_9
|
---|
1245 | db 102,15,56,221,209
|
---|
1246 | xorps xmm2,xmm5
|
---|
1247 | movups [edi],xmm2
|
---|
1248 | lea edi,[16+edi]
|
---|
1249 | movdqa xmm1,xmm5
|
---|
1250 | jmp NEAR L$054xts_enc_done
|
---|
1251 | align 16
|
---|
1252 | L$051xts_enc_two:
|
---|
1253 | movaps xmm6,xmm1
|
---|
1254 | movups xmm2,[esi]
|
---|
1255 | movups xmm3,[16+esi]
|
---|
1256 | lea esi,[32+esi]
|
---|
1257 | xorps xmm2,xmm5
|
---|
1258 | xorps xmm3,xmm6
|
---|
1259 | call __aesni_encrypt2
|
---|
1260 | xorps xmm2,xmm5
|
---|
1261 | xorps xmm3,xmm6
|
---|
1262 | movups [edi],xmm2
|
---|
1263 | movups [16+edi],xmm3
|
---|
1264 | lea edi,[32+edi]
|
---|
1265 | movdqa xmm1,xmm6
|
---|
1266 | jmp NEAR L$054xts_enc_done
|
---|
1267 | align 16
|
---|
1268 | L$052xts_enc_three:
|
---|
1269 | movaps xmm7,xmm1
|
---|
1270 | movups xmm2,[esi]
|
---|
1271 | movups xmm3,[16+esi]
|
---|
1272 | movups xmm4,[32+esi]
|
---|
1273 | lea esi,[48+esi]
|
---|
1274 | xorps xmm2,xmm5
|
---|
1275 | xorps xmm3,xmm6
|
---|
1276 | xorps xmm4,xmm7
|
---|
1277 | call __aesni_encrypt3
|
---|
1278 | xorps xmm2,xmm5
|
---|
1279 | xorps xmm3,xmm6
|
---|
1280 | xorps xmm4,xmm7
|
---|
1281 | movups [edi],xmm2
|
---|
1282 | movups [16+edi],xmm3
|
---|
1283 | movups [32+edi],xmm4
|
---|
1284 | lea edi,[48+edi]
|
---|
1285 | movdqa xmm1,xmm7
|
---|
1286 | jmp NEAR L$054xts_enc_done
|
---|
1287 | align 16
|
---|
1288 | L$053xts_enc_four:
|
---|
1289 | movaps xmm6,xmm1
|
---|
1290 | movups xmm2,[esi]
|
---|
1291 | movups xmm3,[16+esi]
|
---|
1292 | movups xmm4,[32+esi]
|
---|
1293 | xorps xmm2,[esp]
|
---|
1294 | movups xmm5,[48+esi]
|
---|
1295 | lea esi,[64+esi]
|
---|
1296 | xorps xmm3,[16+esp]
|
---|
1297 | xorps xmm4,xmm7
|
---|
1298 | xorps xmm5,xmm6
|
---|
1299 | call __aesni_encrypt4
|
---|
1300 | xorps xmm2,[esp]
|
---|
1301 | xorps xmm3,[16+esp]
|
---|
1302 | xorps xmm4,xmm7
|
---|
1303 | movups [edi],xmm2
|
---|
1304 | xorps xmm5,xmm6
|
---|
1305 | movups [16+edi],xmm3
|
---|
1306 | movups [32+edi],xmm4
|
---|
1307 | movups [48+edi],xmm5
|
---|
1308 | lea edi,[64+edi]
|
---|
1309 | movdqa xmm1,xmm6
|
---|
1310 | jmp NEAR L$054xts_enc_done
|
---|
1311 | align 16
|
---|
1312 | L$049xts_enc_done6x:
|
---|
1313 | mov eax,DWORD [112+esp]
|
---|
1314 | and eax,15
|
---|
1315 | jz NEAR L$056xts_enc_ret
|
---|
1316 | movdqa xmm5,xmm1
|
---|
1317 | mov DWORD [112+esp],eax
|
---|
1318 | jmp NEAR L$057xts_enc_steal
|
---|
1319 | align 16
|
---|
1320 | L$054xts_enc_done:
|
---|
1321 | mov eax,DWORD [112+esp]
|
---|
1322 | pxor xmm0,xmm0
|
---|
1323 | and eax,15
|
---|
1324 | jz NEAR L$056xts_enc_ret
|
---|
1325 | pcmpgtd xmm0,xmm1
|
---|
1326 | mov DWORD [112+esp],eax
|
---|
1327 | pshufd xmm5,xmm0,19
|
---|
1328 | paddq xmm1,xmm1
|
---|
1329 | pand xmm5,[96+esp]
|
---|
1330 | pxor xmm5,xmm1
|
---|
1331 | L$057xts_enc_steal:
|
---|
1332 | movzx ecx,BYTE [esi]
|
---|
1333 | movzx edx,BYTE [edi-16]
|
---|
1334 | lea esi,[1+esi]
|
---|
1335 | mov BYTE [edi-16],cl
|
---|
1336 | mov BYTE [edi],dl
|
---|
1337 | lea edi,[1+edi]
|
---|
1338 | sub eax,1
|
---|
1339 | jnz NEAR L$057xts_enc_steal
|
---|
1340 | sub edi,DWORD [112+esp]
|
---|
1341 | mov edx,ebp
|
---|
1342 | mov ecx,ebx
|
---|
1343 | movups xmm2,[edi-16]
|
---|
1344 | xorps xmm2,xmm5
|
---|
1345 | movups xmm0,[edx]
|
---|
1346 | movups xmm1,[16+edx]
|
---|
1347 | lea edx,[32+edx]
|
---|
1348 | xorps xmm2,xmm0
|
---|
1349 | L$058enc1_loop_10:
|
---|
1350 | db 102,15,56,220,209
|
---|
1351 | dec ecx
|
---|
1352 | movups xmm1,[edx]
|
---|
1353 | lea edx,[16+edx]
|
---|
1354 | jnz NEAR L$058enc1_loop_10
|
---|
1355 | db 102,15,56,221,209
|
---|
1356 | xorps xmm2,xmm5
|
---|
1357 | movups [edi-16],xmm2
|
---|
1358 | L$056xts_enc_ret:
|
---|
1359 | pxor xmm0,xmm0
|
---|
1360 | pxor xmm1,xmm1
|
---|
1361 | pxor xmm2,xmm2
|
---|
1362 | movdqa [esp],xmm0
|
---|
1363 | pxor xmm3,xmm3
|
---|
1364 | movdqa [16+esp],xmm0
|
---|
1365 | pxor xmm4,xmm4
|
---|
1366 | movdqa [32+esp],xmm0
|
---|
1367 | pxor xmm5,xmm5
|
---|
1368 | movdqa [48+esp],xmm0
|
---|
1369 | pxor xmm6,xmm6
|
---|
1370 | movdqa [64+esp],xmm0
|
---|
1371 | pxor xmm7,xmm7
|
---|
1372 | movdqa [80+esp],xmm0
|
---|
1373 | mov esp,DWORD [116+esp]
|
---|
1374 | pop edi
|
---|
1375 | pop esi
|
---|
1376 | pop ebx
|
---|
1377 | pop ebp
|
---|
1378 | ret
|
---|
1379 | global _aesni_xts_decrypt
|
---|
1380 | align 16
|
---|
1381 | _aesni_xts_decrypt:
|
---|
1382 | L$_aesni_xts_decrypt_begin:
|
---|
1383 | push ebp
|
---|
1384 | push ebx
|
---|
1385 | push esi
|
---|
1386 | push edi
|
---|
1387 | mov edx,DWORD [36+esp]
|
---|
1388 | mov esi,DWORD [40+esp]
|
---|
1389 | mov ecx,DWORD [240+edx]
|
---|
1390 | movups xmm2,[esi]
|
---|
1391 | movups xmm0,[edx]
|
---|
1392 | movups xmm1,[16+edx]
|
---|
1393 | lea edx,[32+edx]
|
---|
1394 | xorps xmm2,xmm0
|
---|
1395 | L$059enc1_loop_11:
|
---|
1396 | db 102,15,56,220,209
|
---|
1397 | dec ecx
|
---|
1398 | movups xmm1,[edx]
|
---|
1399 | lea edx,[16+edx]
|
---|
1400 | jnz NEAR L$059enc1_loop_11
|
---|
1401 | db 102,15,56,221,209
|
---|
1402 | mov esi,DWORD [20+esp]
|
---|
1403 | mov edi,DWORD [24+esp]
|
---|
1404 | mov eax,DWORD [28+esp]
|
---|
1405 | mov edx,DWORD [32+esp]
|
---|
1406 | mov ebp,esp
|
---|
1407 | sub esp,120
|
---|
1408 | and esp,-16
|
---|
1409 | xor ebx,ebx
|
---|
1410 | test eax,15
|
---|
1411 | setnz bl
|
---|
1412 | shl ebx,4
|
---|
1413 | sub eax,ebx
|
---|
1414 | mov DWORD [96+esp],135
|
---|
1415 | mov DWORD [100+esp],0
|
---|
1416 | mov DWORD [104+esp],1
|
---|
1417 | mov DWORD [108+esp],0
|
---|
1418 | mov DWORD [112+esp],eax
|
---|
1419 | mov DWORD [116+esp],ebp
|
---|
1420 | mov ecx,DWORD [240+edx]
|
---|
1421 | mov ebp,edx
|
---|
1422 | mov ebx,ecx
|
---|
1423 | movdqa xmm1,xmm2
|
---|
1424 | pxor xmm0,xmm0
|
---|
1425 | movdqa xmm3,[96+esp]
|
---|
1426 | pcmpgtd xmm0,xmm1
|
---|
1427 | and eax,-16
|
---|
1428 | sub eax,96
|
---|
1429 | jc NEAR L$060xts_dec_short
|
---|
1430 | shl ecx,4
|
---|
1431 | mov ebx,16
|
---|
1432 | sub ebx,ecx
|
---|
1433 | lea edx,[32+ecx*1+edx]
|
---|
1434 | jmp NEAR L$061xts_dec_loop6
|
---|
1435 | align 16
|
---|
1436 | L$061xts_dec_loop6:
|
---|
1437 | pshufd xmm2,xmm0,19
|
---|
1438 | pxor xmm0,xmm0
|
---|
1439 | movdqa [esp],xmm1
|
---|
1440 | paddq xmm1,xmm1
|
---|
1441 | pand xmm2,xmm3
|
---|
1442 | pcmpgtd xmm0,xmm1
|
---|
1443 | pxor xmm1,xmm2
|
---|
1444 | pshufd xmm2,xmm0,19
|
---|
1445 | pxor xmm0,xmm0
|
---|
1446 | movdqa [16+esp],xmm1
|
---|
1447 | paddq xmm1,xmm1
|
---|
1448 | pand xmm2,xmm3
|
---|
1449 | pcmpgtd xmm0,xmm1
|
---|
1450 | pxor xmm1,xmm2
|
---|
1451 | pshufd xmm2,xmm0,19
|
---|
1452 | pxor xmm0,xmm0
|
---|
1453 | movdqa [32+esp],xmm1
|
---|
1454 | paddq xmm1,xmm1
|
---|
1455 | pand xmm2,xmm3
|
---|
1456 | pcmpgtd xmm0,xmm1
|
---|
1457 | pxor xmm1,xmm2
|
---|
1458 | pshufd xmm2,xmm0,19
|
---|
1459 | pxor xmm0,xmm0
|
---|
1460 | movdqa [48+esp],xmm1
|
---|
1461 | paddq xmm1,xmm1
|
---|
1462 | pand xmm2,xmm3
|
---|
1463 | pcmpgtd xmm0,xmm1
|
---|
1464 | pxor xmm1,xmm2
|
---|
1465 | pshufd xmm7,xmm0,19
|
---|
1466 | movdqa [64+esp],xmm1
|
---|
1467 | paddq xmm1,xmm1
|
---|
1468 | movups xmm0,[ebp]
|
---|
1469 | pand xmm7,xmm3
|
---|
1470 | movups xmm2,[esi]
|
---|
1471 | pxor xmm7,xmm1
|
---|
1472 | mov ecx,ebx
|
---|
1473 | movdqu xmm3,[16+esi]
|
---|
1474 | xorps xmm2,xmm0
|
---|
1475 | movdqu xmm4,[32+esi]
|
---|
1476 | pxor xmm3,xmm0
|
---|
1477 | movdqu xmm5,[48+esi]
|
---|
1478 | pxor xmm4,xmm0
|
---|
1479 | movdqu xmm6,[64+esi]
|
---|
1480 | pxor xmm5,xmm0
|
---|
1481 | movdqu xmm1,[80+esi]
|
---|
1482 | pxor xmm6,xmm0
|
---|
1483 | lea esi,[96+esi]
|
---|
1484 | pxor xmm2,[esp]
|
---|
1485 | movdqa [80+esp],xmm7
|
---|
1486 | pxor xmm7,xmm1
|
---|
1487 | movups xmm1,[16+ebp]
|
---|
1488 | pxor xmm3,[16+esp]
|
---|
1489 | pxor xmm4,[32+esp]
|
---|
1490 | db 102,15,56,222,209
|
---|
1491 | pxor xmm5,[48+esp]
|
---|
1492 | pxor xmm6,[64+esp]
|
---|
1493 | db 102,15,56,222,217
|
---|
1494 | pxor xmm7,xmm0
|
---|
1495 | movups xmm0,[32+ebp]
|
---|
1496 | db 102,15,56,222,225
|
---|
1497 | db 102,15,56,222,233
|
---|
1498 | db 102,15,56,222,241
|
---|
1499 | db 102,15,56,222,249
|
---|
1500 | call L$_aesni_decrypt6_enter
|
---|
1501 | movdqa xmm1,[80+esp]
|
---|
1502 | pxor xmm0,xmm0
|
---|
1503 | xorps xmm2,[esp]
|
---|
1504 | pcmpgtd xmm0,xmm1
|
---|
1505 | xorps xmm3,[16+esp]
|
---|
1506 | movups [edi],xmm2
|
---|
1507 | xorps xmm4,[32+esp]
|
---|
1508 | movups [16+edi],xmm3
|
---|
1509 | xorps xmm5,[48+esp]
|
---|
1510 | movups [32+edi],xmm4
|
---|
1511 | xorps xmm6,[64+esp]
|
---|
1512 | movups [48+edi],xmm5
|
---|
1513 | xorps xmm7,xmm1
|
---|
1514 | movups [64+edi],xmm6
|
---|
1515 | pshufd xmm2,xmm0,19
|
---|
1516 | movups [80+edi],xmm7
|
---|
1517 | lea edi,[96+edi]
|
---|
1518 | movdqa xmm3,[96+esp]
|
---|
1519 | pxor xmm0,xmm0
|
---|
1520 | paddq xmm1,xmm1
|
---|
1521 | pand xmm2,xmm3
|
---|
1522 | pcmpgtd xmm0,xmm1
|
---|
1523 | pxor xmm1,xmm2
|
---|
1524 | sub eax,96
|
---|
1525 | jnc NEAR L$061xts_dec_loop6
|
---|
1526 | mov ecx,DWORD [240+ebp]
|
---|
1527 | mov edx,ebp
|
---|
1528 | mov ebx,ecx
|
---|
1529 | L$060xts_dec_short:
|
---|
1530 | add eax,96
|
---|
1531 | jz NEAR L$062xts_dec_done6x
|
---|
1532 | movdqa xmm5,xmm1
|
---|
1533 | cmp eax,32
|
---|
1534 | jb NEAR L$063xts_dec_one
|
---|
1535 | pshufd xmm2,xmm0,19
|
---|
1536 | pxor xmm0,xmm0
|
---|
1537 | paddq xmm1,xmm1
|
---|
1538 | pand xmm2,xmm3
|
---|
1539 | pcmpgtd xmm0,xmm1
|
---|
1540 | pxor xmm1,xmm2
|
---|
1541 | je NEAR L$064xts_dec_two
|
---|
1542 | pshufd xmm2,xmm0,19
|
---|
1543 | pxor xmm0,xmm0
|
---|
1544 | movdqa xmm6,xmm1
|
---|
1545 | paddq xmm1,xmm1
|
---|
1546 | pand xmm2,xmm3
|
---|
1547 | pcmpgtd xmm0,xmm1
|
---|
1548 | pxor xmm1,xmm2
|
---|
1549 | cmp eax,64
|
---|
1550 | jb NEAR L$065xts_dec_three
|
---|
1551 | pshufd xmm2,xmm0,19
|
---|
1552 | pxor xmm0,xmm0
|
---|
1553 | movdqa xmm7,xmm1
|
---|
1554 | paddq xmm1,xmm1
|
---|
1555 | pand xmm2,xmm3
|
---|
1556 | pcmpgtd xmm0,xmm1
|
---|
1557 | pxor xmm1,xmm2
|
---|
1558 | movdqa [esp],xmm5
|
---|
1559 | movdqa [16+esp],xmm6
|
---|
1560 | je NEAR L$066xts_dec_four
|
---|
1561 | movdqa [32+esp],xmm7
|
---|
1562 | pshufd xmm7,xmm0,19
|
---|
1563 | movdqa [48+esp],xmm1
|
---|
1564 | paddq xmm1,xmm1
|
---|
1565 | pand xmm7,xmm3
|
---|
1566 | pxor xmm7,xmm1
|
---|
1567 | movdqu xmm2,[esi]
|
---|
1568 | movdqu xmm3,[16+esi]
|
---|
1569 | movdqu xmm4,[32+esi]
|
---|
1570 | pxor xmm2,[esp]
|
---|
1571 | movdqu xmm5,[48+esi]
|
---|
1572 | pxor xmm3,[16+esp]
|
---|
1573 | movdqu xmm6,[64+esi]
|
---|
1574 | pxor xmm4,[32+esp]
|
---|
1575 | lea esi,[80+esi]
|
---|
1576 | pxor xmm5,[48+esp]
|
---|
1577 | movdqa [64+esp],xmm7
|
---|
1578 | pxor xmm6,xmm7
|
---|
1579 | call __aesni_decrypt6
|
---|
1580 | movaps xmm1,[64+esp]
|
---|
1581 | xorps xmm2,[esp]
|
---|
1582 | xorps xmm3,[16+esp]
|
---|
1583 | xorps xmm4,[32+esp]
|
---|
1584 | movups [edi],xmm2
|
---|
1585 | xorps xmm5,[48+esp]
|
---|
1586 | movups [16+edi],xmm3
|
---|
1587 | xorps xmm6,xmm1
|
---|
1588 | movups [32+edi],xmm4
|
---|
1589 | movups [48+edi],xmm5
|
---|
1590 | movups [64+edi],xmm6
|
---|
1591 | lea edi,[80+edi]
|
---|
1592 | jmp NEAR L$067xts_dec_done
|
---|
1593 | align 16
|
---|
1594 | L$063xts_dec_one:
|
---|
1595 | movups xmm2,[esi]
|
---|
1596 | lea esi,[16+esi]
|
---|
1597 | xorps xmm2,xmm5
|
---|
1598 | movups xmm0,[edx]
|
---|
1599 | movups xmm1,[16+edx]
|
---|
1600 | lea edx,[32+edx]
|
---|
1601 | xorps xmm2,xmm0
|
---|
1602 | L$068dec1_loop_12:
|
---|
1603 | db 102,15,56,222,209
|
---|
1604 | dec ecx
|
---|
1605 | movups xmm1,[edx]
|
---|
1606 | lea edx,[16+edx]
|
---|
1607 | jnz NEAR L$068dec1_loop_12
|
---|
1608 | db 102,15,56,223,209
|
---|
1609 | xorps xmm2,xmm5
|
---|
1610 | movups [edi],xmm2
|
---|
1611 | lea edi,[16+edi]
|
---|
1612 | movdqa xmm1,xmm5
|
---|
1613 | jmp NEAR L$067xts_dec_done
|
---|
1614 | align 16
|
---|
1615 | L$064xts_dec_two:
|
---|
1616 | movaps xmm6,xmm1
|
---|
1617 | movups xmm2,[esi]
|
---|
1618 | movups xmm3,[16+esi]
|
---|
1619 | lea esi,[32+esi]
|
---|
1620 | xorps xmm2,xmm5
|
---|
1621 | xorps xmm3,xmm6
|
---|
1622 | call __aesni_decrypt2
|
---|
1623 | xorps xmm2,xmm5
|
---|
1624 | xorps xmm3,xmm6
|
---|
1625 | movups [edi],xmm2
|
---|
1626 | movups [16+edi],xmm3
|
---|
1627 | lea edi,[32+edi]
|
---|
1628 | movdqa xmm1,xmm6
|
---|
1629 | jmp NEAR L$067xts_dec_done
|
---|
1630 | align 16
|
---|
1631 | L$065xts_dec_three:
|
---|
1632 | movaps xmm7,xmm1
|
---|
1633 | movups xmm2,[esi]
|
---|
1634 | movups xmm3,[16+esi]
|
---|
1635 | movups xmm4,[32+esi]
|
---|
1636 | lea esi,[48+esi]
|
---|
1637 | xorps xmm2,xmm5
|
---|
1638 | xorps xmm3,xmm6
|
---|
1639 | xorps xmm4,xmm7
|
---|
1640 | call __aesni_decrypt3
|
---|
1641 | xorps xmm2,xmm5
|
---|
1642 | xorps xmm3,xmm6
|
---|
1643 | xorps xmm4,xmm7
|
---|
1644 | movups [edi],xmm2
|
---|
1645 | movups [16+edi],xmm3
|
---|
1646 | movups [32+edi],xmm4
|
---|
1647 | lea edi,[48+edi]
|
---|
1648 | movdqa xmm1,xmm7
|
---|
1649 | jmp NEAR L$067xts_dec_done
|
---|
1650 | align 16
|
---|
1651 | L$066xts_dec_four:
|
---|
1652 | movaps xmm6,xmm1
|
---|
1653 | movups xmm2,[esi]
|
---|
1654 | movups xmm3,[16+esi]
|
---|
1655 | movups xmm4,[32+esi]
|
---|
1656 | xorps xmm2,[esp]
|
---|
1657 | movups xmm5,[48+esi]
|
---|
1658 | lea esi,[64+esi]
|
---|
1659 | xorps xmm3,[16+esp]
|
---|
1660 | xorps xmm4,xmm7
|
---|
1661 | xorps xmm5,xmm6
|
---|
1662 | call __aesni_decrypt4
|
---|
1663 | xorps xmm2,[esp]
|
---|
1664 | xorps xmm3,[16+esp]
|
---|
1665 | xorps xmm4,xmm7
|
---|
1666 | movups [edi],xmm2
|
---|
1667 | xorps xmm5,xmm6
|
---|
1668 | movups [16+edi],xmm3
|
---|
1669 | movups [32+edi],xmm4
|
---|
1670 | movups [48+edi],xmm5
|
---|
1671 | lea edi,[64+edi]
|
---|
1672 | movdqa xmm1,xmm6
|
---|
1673 | jmp NEAR L$067xts_dec_done
|
---|
1674 | align 16
|
---|
1675 | L$062xts_dec_done6x:
|
---|
1676 | mov eax,DWORD [112+esp]
|
---|
1677 | and eax,15
|
---|
1678 | jz NEAR L$069xts_dec_ret
|
---|
1679 | mov DWORD [112+esp],eax
|
---|
1680 | jmp NEAR L$070xts_dec_only_one_more
|
---|
1681 | align 16
|
---|
1682 | L$067xts_dec_done:
|
---|
1683 | mov eax,DWORD [112+esp]
|
---|
1684 | pxor xmm0,xmm0
|
---|
1685 | and eax,15
|
---|
1686 | jz NEAR L$069xts_dec_ret
|
---|
1687 | pcmpgtd xmm0,xmm1
|
---|
1688 | mov DWORD [112+esp],eax
|
---|
1689 | pshufd xmm2,xmm0,19
|
---|
1690 | pxor xmm0,xmm0
|
---|
1691 | movdqa xmm3,[96+esp]
|
---|
1692 | paddq xmm1,xmm1
|
---|
1693 | pand xmm2,xmm3
|
---|
1694 | pcmpgtd xmm0,xmm1
|
---|
1695 | pxor xmm1,xmm2
|
---|
1696 | L$070xts_dec_only_one_more:
|
---|
1697 | pshufd xmm5,xmm0,19
|
---|
1698 | movdqa xmm6,xmm1
|
---|
1699 | paddq xmm1,xmm1
|
---|
1700 | pand xmm5,xmm3
|
---|
1701 | pxor xmm5,xmm1
|
---|
1702 | mov edx,ebp
|
---|
1703 | mov ecx,ebx
|
---|
1704 | movups xmm2,[esi]
|
---|
1705 | xorps xmm2,xmm5
|
---|
1706 | movups xmm0,[edx]
|
---|
1707 | movups xmm1,[16+edx]
|
---|
1708 | lea edx,[32+edx]
|
---|
1709 | xorps xmm2,xmm0
|
---|
1710 | L$071dec1_loop_13:
|
---|
1711 | db 102,15,56,222,209
|
---|
1712 | dec ecx
|
---|
1713 | movups xmm1,[edx]
|
---|
1714 | lea edx,[16+edx]
|
---|
1715 | jnz NEAR L$071dec1_loop_13
|
---|
1716 | db 102,15,56,223,209
|
---|
1717 | xorps xmm2,xmm5
|
---|
1718 | movups [edi],xmm2
|
---|
1719 | L$072xts_dec_steal:
|
---|
1720 | movzx ecx,BYTE [16+esi]
|
---|
1721 | movzx edx,BYTE [edi]
|
---|
1722 | lea esi,[1+esi]
|
---|
1723 | mov BYTE [edi],cl
|
---|
1724 | mov BYTE [16+edi],dl
|
---|
1725 | lea edi,[1+edi]
|
---|
1726 | sub eax,1
|
---|
1727 | jnz NEAR L$072xts_dec_steal
|
---|
1728 | sub edi,DWORD [112+esp]
|
---|
1729 | mov edx,ebp
|
---|
1730 | mov ecx,ebx
|
---|
1731 | movups xmm2,[edi]
|
---|
1732 | xorps xmm2,xmm6
|
---|
1733 | movups xmm0,[edx]
|
---|
1734 | movups xmm1,[16+edx]
|
---|
1735 | lea edx,[32+edx]
|
---|
1736 | xorps xmm2,xmm0
|
---|
1737 | L$073dec1_loop_14:
|
---|
1738 | db 102,15,56,222,209
|
---|
1739 | dec ecx
|
---|
1740 | movups xmm1,[edx]
|
---|
1741 | lea edx,[16+edx]
|
---|
1742 | jnz NEAR L$073dec1_loop_14
|
---|
1743 | db 102,15,56,223,209
|
---|
1744 | xorps xmm2,xmm6
|
---|
1745 | movups [edi],xmm2
|
---|
1746 | L$069xts_dec_ret:
|
---|
1747 | pxor xmm0,xmm0
|
---|
1748 | pxor xmm1,xmm1
|
---|
1749 | pxor xmm2,xmm2
|
---|
1750 | movdqa [esp],xmm0
|
---|
1751 | pxor xmm3,xmm3
|
---|
1752 | movdqa [16+esp],xmm0
|
---|
1753 | pxor xmm4,xmm4
|
---|
1754 | movdqa [32+esp],xmm0
|
---|
1755 | pxor xmm5,xmm5
|
---|
1756 | movdqa [48+esp],xmm0
|
---|
1757 | pxor xmm6,xmm6
|
---|
1758 | movdqa [64+esp],xmm0
|
---|
1759 | pxor xmm7,xmm7
|
---|
1760 | movdqa [80+esp],xmm0
|
---|
1761 | mov esp,DWORD [116+esp]
|
---|
1762 | pop edi
|
---|
1763 | pop esi
|
---|
1764 | pop ebx
|
---|
1765 | pop ebp
|
---|
1766 | ret
|
---|
1767 | global _aesni_ocb_encrypt
|
---|
1768 | align 16
|
---|
1769 | _aesni_ocb_encrypt:
|
---|
1770 | L$_aesni_ocb_encrypt_begin:
|
---|
1771 | push ebp
|
---|
1772 | push ebx
|
---|
1773 | push esi
|
---|
1774 | push edi
|
---|
1775 | mov ecx,DWORD [40+esp]
|
---|
1776 | mov ebx,DWORD [48+esp]
|
---|
1777 | mov esi,DWORD [20+esp]
|
---|
1778 | mov edi,DWORD [24+esp]
|
---|
1779 | mov eax,DWORD [28+esp]
|
---|
1780 | mov edx,DWORD [32+esp]
|
---|
1781 | movdqu xmm0,[ecx]
|
---|
1782 | mov ebp,DWORD [36+esp]
|
---|
1783 | movdqu xmm1,[ebx]
|
---|
1784 | mov ebx,DWORD [44+esp]
|
---|
1785 | mov ecx,esp
|
---|
1786 | sub esp,132
|
---|
1787 | and esp,-16
|
---|
1788 | sub edi,esi
|
---|
1789 | shl eax,4
|
---|
1790 | lea eax,[eax*1+esi-96]
|
---|
1791 | mov DWORD [120+esp],edi
|
---|
1792 | mov DWORD [124+esp],eax
|
---|
1793 | mov DWORD [128+esp],ecx
|
---|
1794 | mov ecx,DWORD [240+edx]
|
---|
1795 | test ebp,1
|
---|
1796 | jnz NEAR L$074odd
|
---|
1797 | bsf eax,ebp
|
---|
1798 | add ebp,1
|
---|
1799 | shl eax,4
|
---|
1800 | movdqu xmm7,[eax*1+ebx]
|
---|
1801 | mov eax,edx
|
---|
1802 | movdqu xmm2,[esi]
|
---|
1803 | lea esi,[16+esi]
|
---|
1804 | pxor xmm7,xmm0
|
---|
1805 | pxor xmm1,xmm2
|
---|
1806 | pxor xmm2,xmm7
|
---|
1807 | movdqa xmm6,xmm1
|
---|
1808 | movups xmm0,[edx]
|
---|
1809 | movups xmm1,[16+edx]
|
---|
1810 | lea edx,[32+edx]
|
---|
1811 | xorps xmm2,xmm0
|
---|
1812 | L$075enc1_loop_15:
|
---|
1813 | db 102,15,56,220,209
|
---|
1814 | dec ecx
|
---|
1815 | movups xmm1,[edx]
|
---|
1816 | lea edx,[16+edx]
|
---|
1817 | jnz NEAR L$075enc1_loop_15
|
---|
1818 | db 102,15,56,221,209
|
---|
1819 | xorps xmm2,xmm7
|
---|
1820 | movdqa xmm0,xmm7
|
---|
1821 | movdqa xmm1,xmm6
|
---|
1822 | movups [esi*1+edi-16],xmm2
|
---|
1823 | mov ecx,DWORD [240+eax]
|
---|
1824 | mov edx,eax
|
---|
1825 | mov eax,DWORD [124+esp]
|
---|
1826 | L$074odd:
|
---|
1827 | shl ecx,4
|
---|
1828 | mov edi,16
|
---|
1829 | sub edi,ecx
|
---|
1830 | mov DWORD [112+esp],edx
|
---|
1831 | lea edx,[32+ecx*1+edx]
|
---|
1832 | mov DWORD [116+esp],edi
|
---|
1833 | cmp esi,eax
|
---|
1834 | ja NEAR L$076short
|
---|
1835 | jmp NEAR L$077grandloop
|
---|
1836 | align 32
|
---|
1837 | L$077grandloop:
|
---|
1838 | lea ecx,[1+ebp]
|
---|
1839 | lea eax,[3+ebp]
|
---|
1840 | lea edi,[5+ebp]
|
---|
1841 | add ebp,6
|
---|
1842 | bsf ecx,ecx
|
---|
1843 | bsf eax,eax
|
---|
1844 | bsf edi,edi
|
---|
1845 | shl ecx,4
|
---|
1846 | shl eax,4
|
---|
1847 | shl edi,4
|
---|
1848 | movdqu xmm2,[ebx]
|
---|
1849 | movdqu xmm3,[ecx*1+ebx]
|
---|
1850 | mov ecx,DWORD [116+esp]
|
---|
1851 | movdqa xmm4,xmm2
|
---|
1852 | movdqu xmm5,[eax*1+ebx]
|
---|
1853 | movdqa xmm6,xmm2
|
---|
1854 | movdqu xmm7,[edi*1+ebx]
|
---|
1855 | pxor xmm2,xmm0
|
---|
1856 | pxor xmm3,xmm2
|
---|
1857 | movdqa [esp],xmm2
|
---|
1858 | pxor xmm4,xmm3
|
---|
1859 | movdqa [16+esp],xmm3
|
---|
1860 | pxor xmm5,xmm4
|
---|
1861 | movdqa [32+esp],xmm4
|
---|
1862 | pxor xmm6,xmm5
|
---|
1863 | movdqa [48+esp],xmm5
|
---|
1864 | pxor xmm7,xmm6
|
---|
1865 | movdqa [64+esp],xmm6
|
---|
1866 | movdqa [80+esp],xmm7
|
---|
1867 | movups xmm0,[ecx*1+edx-48]
|
---|
1868 | movdqu xmm2,[esi]
|
---|
1869 | movdqu xmm3,[16+esi]
|
---|
1870 | movdqu xmm4,[32+esi]
|
---|
1871 | movdqu xmm5,[48+esi]
|
---|
1872 | movdqu xmm6,[64+esi]
|
---|
1873 | movdqu xmm7,[80+esi]
|
---|
1874 | lea esi,[96+esi]
|
---|
1875 | pxor xmm1,xmm2
|
---|
1876 | pxor xmm2,xmm0
|
---|
1877 | pxor xmm1,xmm3
|
---|
1878 | pxor xmm3,xmm0
|
---|
1879 | pxor xmm1,xmm4
|
---|
1880 | pxor xmm4,xmm0
|
---|
1881 | pxor xmm1,xmm5
|
---|
1882 | pxor xmm5,xmm0
|
---|
1883 | pxor xmm1,xmm6
|
---|
1884 | pxor xmm6,xmm0
|
---|
1885 | pxor xmm1,xmm7
|
---|
1886 | pxor xmm7,xmm0
|
---|
1887 | movdqa [96+esp],xmm1
|
---|
1888 | movups xmm1,[ecx*1+edx-32]
|
---|
1889 | pxor xmm2,[esp]
|
---|
1890 | pxor xmm3,[16+esp]
|
---|
1891 | pxor xmm4,[32+esp]
|
---|
1892 | pxor xmm5,[48+esp]
|
---|
1893 | pxor xmm6,[64+esp]
|
---|
1894 | pxor xmm7,[80+esp]
|
---|
1895 | movups xmm0,[ecx*1+edx-16]
|
---|
1896 | db 102,15,56,220,209
|
---|
1897 | db 102,15,56,220,217
|
---|
1898 | db 102,15,56,220,225
|
---|
1899 | db 102,15,56,220,233
|
---|
1900 | db 102,15,56,220,241
|
---|
1901 | db 102,15,56,220,249
|
---|
1902 | mov edi,DWORD [120+esp]
|
---|
1903 | mov eax,DWORD [124+esp]
|
---|
1904 | call L$_aesni_encrypt6_enter
|
---|
1905 | movdqa xmm0,[80+esp]
|
---|
1906 | pxor xmm2,[esp]
|
---|
1907 | pxor xmm3,[16+esp]
|
---|
1908 | pxor xmm4,[32+esp]
|
---|
1909 | pxor xmm5,[48+esp]
|
---|
1910 | pxor xmm6,[64+esp]
|
---|
1911 | pxor xmm7,xmm0
|
---|
1912 | movdqa xmm1,[96+esp]
|
---|
1913 | movdqu [esi*1+edi-96],xmm2
|
---|
1914 | movdqu [esi*1+edi-80],xmm3
|
---|
1915 | movdqu [esi*1+edi-64],xmm4
|
---|
1916 | movdqu [esi*1+edi-48],xmm5
|
---|
1917 | movdqu [esi*1+edi-32],xmm6
|
---|
1918 | movdqu [esi*1+edi-16],xmm7
|
---|
1919 | cmp esi,eax
|
---|
1920 | jb NEAR L$077grandloop
|
---|
1921 | L$076short:
|
---|
1922 | add eax,96
|
---|
1923 | sub eax,esi
|
---|
1924 | jz NEAR L$078done
|
---|
1925 | cmp eax,32
|
---|
1926 | jb NEAR L$079one
|
---|
1927 | je NEAR L$080two
|
---|
1928 | cmp eax,64
|
---|
1929 | jb NEAR L$081three
|
---|
1930 | je NEAR L$082four
|
---|
1931 | lea ecx,[1+ebp]
|
---|
1932 | lea eax,[3+ebp]
|
---|
1933 | bsf ecx,ecx
|
---|
1934 | bsf eax,eax
|
---|
1935 | shl ecx,4
|
---|
1936 | shl eax,4
|
---|
1937 | movdqu xmm2,[ebx]
|
---|
1938 | movdqu xmm3,[ecx*1+ebx]
|
---|
1939 | mov ecx,DWORD [116+esp]
|
---|
1940 | movdqa xmm4,xmm2
|
---|
1941 | movdqu xmm5,[eax*1+ebx]
|
---|
1942 | movdqa xmm6,xmm2
|
---|
1943 | pxor xmm2,xmm0
|
---|
1944 | pxor xmm3,xmm2
|
---|
1945 | movdqa [esp],xmm2
|
---|
1946 | pxor xmm4,xmm3
|
---|
1947 | movdqa [16+esp],xmm3
|
---|
1948 | pxor xmm5,xmm4
|
---|
1949 | movdqa [32+esp],xmm4
|
---|
1950 | pxor xmm6,xmm5
|
---|
1951 | movdqa [48+esp],xmm5
|
---|
1952 | pxor xmm7,xmm6
|
---|
1953 | movdqa [64+esp],xmm6
|
---|
1954 | movups xmm0,[ecx*1+edx-48]
|
---|
1955 | movdqu xmm2,[esi]
|
---|
1956 | movdqu xmm3,[16+esi]
|
---|
1957 | movdqu xmm4,[32+esi]
|
---|
1958 | movdqu xmm5,[48+esi]
|
---|
1959 | movdqu xmm6,[64+esi]
|
---|
1960 | pxor xmm7,xmm7
|
---|
1961 | pxor xmm1,xmm2
|
---|
1962 | pxor xmm2,xmm0
|
---|
1963 | pxor xmm1,xmm3
|
---|
1964 | pxor xmm3,xmm0
|
---|
1965 | pxor xmm1,xmm4
|
---|
1966 | pxor xmm4,xmm0
|
---|
1967 | pxor xmm1,xmm5
|
---|
1968 | pxor xmm5,xmm0
|
---|
1969 | pxor xmm1,xmm6
|
---|
1970 | pxor xmm6,xmm0
|
---|
1971 | movdqa [96+esp],xmm1
|
---|
1972 | movups xmm1,[ecx*1+edx-32]
|
---|
1973 | pxor xmm2,[esp]
|
---|
1974 | pxor xmm3,[16+esp]
|
---|
1975 | pxor xmm4,[32+esp]
|
---|
1976 | pxor xmm5,[48+esp]
|
---|
1977 | pxor xmm6,[64+esp]
|
---|
1978 | movups xmm0,[ecx*1+edx-16]
|
---|
1979 | db 102,15,56,220,209
|
---|
1980 | db 102,15,56,220,217
|
---|
1981 | db 102,15,56,220,225
|
---|
1982 | db 102,15,56,220,233
|
---|
1983 | db 102,15,56,220,241
|
---|
1984 | db 102,15,56,220,249
|
---|
1985 | mov edi,DWORD [120+esp]
|
---|
1986 | call L$_aesni_encrypt6_enter
|
---|
1987 | movdqa xmm0,[64+esp]
|
---|
1988 | pxor xmm2,[esp]
|
---|
1989 | pxor xmm3,[16+esp]
|
---|
1990 | pxor xmm4,[32+esp]
|
---|
1991 | pxor xmm5,[48+esp]
|
---|
1992 | pxor xmm6,xmm0
|
---|
1993 | movdqa xmm1,[96+esp]
|
---|
1994 | movdqu [esi*1+edi],xmm2
|
---|
1995 | movdqu [16+esi*1+edi],xmm3
|
---|
1996 | movdqu [32+esi*1+edi],xmm4
|
---|
1997 | movdqu [48+esi*1+edi],xmm5
|
---|
1998 | movdqu [64+esi*1+edi],xmm6
|
---|
1999 | jmp NEAR L$078done
|
---|
2000 | align 16
|
---|
2001 | L$079one:
|
---|
2002 | movdqu xmm7,[ebx]
|
---|
2003 | mov edx,DWORD [112+esp]
|
---|
2004 | movdqu xmm2,[esi]
|
---|
2005 | mov ecx,DWORD [240+edx]
|
---|
2006 | pxor xmm7,xmm0
|
---|
2007 | pxor xmm1,xmm2
|
---|
2008 | pxor xmm2,xmm7
|
---|
2009 | movdqa xmm6,xmm1
|
---|
2010 | mov edi,DWORD [120+esp]
|
---|
2011 | movups xmm0,[edx]
|
---|
2012 | movups xmm1,[16+edx]
|
---|
2013 | lea edx,[32+edx]
|
---|
2014 | xorps xmm2,xmm0
|
---|
2015 | L$083enc1_loop_16:
|
---|
2016 | db 102,15,56,220,209
|
---|
2017 | dec ecx
|
---|
2018 | movups xmm1,[edx]
|
---|
2019 | lea edx,[16+edx]
|
---|
2020 | jnz NEAR L$083enc1_loop_16
|
---|
2021 | db 102,15,56,221,209
|
---|
2022 | xorps xmm2,xmm7
|
---|
2023 | movdqa xmm0,xmm7
|
---|
2024 | movdqa xmm1,xmm6
|
---|
2025 | movups [esi*1+edi],xmm2
|
---|
2026 | jmp NEAR L$078done
|
---|
2027 | align 16
|
---|
2028 | L$080two:
|
---|
2029 | lea ecx,[1+ebp]
|
---|
2030 | mov edx,DWORD [112+esp]
|
---|
2031 | bsf ecx,ecx
|
---|
2032 | shl ecx,4
|
---|
2033 | movdqu xmm6,[ebx]
|
---|
2034 | movdqu xmm7,[ecx*1+ebx]
|
---|
2035 | movdqu xmm2,[esi]
|
---|
2036 | movdqu xmm3,[16+esi]
|
---|
2037 | mov ecx,DWORD [240+edx]
|
---|
2038 | pxor xmm6,xmm0
|
---|
2039 | pxor xmm7,xmm6
|
---|
2040 | pxor xmm1,xmm2
|
---|
2041 | pxor xmm2,xmm6
|
---|
2042 | pxor xmm1,xmm3
|
---|
2043 | pxor xmm3,xmm7
|
---|
2044 | movdqa xmm5,xmm1
|
---|
2045 | mov edi,DWORD [120+esp]
|
---|
2046 | call __aesni_encrypt2
|
---|
2047 | xorps xmm2,xmm6
|
---|
2048 | xorps xmm3,xmm7
|
---|
2049 | movdqa xmm0,xmm7
|
---|
2050 | movdqa xmm1,xmm5
|
---|
2051 | movups [esi*1+edi],xmm2
|
---|
2052 | movups [16+esi*1+edi],xmm3
|
---|
2053 | jmp NEAR L$078done
|
---|
2054 | align 16
|
---|
2055 | L$081three:
|
---|
2056 | lea ecx,[1+ebp]
|
---|
2057 | mov edx,DWORD [112+esp]
|
---|
2058 | bsf ecx,ecx
|
---|
2059 | shl ecx,4
|
---|
2060 | movdqu xmm5,[ebx]
|
---|
2061 | movdqu xmm6,[ecx*1+ebx]
|
---|
2062 | movdqa xmm7,xmm5
|
---|
2063 | movdqu xmm2,[esi]
|
---|
2064 | movdqu xmm3,[16+esi]
|
---|
2065 | movdqu xmm4,[32+esi]
|
---|
2066 | mov ecx,DWORD [240+edx]
|
---|
2067 | pxor xmm5,xmm0
|
---|
2068 | pxor xmm6,xmm5
|
---|
2069 | pxor xmm7,xmm6
|
---|
2070 | pxor xmm1,xmm2
|
---|
2071 | pxor xmm2,xmm5
|
---|
2072 | pxor xmm1,xmm3
|
---|
2073 | pxor xmm3,xmm6
|
---|
2074 | pxor xmm1,xmm4
|
---|
2075 | pxor xmm4,xmm7
|
---|
2076 | movdqa [96+esp],xmm1
|
---|
2077 | mov edi,DWORD [120+esp]
|
---|
2078 | call __aesni_encrypt3
|
---|
2079 | xorps xmm2,xmm5
|
---|
2080 | xorps xmm3,xmm6
|
---|
2081 | xorps xmm4,xmm7
|
---|
2082 | movdqa xmm0,xmm7
|
---|
2083 | movdqa xmm1,[96+esp]
|
---|
2084 | movups [esi*1+edi],xmm2
|
---|
2085 | movups [16+esi*1+edi],xmm3
|
---|
2086 | movups [32+esi*1+edi],xmm4
|
---|
2087 | jmp NEAR L$078done
|
---|
2088 | align 16
|
---|
2089 | L$082four:
|
---|
2090 | lea ecx,[1+ebp]
|
---|
2091 | lea eax,[3+ebp]
|
---|
2092 | bsf ecx,ecx
|
---|
2093 | bsf eax,eax
|
---|
2094 | mov edx,DWORD [112+esp]
|
---|
2095 | shl ecx,4
|
---|
2096 | shl eax,4
|
---|
2097 | movdqu xmm4,[ebx]
|
---|
2098 | movdqu xmm5,[ecx*1+ebx]
|
---|
2099 | movdqa xmm6,xmm4
|
---|
2100 | movdqu xmm7,[eax*1+ebx]
|
---|
2101 | pxor xmm4,xmm0
|
---|
2102 | movdqu xmm2,[esi]
|
---|
2103 | pxor xmm5,xmm4
|
---|
2104 | movdqu xmm3,[16+esi]
|
---|
2105 | pxor xmm6,xmm5
|
---|
2106 | movdqa [esp],xmm4
|
---|
2107 | pxor xmm7,xmm6
|
---|
2108 | movdqa [16+esp],xmm5
|
---|
2109 | movdqu xmm4,[32+esi]
|
---|
2110 | movdqu xmm5,[48+esi]
|
---|
2111 | mov ecx,DWORD [240+edx]
|
---|
2112 | pxor xmm1,xmm2
|
---|
2113 | pxor xmm2,[esp]
|
---|
2114 | pxor xmm1,xmm3
|
---|
2115 | pxor xmm3,[16+esp]
|
---|
2116 | pxor xmm1,xmm4
|
---|
2117 | pxor xmm4,xmm6
|
---|
2118 | pxor xmm1,xmm5
|
---|
2119 | pxor xmm5,xmm7
|
---|
2120 | movdqa [96+esp],xmm1
|
---|
2121 | mov edi,DWORD [120+esp]
|
---|
2122 | call __aesni_encrypt4
|
---|
2123 | xorps xmm2,[esp]
|
---|
2124 | xorps xmm3,[16+esp]
|
---|
2125 | xorps xmm4,xmm6
|
---|
2126 | movups [esi*1+edi],xmm2
|
---|
2127 | xorps xmm5,xmm7
|
---|
2128 | movups [16+esi*1+edi],xmm3
|
---|
2129 | movdqa xmm0,xmm7
|
---|
2130 | movups [32+esi*1+edi],xmm4
|
---|
2131 | movdqa xmm1,[96+esp]
|
---|
2132 | movups [48+esi*1+edi],xmm5
|
---|
2133 | L$078done:
|
---|
2134 | mov edx,DWORD [128+esp]
|
---|
2135 | pxor xmm2,xmm2
|
---|
2136 | pxor xmm3,xmm3
|
---|
2137 | movdqa [esp],xmm2
|
---|
2138 | pxor xmm4,xmm4
|
---|
2139 | movdqa [16+esp],xmm2
|
---|
2140 | pxor xmm5,xmm5
|
---|
2141 | movdqa [32+esp],xmm2
|
---|
2142 | pxor xmm6,xmm6
|
---|
2143 | movdqa [48+esp],xmm2
|
---|
2144 | pxor xmm7,xmm7
|
---|
2145 | movdqa [64+esp],xmm2
|
---|
2146 | movdqa [80+esp],xmm2
|
---|
2147 | movdqa [96+esp],xmm2
|
---|
2148 | lea esp,[edx]
|
---|
2149 | mov ecx,DWORD [40+esp]
|
---|
2150 | mov ebx,DWORD [48+esp]
|
---|
2151 | movdqu [ecx],xmm0
|
---|
2152 | pxor xmm0,xmm0
|
---|
2153 | movdqu [ebx],xmm1
|
---|
2154 | pxor xmm1,xmm1
|
---|
2155 | pop edi
|
---|
2156 | pop esi
|
---|
2157 | pop ebx
|
---|
2158 | pop ebp
|
---|
2159 | ret
|
---|
2160 | global _aesni_ocb_decrypt
|
---|
2161 | align 16
|
---|
2162 | _aesni_ocb_decrypt:
|
---|
2163 | L$_aesni_ocb_decrypt_begin:
|
---|
2164 | push ebp
|
---|
2165 | push ebx
|
---|
2166 | push esi
|
---|
2167 | push edi
|
---|
2168 | mov ecx,DWORD [40+esp]
|
---|
2169 | mov ebx,DWORD [48+esp]
|
---|
2170 | mov esi,DWORD [20+esp]
|
---|
2171 | mov edi,DWORD [24+esp]
|
---|
2172 | mov eax,DWORD [28+esp]
|
---|
2173 | mov edx,DWORD [32+esp]
|
---|
2174 | movdqu xmm0,[ecx]
|
---|
2175 | mov ebp,DWORD [36+esp]
|
---|
2176 | movdqu xmm1,[ebx]
|
---|
2177 | mov ebx,DWORD [44+esp]
|
---|
2178 | mov ecx,esp
|
---|
2179 | sub esp,132
|
---|
2180 | and esp,-16
|
---|
2181 | sub edi,esi
|
---|
2182 | shl eax,4
|
---|
2183 | lea eax,[eax*1+esi-96]
|
---|
2184 | mov DWORD [120+esp],edi
|
---|
2185 | mov DWORD [124+esp],eax
|
---|
2186 | mov DWORD [128+esp],ecx
|
---|
2187 | mov ecx,DWORD [240+edx]
|
---|
2188 | test ebp,1
|
---|
2189 | jnz NEAR L$084odd
|
---|
2190 | bsf eax,ebp
|
---|
2191 | add ebp,1
|
---|
2192 | shl eax,4
|
---|
2193 | movdqu xmm7,[eax*1+ebx]
|
---|
2194 | mov eax,edx
|
---|
2195 | movdqu xmm2,[esi]
|
---|
2196 | lea esi,[16+esi]
|
---|
2197 | pxor xmm7,xmm0
|
---|
2198 | pxor xmm2,xmm7
|
---|
2199 | movdqa xmm6,xmm1
|
---|
2200 | movups xmm0,[edx]
|
---|
2201 | movups xmm1,[16+edx]
|
---|
2202 | lea edx,[32+edx]
|
---|
2203 | xorps xmm2,xmm0
|
---|
2204 | L$085dec1_loop_17:
|
---|
2205 | db 102,15,56,222,209
|
---|
2206 | dec ecx
|
---|
2207 | movups xmm1,[edx]
|
---|
2208 | lea edx,[16+edx]
|
---|
2209 | jnz NEAR L$085dec1_loop_17
|
---|
2210 | db 102,15,56,223,209
|
---|
2211 | xorps xmm2,xmm7
|
---|
2212 | movaps xmm1,xmm6
|
---|
2213 | movdqa xmm0,xmm7
|
---|
2214 | xorps xmm1,xmm2
|
---|
2215 | movups [esi*1+edi-16],xmm2
|
---|
2216 | mov ecx,DWORD [240+eax]
|
---|
2217 | mov edx,eax
|
---|
2218 | mov eax,DWORD [124+esp]
|
---|
2219 | L$084odd:
|
---|
2220 | shl ecx,4
|
---|
2221 | mov edi,16
|
---|
2222 | sub edi,ecx
|
---|
2223 | mov DWORD [112+esp],edx
|
---|
2224 | lea edx,[32+ecx*1+edx]
|
---|
2225 | mov DWORD [116+esp],edi
|
---|
2226 | cmp esi,eax
|
---|
2227 | ja NEAR L$086short
|
---|
2228 | jmp NEAR L$087grandloop
|
---|
2229 | align 32
|
---|
2230 | L$087grandloop:
|
---|
2231 | lea ecx,[1+ebp]
|
---|
2232 | lea eax,[3+ebp]
|
---|
2233 | lea edi,[5+ebp]
|
---|
2234 | add ebp,6
|
---|
2235 | bsf ecx,ecx
|
---|
2236 | bsf eax,eax
|
---|
2237 | bsf edi,edi
|
---|
2238 | shl ecx,4
|
---|
2239 | shl eax,4
|
---|
2240 | shl edi,4
|
---|
2241 | movdqu xmm2,[ebx]
|
---|
2242 | movdqu xmm3,[ecx*1+ebx]
|
---|
2243 | mov ecx,DWORD [116+esp]
|
---|
2244 | movdqa xmm4,xmm2
|
---|
2245 | movdqu xmm5,[eax*1+ebx]
|
---|
2246 | movdqa xmm6,xmm2
|
---|
2247 | movdqu xmm7,[edi*1+ebx]
|
---|
2248 | pxor xmm2,xmm0
|
---|
2249 | pxor xmm3,xmm2
|
---|
2250 | movdqa [esp],xmm2
|
---|
2251 | pxor xmm4,xmm3
|
---|
2252 | movdqa [16+esp],xmm3
|
---|
2253 | pxor xmm5,xmm4
|
---|
2254 | movdqa [32+esp],xmm4
|
---|
2255 | pxor xmm6,xmm5
|
---|
2256 | movdqa [48+esp],xmm5
|
---|
2257 | pxor xmm7,xmm6
|
---|
2258 | movdqa [64+esp],xmm6
|
---|
2259 | movdqa [80+esp],xmm7
|
---|
2260 | movups xmm0,[ecx*1+edx-48]
|
---|
2261 | movdqu xmm2,[esi]
|
---|
2262 | movdqu xmm3,[16+esi]
|
---|
2263 | movdqu xmm4,[32+esi]
|
---|
2264 | movdqu xmm5,[48+esi]
|
---|
2265 | movdqu xmm6,[64+esi]
|
---|
2266 | movdqu xmm7,[80+esi]
|
---|
2267 | lea esi,[96+esi]
|
---|
2268 | movdqa [96+esp],xmm1
|
---|
2269 | pxor xmm2,xmm0
|
---|
2270 | pxor xmm3,xmm0
|
---|
2271 | pxor xmm4,xmm0
|
---|
2272 | pxor xmm5,xmm0
|
---|
2273 | pxor xmm6,xmm0
|
---|
2274 | pxor xmm7,xmm0
|
---|
2275 | movups xmm1,[ecx*1+edx-32]
|
---|
2276 | pxor xmm2,[esp]
|
---|
2277 | pxor xmm3,[16+esp]
|
---|
2278 | pxor xmm4,[32+esp]
|
---|
2279 | pxor xmm5,[48+esp]
|
---|
2280 | pxor xmm6,[64+esp]
|
---|
2281 | pxor xmm7,[80+esp]
|
---|
2282 | movups xmm0,[ecx*1+edx-16]
|
---|
2283 | db 102,15,56,222,209
|
---|
2284 | db 102,15,56,222,217
|
---|
2285 | db 102,15,56,222,225
|
---|
2286 | db 102,15,56,222,233
|
---|
2287 | db 102,15,56,222,241
|
---|
2288 | db 102,15,56,222,249
|
---|
2289 | mov edi,DWORD [120+esp]
|
---|
2290 | mov eax,DWORD [124+esp]
|
---|
2291 | call L$_aesni_decrypt6_enter
|
---|
2292 | movdqa xmm0,[80+esp]
|
---|
2293 | pxor xmm2,[esp]
|
---|
2294 | movdqa xmm1,[96+esp]
|
---|
2295 | pxor xmm3,[16+esp]
|
---|
2296 | pxor xmm4,[32+esp]
|
---|
2297 | pxor xmm5,[48+esp]
|
---|
2298 | pxor xmm6,[64+esp]
|
---|
2299 | pxor xmm7,xmm0
|
---|
2300 | pxor xmm1,xmm2
|
---|
2301 | movdqu [esi*1+edi-96],xmm2
|
---|
2302 | pxor xmm1,xmm3
|
---|
2303 | movdqu [esi*1+edi-80],xmm3
|
---|
2304 | pxor xmm1,xmm4
|
---|
2305 | movdqu [esi*1+edi-64],xmm4
|
---|
2306 | pxor xmm1,xmm5
|
---|
2307 | movdqu [esi*1+edi-48],xmm5
|
---|
2308 | pxor xmm1,xmm6
|
---|
2309 | movdqu [esi*1+edi-32],xmm6
|
---|
2310 | pxor xmm1,xmm7
|
---|
2311 | movdqu [esi*1+edi-16],xmm7
|
---|
2312 | cmp esi,eax
|
---|
2313 | jb NEAR L$087grandloop
|
---|
2314 | L$086short:
|
---|
2315 | add eax,96
|
---|
2316 | sub eax,esi
|
---|
2317 | jz NEAR L$088done
|
---|
2318 | cmp eax,32
|
---|
2319 | jb NEAR L$089one
|
---|
2320 | je NEAR L$090two
|
---|
2321 | cmp eax,64
|
---|
2322 | jb NEAR L$091three
|
---|
2323 | je NEAR L$092four
|
---|
2324 | lea ecx,[1+ebp]
|
---|
2325 | lea eax,[3+ebp]
|
---|
2326 | bsf ecx,ecx
|
---|
2327 | bsf eax,eax
|
---|
2328 | shl ecx,4
|
---|
2329 | shl eax,4
|
---|
2330 | movdqu xmm2,[ebx]
|
---|
2331 | movdqu xmm3,[ecx*1+ebx]
|
---|
2332 | mov ecx,DWORD [116+esp]
|
---|
2333 | movdqa xmm4,xmm2
|
---|
2334 | movdqu xmm5,[eax*1+ebx]
|
---|
2335 | movdqa xmm6,xmm2
|
---|
2336 | pxor xmm2,xmm0
|
---|
2337 | pxor xmm3,xmm2
|
---|
2338 | movdqa [esp],xmm2
|
---|
2339 | pxor xmm4,xmm3
|
---|
2340 | movdqa [16+esp],xmm3
|
---|
2341 | pxor xmm5,xmm4
|
---|
2342 | movdqa [32+esp],xmm4
|
---|
2343 | pxor xmm6,xmm5
|
---|
2344 | movdqa [48+esp],xmm5
|
---|
2345 | pxor xmm7,xmm6
|
---|
2346 | movdqa [64+esp],xmm6
|
---|
2347 | movups xmm0,[ecx*1+edx-48]
|
---|
2348 | movdqu xmm2,[esi]
|
---|
2349 | movdqu xmm3,[16+esi]
|
---|
2350 | movdqu xmm4,[32+esi]
|
---|
2351 | movdqu xmm5,[48+esi]
|
---|
2352 | movdqu xmm6,[64+esi]
|
---|
2353 | pxor xmm7,xmm7
|
---|
2354 | movdqa [96+esp],xmm1
|
---|
2355 | pxor xmm2,xmm0
|
---|
2356 | pxor xmm3,xmm0
|
---|
2357 | pxor xmm4,xmm0
|
---|
2358 | pxor xmm5,xmm0
|
---|
2359 | pxor xmm6,xmm0
|
---|
2360 | movups xmm1,[ecx*1+edx-32]
|
---|
2361 | pxor xmm2,[esp]
|
---|
2362 | pxor xmm3,[16+esp]
|
---|
2363 | pxor xmm4,[32+esp]
|
---|
2364 | pxor xmm5,[48+esp]
|
---|
2365 | pxor xmm6,[64+esp]
|
---|
2366 | movups xmm0,[ecx*1+edx-16]
|
---|
2367 | db 102,15,56,222,209
|
---|
2368 | db 102,15,56,222,217
|
---|
2369 | db 102,15,56,222,225
|
---|
2370 | db 102,15,56,222,233
|
---|
2371 | db 102,15,56,222,241
|
---|
2372 | db 102,15,56,222,249
|
---|
2373 | mov edi,DWORD [120+esp]
|
---|
2374 | call L$_aesni_decrypt6_enter
|
---|
2375 | movdqa xmm0,[64+esp]
|
---|
2376 | pxor xmm2,[esp]
|
---|
2377 | movdqa xmm1,[96+esp]
|
---|
2378 | pxor xmm3,[16+esp]
|
---|
2379 | pxor xmm4,[32+esp]
|
---|
2380 | pxor xmm5,[48+esp]
|
---|
2381 | pxor xmm6,xmm0
|
---|
2382 | pxor xmm1,xmm2
|
---|
2383 | movdqu [esi*1+edi],xmm2
|
---|
2384 | pxor xmm1,xmm3
|
---|
2385 | movdqu [16+esi*1+edi],xmm3
|
---|
2386 | pxor xmm1,xmm4
|
---|
2387 | movdqu [32+esi*1+edi],xmm4
|
---|
2388 | pxor xmm1,xmm5
|
---|
2389 | movdqu [48+esi*1+edi],xmm5
|
---|
2390 | pxor xmm1,xmm6
|
---|
2391 | movdqu [64+esi*1+edi],xmm6
|
---|
2392 | jmp NEAR L$088done
|
---|
2393 | align 16
|
---|
2394 | L$089one:
|
---|
2395 | movdqu xmm7,[ebx]
|
---|
2396 | mov edx,DWORD [112+esp]
|
---|
2397 | movdqu xmm2,[esi]
|
---|
2398 | mov ecx,DWORD [240+edx]
|
---|
2399 | pxor xmm7,xmm0
|
---|
2400 | pxor xmm2,xmm7
|
---|
2401 | movdqa xmm6,xmm1
|
---|
2402 | mov edi,DWORD [120+esp]
|
---|
2403 | movups xmm0,[edx]
|
---|
2404 | movups xmm1,[16+edx]
|
---|
2405 | lea edx,[32+edx]
|
---|
2406 | xorps xmm2,xmm0
|
---|
2407 | L$093dec1_loop_18:
|
---|
2408 | db 102,15,56,222,209
|
---|
2409 | dec ecx
|
---|
2410 | movups xmm1,[edx]
|
---|
2411 | lea edx,[16+edx]
|
---|
2412 | jnz NEAR L$093dec1_loop_18
|
---|
2413 | db 102,15,56,223,209
|
---|
2414 | xorps xmm2,xmm7
|
---|
2415 | movaps xmm1,xmm6
|
---|
2416 | movdqa xmm0,xmm7
|
---|
2417 | xorps xmm1,xmm2
|
---|
2418 | movups [esi*1+edi],xmm2
|
---|
2419 | jmp NEAR L$088done
|
---|
2420 | align 16
|
---|
2421 | L$090two:
|
---|
2422 | lea ecx,[1+ebp]
|
---|
2423 | mov edx,DWORD [112+esp]
|
---|
2424 | bsf ecx,ecx
|
---|
2425 | shl ecx,4
|
---|
2426 | movdqu xmm6,[ebx]
|
---|
2427 | movdqu xmm7,[ecx*1+ebx]
|
---|
2428 | movdqu xmm2,[esi]
|
---|
2429 | movdqu xmm3,[16+esi]
|
---|
2430 | mov ecx,DWORD [240+edx]
|
---|
2431 | movdqa xmm5,xmm1
|
---|
2432 | pxor xmm6,xmm0
|
---|
2433 | pxor xmm7,xmm6
|
---|
2434 | pxor xmm2,xmm6
|
---|
2435 | pxor xmm3,xmm7
|
---|
2436 | mov edi,DWORD [120+esp]
|
---|
2437 | call __aesni_decrypt2
|
---|
2438 | xorps xmm2,xmm6
|
---|
2439 | xorps xmm3,xmm7
|
---|
2440 | movdqa xmm0,xmm7
|
---|
2441 | xorps xmm5,xmm2
|
---|
2442 | movups [esi*1+edi],xmm2
|
---|
2443 | xorps xmm5,xmm3
|
---|
2444 | movups [16+esi*1+edi],xmm3
|
---|
2445 | movaps xmm1,xmm5
|
---|
2446 | jmp NEAR L$088done
|
---|
2447 | align 16
|
---|
2448 | L$091three:
|
---|
2449 | lea ecx,[1+ebp]
|
---|
2450 | mov edx,DWORD [112+esp]
|
---|
2451 | bsf ecx,ecx
|
---|
2452 | shl ecx,4
|
---|
2453 | movdqu xmm5,[ebx]
|
---|
2454 | movdqu xmm6,[ecx*1+ebx]
|
---|
2455 | movdqa xmm7,xmm5
|
---|
2456 | movdqu xmm2,[esi]
|
---|
2457 | movdqu xmm3,[16+esi]
|
---|
2458 | movdqu xmm4,[32+esi]
|
---|
2459 | mov ecx,DWORD [240+edx]
|
---|
2460 | movdqa [96+esp],xmm1
|
---|
2461 | pxor xmm5,xmm0
|
---|
2462 | pxor xmm6,xmm5
|
---|
2463 | pxor xmm7,xmm6
|
---|
2464 | pxor xmm2,xmm5
|
---|
2465 | pxor xmm3,xmm6
|
---|
2466 | pxor xmm4,xmm7
|
---|
2467 | mov edi,DWORD [120+esp]
|
---|
2468 | call __aesni_decrypt3
|
---|
2469 | movdqa xmm1,[96+esp]
|
---|
2470 | xorps xmm2,xmm5
|
---|
2471 | xorps xmm3,xmm6
|
---|
2472 | xorps xmm4,xmm7
|
---|
2473 | movups [esi*1+edi],xmm2
|
---|
2474 | pxor xmm1,xmm2
|
---|
2475 | movdqa xmm0,xmm7
|
---|
2476 | movups [16+esi*1+edi],xmm3
|
---|
2477 | pxor xmm1,xmm3
|
---|
2478 | movups [32+esi*1+edi],xmm4
|
---|
2479 | pxor xmm1,xmm4
|
---|
2480 | jmp NEAR L$088done
|
---|
2481 | align 16
|
---|
2482 | L$092four:
|
---|
2483 | lea ecx,[1+ebp]
|
---|
2484 | lea eax,[3+ebp]
|
---|
2485 | bsf ecx,ecx
|
---|
2486 | bsf eax,eax
|
---|
2487 | mov edx,DWORD [112+esp]
|
---|
2488 | shl ecx,4
|
---|
2489 | shl eax,4
|
---|
2490 | movdqu xmm4,[ebx]
|
---|
2491 | movdqu xmm5,[ecx*1+ebx]
|
---|
2492 | movdqa xmm6,xmm4
|
---|
2493 | movdqu xmm7,[eax*1+ebx]
|
---|
2494 | pxor xmm4,xmm0
|
---|
2495 | movdqu xmm2,[esi]
|
---|
2496 | pxor xmm5,xmm4
|
---|
2497 | movdqu xmm3,[16+esi]
|
---|
2498 | pxor xmm6,xmm5
|
---|
2499 | movdqa [esp],xmm4
|
---|
2500 | pxor xmm7,xmm6
|
---|
2501 | movdqa [16+esp],xmm5
|
---|
2502 | movdqu xmm4,[32+esi]
|
---|
2503 | movdqu xmm5,[48+esi]
|
---|
2504 | mov ecx,DWORD [240+edx]
|
---|
2505 | movdqa [96+esp],xmm1
|
---|
2506 | pxor xmm2,[esp]
|
---|
2507 | pxor xmm3,[16+esp]
|
---|
2508 | pxor xmm4,xmm6
|
---|
2509 | pxor xmm5,xmm7
|
---|
2510 | mov edi,DWORD [120+esp]
|
---|
2511 | call __aesni_decrypt4
|
---|
2512 | movdqa xmm1,[96+esp]
|
---|
2513 | xorps xmm2,[esp]
|
---|
2514 | xorps xmm3,[16+esp]
|
---|
2515 | xorps xmm4,xmm6
|
---|
2516 | movups [esi*1+edi],xmm2
|
---|
2517 | pxor xmm1,xmm2
|
---|
2518 | xorps xmm5,xmm7
|
---|
2519 | movups [16+esi*1+edi],xmm3
|
---|
2520 | pxor xmm1,xmm3
|
---|
2521 | movdqa xmm0,xmm7
|
---|
2522 | movups [32+esi*1+edi],xmm4
|
---|
2523 | pxor xmm1,xmm4
|
---|
2524 | movups [48+esi*1+edi],xmm5
|
---|
2525 | pxor xmm1,xmm5
|
---|
2526 | L$088done:
|
---|
2527 | mov edx,DWORD [128+esp]
|
---|
2528 | pxor xmm2,xmm2
|
---|
2529 | pxor xmm3,xmm3
|
---|
2530 | movdqa [esp],xmm2
|
---|
2531 | pxor xmm4,xmm4
|
---|
2532 | movdqa [16+esp],xmm2
|
---|
2533 | pxor xmm5,xmm5
|
---|
2534 | movdqa [32+esp],xmm2
|
---|
2535 | pxor xmm6,xmm6
|
---|
2536 | movdqa [48+esp],xmm2
|
---|
2537 | pxor xmm7,xmm7
|
---|
2538 | movdqa [64+esp],xmm2
|
---|
2539 | movdqa [80+esp],xmm2
|
---|
2540 | movdqa [96+esp],xmm2
|
---|
2541 | lea esp,[edx]
|
---|
2542 | mov ecx,DWORD [40+esp]
|
---|
2543 | mov ebx,DWORD [48+esp]
|
---|
2544 | movdqu [ecx],xmm0
|
---|
2545 | pxor xmm0,xmm0
|
---|
2546 | movdqu [ebx],xmm1
|
---|
2547 | pxor xmm1,xmm1
|
---|
2548 | pop edi
|
---|
2549 | pop esi
|
---|
2550 | pop ebx
|
---|
2551 | pop ebp
|
---|
2552 | ret
|
---|
2553 | global _aesni_cbc_encrypt
|
---|
2554 | align 16
|
---|
2555 | _aesni_cbc_encrypt:
|
---|
2556 | L$_aesni_cbc_encrypt_begin:
|
---|
2557 | push ebp
|
---|
2558 | push ebx
|
---|
2559 | push esi
|
---|
2560 | push edi
|
---|
2561 | mov esi,DWORD [20+esp]
|
---|
2562 | mov ebx,esp
|
---|
2563 | mov edi,DWORD [24+esp]
|
---|
2564 | sub ebx,24
|
---|
2565 | mov eax,DWORD [28+esp]
|
---|
2566 | and ebx,-16
|
---|
2567 | mov edx,DWORD [32+esp]
|
---|
2568 | mov ebp,DWORD [36+esp]
|
---|
2569 | test eax,eax
|
---|
2570 | jz NEAR L$094cbc_abort
|
---|
2571 | cmp DWORD [40+esp],0
|
---|
2572 | xchg ebx,esp
|
---|
2573 | movups xmm7,[ebp]
|
---|
2574 | mov ecx,DWORD [240+edx]
|
---|
2575 | mov ebp,edx
|
---|
2576 | mov DWORD [16+esp],ebx
|
---|
2577 | mov ebx,ecx
|
---|
2578 | je NEAR L$095cbc_decrypt
|
---|
2579 | movaps xmm2,xmm7
|
---|
2580 | cmp eax,16
|
---|
2581 | jb NEAR L$096cbc_enc_tail
|
---|
2582 | sub eax,16
|
---|
2583 | jmp NEAR L$097cbc_enc_loop
|
---|
2584 | align 16
|
---|
2585 | L$097cbc_enc_loop:
|
---|
2586 | movups xmm7,[esi]
|
---|
2587 | lea esi,[16+esi]
|
---|
2588 | movups xmm0,[edx]
|
---|
2589 | movups xmm1,[16+edx]
|
---|
2590 | xorps xmm7,xmm0
|
---|
2591 | lea edx,[32+edx]
|
---|
2592 | xorps xmm2,xmm7
|
---|
2593 | L$098enc1_loop_19:
|
---|
2594 | db 102,15,56,220,209
|
---|
2595 | dec ecx
|
---|
2596 | movups xmm1,[edx]
|
---|
2597 | lea edx,[16+edx]
|
---|
2598 | jnz NEAR L$098enc1_loop_19
|
---|
2599 | db 102,15,56,221,209
|
---|
2600 | mov ecx,ebx
|
---|
2601 | mov edx,ebp
|
---|
2602 | movups [edi],xmm2
|
---|
2603 | lea edi,[16+edi]
|
---|
2604 | sub eax,16
|
---|
2605 | jnc NEAR L$097cbc_enc_loop
|
---|
2606 | add eax,16
|
---|
2607 | jnz NEAR L$096cbc_enc_tail
|
---|
2608 | movaps xmm7,xmm2
|
---|
2609 | pxor xmm2,xmm2
|
---|
2610 | jmp NEAR L$099cbc_ret
|
---|
2611 | L$096cbc_enc_tail:
|
---|
2612 | mov ecx,eax
|
---|
2613 | dd 2767451785
|
---|
2614 | mov ecx,16
|
---|
2615 | sub ecx,eax
|
---|
2616 | xor eax,eax
|
---|
2617 | dd 2868115081
|
---|
2618 | lea edi,[edi-16]
|
---|
2619 | mov ecx,ebx
|
---|
2620 | mov esi,edi
|
---|
2621 | mov edx,ebp
|
---|
2622 | jmp NEAR L$097cbc_enc_loop
|
---|
2623 | align 16
|
---|
2624 | L$095cbc_decrypt:
|
---|
2625 | cmp eax,80
|
---|
2626 | jbe NEAR L$100cbc_dec_tail
|
---|
2627 | movaps [esp],xmm7
|
---|
2628 | sub eax,80
|
---|
2629 | jmp NEAR L$101cbc_dec_loop6_enter
|
---|
2630 | align 16
|
---|
2631 | L$102cbc_dec_loop6:
|
---|
2632 | movaps [esp],xmm0
|
---|
2633 | movups [edi],xmm7
|
---|
2634 | lea edi,[16+edi]
|
---|
2635 | L$101cbc_dec_loop6_enter:
|
---|
2636 | movdqu xmm2,[esi]
|
---|
2637 | movdqu xmm3,[16+esi]
|
---|
2638 | movdqu xmm4,[32+esi]
|
---|
2639 | movdqu xmm5,[48+esi]
|
---|
2640 | movdqu xmm6,[64+esi]
|
---|
2641 | movdqu xmm7,[80+esi]
|
---|
2642 | call __aesni_decrypt6
|
---|
2643 | movups xmm1,[esi]
|
---|
2644 | movups xmm0,[16+esi]
|
---|
2645 | xorps xmm2,[esp]
|
---|
2646 | xorps xmm3,xmm1
|
---|
2647 | movups xmm1,[32+esi]
|
---|
2648 | xorps xmm4,xmm0
|
---|
2649 | movups xmm0,[48+esi]
|
---|
2650 | xorps xmm5,xmm1
|
---|
2651 | movups xmm1,[64+esi]
|
---|
2652 | xorps xmm6,xmm0
|
---|
2653 | movups xmm0,[80+esi]
|
---|
2654 | xorps xmm7,xmm1
|
---|
2655 | movups [edi],xmm2
|
---|
2656 | movups [16+edi],xmm3
|
---|
2657 | lea esi,[96+esi]
|
---|
2658 | movups [32+edi],xmm4
|
---|
2659 | mov ecx,ebx
|
---|
2660 | movups [48+edi],xmm5
|
---|
2661 | mov edx,ebp
|
---|
2662 | movups [64+edi],xmm6
|
---|
2663 | lea edi,[80+edi]
|
---|
2664 | sub eax,96
|
---|
2665 | ja NEAR L$102cbc_dec_loop6
|
---|
2666 | movaps xmm2,xmm7
|
---|
2667 | movaps xmm7,xmm0
|
---|
2668 | add eax,80
|
---|
2669 | jle NEAR L$103cbc_dec_clear_tail_collected
|
---|
2670 | movups [edi],xmm2
|
---|
2671 | lea edi,[16+edi]
|
---|
2672 | L$100cbc_dec_tail:
|
---|
2673 | movups xmm2,[esi]
|
---|
2674 | movaps xmm6,xmm2
|
---|
2675 | cmp eax,16
|
---|
2676 | jbe NEAR L$104cbc_dec_one
|
---|
2677 | movups xmm3,[16+esi]
|
---|
2678 | movaps xmm5,xmm3
|
---|
2679 | cmp eax,32
|
---|
2680 | jbe NEAR L$105cbc_dec_two
|
---|
2681 | movups xmm4,[32+esi]
|
---|
2682 | cmp eax,48
|
---|
2683 | jbe NEAR L$106cbc_dec_three
|
---|
2684 | movups xmm5,[48+esi]
|
---|
2685 | cmp eax,64
|
---|
2686 | jbe NEAR L$107cbc_dec_four
|
---|
2687 | movups xmm6,[64+esi]
|
---|
2688 | movaps [esp],xmm7
|
---|
2689 | movups xmm2,[esi]
|
---|
2690 | xorps xmm7,xmm7
|
---|
2691 | call __aesni_decrypt6
|
---|
2692 | movups xmm1,[esi]
|
---|
2693 | movups xmm0,[16+esi]
|
---|
2694 | xorps xmm2,[esp]
|
---|
2695 | xorps xmm3,xmm1
|
---|
2696 | movups xmm1,[32+esi]
|
---|
2697 | xorps xmm4,xmm0
|
---|
2698 | movups xmm0,[48+esi]
|
---|
2699 | xorps xmm5,xmm1
|
---|
2700 | movups xmm7,[64+esi]
|
---|
2701 | xorps xmm6,xmm0
|
---|
2702 | movups [edi],xmm2
|
---|
2703 | movups [16+edi],xmm3
|
---|
2704 | pxor xmm3,xmm3
|
---|
2705 | movups [32+edi],xmm4
|
---|
2706 | pxor xmm4,xmm4
|
---|
2707 | movups [48+edi],xmm5
|
---|
2708 | pxor xmm5,xmm5
|
---|
2709 | lea edi,[64+edi]
|
---|
2710 | movaps xmm2,xmm6
|
---|
2711 | pxor xmm6,xmm6
|
---|
2712 | sub eax,80
|
---|
2713 | jmp NEAR L$108cbc_dec_tail_collected
|
---|
2714 | align 16
|
---|
2715 | L$104cbc_dec_one:
|
---|
2716 | movups xmm0,[edx]
|
---|
2717 | movups xmm1,[16+edx]
|
---|
2718 | lea edx,[32+edx]
|
---|
2719 | xorps xmm2,xmm0
|
---|
2720 | L$109dec1_loop_20:
|
---|
2721 | db 102,15,56,222,209
|
---|
2722 | dec ecx
|
---|
2723 | movups xmm1,[edx]
|
---|
2724 | lea edx,[16+edx]
|
---|
2725 | jnz NEAR L$109dec1_loop_20
|
---|
2726 | db 102,15,56,223,209
|
---|
2727 | xorps xmm2,xmm7
|
---|
2728 | movaps xmm7,xmm6
|
---|
2729 | sub eax,16
|
---|
2730 | jmp NEAR L$108cbc_dec_tail_collected
|
---|
2731 | align 16
|
---|
2732 | L$105cbc_dec_two:
|
---|
2733 | call __aesni_decrypt2
|
---|
2734 | xorps xmm2,xmm7
|
---|
2735 | xorps xmm3,xmm6
|
---|
2736 | movups [edi],xmm2
|
---|
2737 | movaps xmm2,xmm3
|
---|
2738 | pxor xmm3,xmm3
|
---|
2739 | lea edi,[16+edi]
|
---|
2740 | movaps xmm7,xmm5
|
---|
2741 | sub eax,32
|
---|
2742 | jmp NEAR L$108cbc_dec_tail_collected
|
---|
2743 | align 16
|
---|
2744 | L$106cbc_dec_three:
|
---|
2745 | call __aesni_decrypt3
|
---|
2746 | xorps xmm2,xmm7
|
---|
2747 | xorps xmm3,xmm6
|
---|
2748 | xorps xmm4,xmm5
|
---|
2749 | movups [edi],xmm2
|
---|
2750 | movaps xmm2,xmm4
|
---|
2751 | pxor xmm4,xmm4
|
---|
2752 | movups [16+edi],xmm3
|
---|
2753 | pxor xmm3,xmm3
|
---|
2754 | lea edi,[32+edi]
|
---|
2755 | movups xmm7,[32+esi]
|
---|
2756 | sub eax,48
|
---|
2757 | jmp NEAR L$108cbc_dec_tail_collected
|
---|
2758 | align 16
|
---|
2759 | L$107cbc_dec_four:
|
---|
2760 | call __aesni_decrypt4
|
---|
2761 | movups xmm1,[16+esi]
|
---|
2762 | movups xmm0,[32+esi]
|
---|
2763 | xorps xmm2,xmm7
|
---|
2764 | movups xmm7,[48+esi]
|
---|
2765 | xorps xmm3,xmm6
|
---|
2766 | movups [edi],xmm2
|
---|
2767 | xorps xmm4,xmm1
|
---|
2768 | movups [16+edi],xmm3
|
---|
2769 | pxor xmm3,xmm3
|
---|
2770 | xorps xmm5,xmm0
|
---|
2771 | movups [32+edi],xmm4
|
---|
2772 | pxor xmm4,xmm4
|
---|
2773 | lea edi,[48+edi]
|
---|
2774 | movaps xmm2,xmm5
|
---|
2775 | pxor xmm5,xmm5
|
---|
2776 | sub eax,64
|
---|
2777 | jmp NEAR L$108cbc_dec_tail_collected
|
---|
2778 | align 16
|
---|
2779 | L$103cbc_dec_clear_tail_collected:
|
---|
2780 | pxor xmm3,xmm3
|
---|
2781 | pxor xmm4,xmm4
|
---|
2782 | pxor xmm5,xmm5
|
---|
2783 | pxor xmm6,xmm6
|
---|
2784 | L$108cbc_dec_tail_collected:
|
---|
2785 | and eax,15
|
---|
2786 | jnz NEAR L$110cbc_dec_tail_partial
|
---|
2787 | movups [edi],xmm2
|
---|
2788 | pxor xmm0,xmm0
|
---|
2789 | jmp NEAR L$099cbc_ret
|
---|
2790 | align 16
|
---|
2791 | L$110cbc_dec_tail_partial:
|
---|
2792 | movaps [esp],xmm2
|
---|
2793 | pxor xmm0,xmm0
|
---|
2794 | mov ecx,16
|
---|
2795 | mov esi,esp
|
---|
2796 | sub ecx,eax
|
---|
2797 | dd 2767451785
|
---|
2798 | movdqa [esp],xmm2
|
---|
2799 | L$099cbc_ret:
|
---|
2800 | mov esp,DWORD [16+esp]
|
---|
2801 | mov ebp,DWORD [36+esp]
|
---|
2802 | pxor xmm2,xmm2
|
---|
2803 | pxor xmm1,xmm1
|
---|
2804 | movups [ebp],xmm7
|
---|
2805 | pxor xmm7,xmm7
|
---|
2806 | L$094cbc_abort:
|
---|
2807 | pop edi
|
---|
2808 | pop esi
|
---|
2809 | pop ebx
|
---|
2810 | pop ebp
|
---|
2811 | ret
|
---|
2812 | align 16
|
---|
2813 | __aesni_set_encrypt_key:
|
---|
2814 | push ebp
|
---|
2815 | push ebx
|
---|
2816 | test eax,eax
|
---|
2817 | jz NEAR L$111bad_pointer
|
---|
2818 | test edx,edx
|
---|
2819 | jz NEAR L$111bad_pointer
|
---|
2820 | call L$112pic
|
---|
2821 | L$112pic:
|
---|
2822 | pop ebx
|
---|
2823 | lea ebx,[(L$key_const-L$112pic)+ebx]
|
---|
2824 | lea ebp,[_OPENSSL_ia32cap_P]
|
---|
2825 | movups xmm0,[eax]
|
---|
2826 | xorps xmm4,xmm4
|
---|
2827 | mov ebp,DWORD [4+ebp]
|
---|
2828 | lea edx,[16+edx]
|
---|
2829 | and ebp,268437504
|
---|
2830 | cmp ecx,256
|
---|
2831 | je NEAR L$11314rounds
|
---|
2832 | cmp ecx,192
|
---|
2833 | je NEAR L$11412rounds
|
---|
2834 | cmp ecx,128
|
---|
2835 | jne NEAR L$115bad_keybits
|
---|
2836 | align 16
|
---|
2837 | L$11610rounds:
|
---|
2838 | cmp ebp,268435456
|
---|
2839 | je NEAR L$11710rounds_alt
|
---|
2840 | mov ecx,9
|
---|
2841 | movups [edx-16],xmm0
|
---|
2842 | db 102,15,58,223,200,1
|
---|
2843 | call L$118key_128_cold
|
---|
2844 | db 102,15,58,223,200,2
|
---|
2845 | call L$119key_128
|
---|
2846 | db 102,15,58,223,200,4
|
---|
2847 | call L$119key_128
|
---|
2848 | db 102,15,58,223,200,8
|
---|
2849 | call L$119key_128
|
---|
2850 | db 102,15,58,223,200,16
|
---|
2851 | call L$119key_128
|
---|
2852 | db 102,15,58,223,200,32
|
---|
2853 | call L$119key_128
|
---|
2854 | db 102,15,58,223,200,64
|
---|
2855 | call L$119key_128
|
---|
2856 | db 102,15,58,223,200,128
|
---|
2857 | call L$119key_128
|
---|
2858 | db 102,15,58,223,200,27
|
---|
2859 | call L$119key_128
|
---|
2860 | db 102,15,58,223,200,54
|
---|
2861 | call L$119key_128
|
---|
2862 | movups [edx],xmm0
|
---|
2863 | mov DWORD [80+edx],ecx
|
---|
2864 | jmp NEAR L$120good_key
|
---|
2865 | align 16
|
---|
2866 | L$119key_128:
|
---|
2867 | movups [edx],xmm0
|
---|
2868 | lea edx,[16+edx]
|
---|
2869 | L$118key_128_cold:
|
---|
2870 | shufps xmm4,xmm0,16
|
---|
2871 | xorps xmm0,xmm4
|
---|
2872 | shufps xmm4,xmm0,140
|
---|
2873 | xorps xmm0,xmm4
|
---|
2874 | shufps xmm1,xmm1,255
|
---|
2875 | xorps xmm0,xmm1
|
---|
2876 | ret
|
---|
2877 | align 16
|
---|
2878 | L$11710rounds_alt:
|
---|
2879 | movdqa xmm5,[ebx]
|
---|
2880 | mov ecx,8
|
---|
2881 | movdqa xmm4,[32+ebx]
|
---|
2882 | movdqa xmm2,xmm0
|
---|
2883 | movdqu [edx-16],xmm0
|
---|
2884 | L$121loop_key128:
|
---|
2885 | db 102,15,56,0,197
|
---|
2886 | db 102,15,56,221,196
|
---|
2887 | pslld xmm4,1
|
---|
2888 | lea edx,[16+edx]
|
---|
2889 | movdqa xmm3,xmm2
|
---|
2890 | pslldq xmm2,4
|
---|
2891 | pxor xmm3,xmm2
|
---|
2892 | pslldq xmm2,4
|
---|
2893 | pxor xmm3,xmm2
|
---|
2894 | pslldq xmm2,4
|
---|
2895 | pxor xmm2,xmm3
|
---|
2896 | pxor xmm0,xmm2
|
---|
2897 | movdqu [edx-16],xmm0
|
---|
2898 | movdqa xmm2,xmm0
|
---|
2899 | dec ecx
|
---|
2900 | jnz NEAR L$121loop_key128
|
---|
2901 | movdqa xmm4,[48+ebx]
|
---|
2902 | db 102,15,56,0,197
|
---|
2903 | db 102,15,56,221,196
|
---|
2904 | pslld xmm4,1
|
---|
2905 | movdqa xmm3,xmm2
|
---|
2906 | pslldq xmm2,4
|
---|
2907 | pxor xmm3,xmm2
|
---|
2908 | pslldq xmm2,4
|
---|
2909 | pxor xmm3,xmm2
|
---|
2910 | pslldq xmm2,4
|
---|
2911 | pxor xmm2,xmm3
|
---|
2912 | pxor xmm0,xmm2
|
---|
2913 | movdqu [edx],xmm0
|
---|
2914 | movdqa xmm2,xmm0
|
---|
2915 | db 102,15,56,0,197
|
---|
2916 | db 102,15,56,221,196
|
---|
2917 | movdqa xmm3,xmm2
|
---|
2918 | pslldq xmm2,4
|
---|
2919 | pxor xmm3,xmm2
|
---|
2920 | pslldq xmm2,4
|
---|
2921 | pxor xmm3,xmm2
|
---|
2922 | pslldq xmm2,4
|
---|
2923 | pxor xmm2,xmm3
|
---|
2924 | pxor xmm0,xmm2
|
---|
2925 | movdqu [16+edx],xmm0
|
---|
2926 | mov ecx,9
|
---|
2927 | mov DWORD [96+edx],ecx
|
---|
2928 | jmp NEAR L$120good_key
|
---|
2929 | align 16
|
---|
2930 | L$11412rounds:
|
---|
2931 | movq xmm2,[16+eax]
|
---|
2932 | cmp ebp,268435456
|
---|
2933 | je NEAR L$12212rounds_alt
|
---|
2934 | mov ecx,11
|
---|
2935 | movups [edx-16],xmm0
|
---|
2936 | db 102,15,58,223,202,1
|
---|
2937 | call L$123key_192a_cold
|
---|
2938 | db 102,15,58,223,202,2
|
---|
2939 | call L$124key_192b
|
---|
2940 | db 102,15,58,223,202,4
|
---|
2941 | call L$125key_192a
|
---|
2942 | db 102,15,58,223,202,8
|
---|
2943 | call L$124key_192b
|
---|
2944 | db 102,15,58,223,202,16
|
---|
2945 | call L$125key_192a
|
---|
2946 | db 102,15,58,223,202,32
|
---|
2947 | call L$124key_192b
|
---|
2948 | db 102,15,58,223,202,64
|
---|
2949 | call L$125key_192a
|
---|
2950 | db 102,15,58,223,202,128
|
---|
2951 | call L$124key_192b
|
---|
2952 | movups [edx],xmm0
|
---|
2953 | mov DWORD [48+edx],ecx
|
---|
2954 | jmp NEAR L$120good_key
|
---|
2955 | align 16
|
---|
2956 | L$125key_192a:
|
---|
2957 | movups [edx],xmm0
|
---|
2958 | lea edx,[16+edx]
|
---|
2959 | align 16
|
---|
2960 | L$123key_192a_cold:
|
---|
2961 | movaps xmm5,xmm2
|
---|
2962 | L$126key_192b_warm:
|
---|
2963 | shufps xmm4,xmm0,16
|
---|
2964 | movdqa xmm3,xmm2
|
---|
2965 | xorps xmm0,xmm4
|
---|
2966 | shufps xmm4,xmm0,140
|
---|
2967 | pslldq xmm3,4
|
---|
2968 | xorps xmm0,xmm4
|
---|
2969 | pshufd xmm1,xmm1,85
|
---|
2970 | pxor xmm2,xmm3
|
---|
2971 | pxor xmm0,xmm1
|
---|
2972 | pshufd xmm3,xmm0,255
|
---|
2973 | pxor xmm2,xmm3
|
---|
2974 | ret
|
---|
2975 | align 16
|
---|
2976 | L$124key_192b:
|
---|
2977 | movaps xmm3,xmm0
|
---|
2978 | shufps xmm5,xmm0,68
|
---|
2979 | movups [edx],xmm5
|
---|
2980 | shufps xmm3,xmm2,78
|
---|
2981 | movups [16+edx],xmm3
|
---|
2982 | lea edx,[32+edx]
|
---|
2983 | jmp NEAR L$126key_192b_warm
|
---|
2984 | align 16
|
---|
2985 | L$12212rounds_alt:
|
---|
2986 | movdqa xmm5,[16+ebx]
|
---|
2987 | movdqa xmm4,[32+ebx]
|
---|
2988 | mov ecx,8
|
---|
2989 | movdqu [edx-16],xmm0
|
---|
2990 | L$127loop_key192:
|
---|
2991 | movq [edx],xmm2
|
---|
2992 | movdqa xmm1,xmm2
|
---|
2993 | db 102,15,56,0,213
|
---|
2994 | db 102,15,56,221,212
|
---|
2995 | pslld xmm4,1
|
---|
2996 | lea edx,[24+edx]
|
---|
2997 | movdqa xmm3,xmm0
|
---|
2998 | pslldq xmm0,4
|
---|
2999 | pxor xmm3,xmm0
|
---|
3000 | pslldq xmm0,4
|
---|
3001 | pxor xmm3,xmm0
|
---|
3002 | pslldq xmm0,4
|
---|
3003 | pxor xmm0,xmm3
|
---|
3004 | pshufd xmm3,xmm0,255
|
---|
3005 | pxor xmm3,xmm1
|
---|
3006 | pslldq xmm1,4
|
---|
3007 | pxor xmm3,xmm1
|
---|
3008 | pxor xmm0,xmm2
|
---|
3009 | pxor xmm2,xmm3
|
---|
3010 | movdqu [edx-16],xmm0
|
---|
3011 | dec ecx
|
---|
3012 | jnz NEAR L$127loop_key192
|
---|
3013 | mov ecx,11
|
---|
3014 | mov DWORD [32+edx],ecx
|
---|
3015 | jmp NEAR L$120good_key
|
---|
3016 | align 16
|
---|
3017 | L$11314rounds:
|
---|
3018 | movups xmm2,[16+eax]
|
---|
3019 | lea edx,[16+edx]
|
---|
3020 | cmp ebp,268435456
|
---|
3021 | je NEAR L$12814rounds_alt
|
---|
3022 | mov ecx,13
|
---|
3023 | movups [edx-32],xmm0
|
---|
3024 | movups [edx-16],xmm2
|
---|
3025 | db 102,15,58,223,202,1
|
---|
3026 | call L$129key_256a_cold
|
---|
3027 | db 102,15,58,223,200,1
|
---|
3028 | call L$130key_256b
|
---|
3029 | db 102,15,58,223,202,2
|
---|
3030 | call L$131key_256a
|
---|
3031 | db 102,15,58,223,200,2
|
---|
3032 | call L$130key_256b
|
---|
3033 | db 102,15,58,223,202,4
|
---|
3034 | call L$131key_256a
|
---|
3035 | db 102,15,58,223,200,4
|
---|
3036 | call L$130key_256b
|
---|
3037 | db 102,15,58,223,202,8
|
---|
3038 | call L$131key_256a
|
---|
3039 | db 102,15,58,223,200,8
|
---|
3040 | call L$130key_256b
|
---|
3041 | db 102,15,58,223,202,16
|
---|
3042 | call L$131key_256a
|
---|
3043 | db 102,15,58,223,200,16
|
---|
3044 | call L$130key_256b
|
---|
3045 | db 102,15,58,223,202,32
|
---|
3046 | call L$131key_256a
|
---|
3047 | db 102,15,58,223,200,32
|
---|
3048 | call L$130key_256b
|
---|
3049 | db 102,15,58,223,202,64
|
---|
3050 | call L$131key_256a
|
---|
3051 | movups [edx],xmm0
|
---|
3052 | mov DWORD [16+edx],ecx
|
---|
3053 | xor eax,eax
|
---|
3054 | jmp NEAR L$120good_key
|
---|
3055 | align 16
|
---|
3056 | L$131key_256a:
|
---|
3057 | movups [edx],xmm2
|
---|
3058 | lea edx,[16+edx]
|
---|
3059 | L$129key_256a_cold:
|
---|
3060 | shufps xmm4,xmm0,16
|
---|
3061 | xorps xmm0,xmm4
|
---|
3062 | shufps xmm4,xmm0,140
|
---|
3063 | xorps xmm0,xmm4
|
---|
3064 | shufps xmm1,xmm1,255
|
---|
3065 | xorps xmm0,xmm1
|
---|
3066 | ret
|
---|
3067 | align 16
|
---|
3068 | L$130key_256b:
|
---|
3069 | movups [edx],xmm0
|
---|
3070 | lea edx,[16+edx]
|
---|
3071 | shufps xmm4,xmm2,16
|
---|
3072 | xorps xmm2,xmm4
|
---|
3073 | shufps xmm4,xmm2,140
|
---|
3074 | xorps xmm2,xmm4
|
---|
3075 | shufps xmm1,xmm1,170
|
---|
3076 | xorps xmm2,xmm1
|
---|
3077 | ret
|
---|
3078 | align 16
|
---|
3079 | L$12814rounds_alt:
|
---|
3080 | movdqa xmm5,[ebx]
|
---|
3081 | movdqa xmm4,[32+ebx]
|
---|
3082 | mov ecx,7
|
---|
3083 | movdqu [edx-32],xmm0
|
---|
3084 | movdqa xmm1,xmm2
|
---|
3085 | movdqu [edx-16],xmm2
|
---|
3086 | L$132loop_key256:
|
---|
3087 | db 102,15,56,0,213
|
---|
3088 | db 102,15,56,221,212
|
---|
3089 | movdqa xmm3,xmm0
|
---|
3090 | pslldq xmm0,4
|
---|
3091 | pxor xmm3,xmm0
|
---|
3092 | pslldq xmm0,4
|
---|
3093 | pxor xmm3,xmm0
|
---|
3094 | pslldq xmm0,4
|
---|
3095 | pxor xmm0,xmm3
|
---|
3096 | pslld xmm4,1
|
---|
3097 | pxor xmm0,xmm2
|
---|
3098 | movdqu [edx],xmm0
|
---|
3099 | dec ecx
|
---|
3100 | jz NEAR L$133done_key256
|
---|
3101 | pshufd xmm2,xmm0,255
|
---|
3102 | pxor xmm3,xmm3
|
---|
3103 | db 102,15,56,221,211
|
---|
3104 | movdqa xmm3,xmm1
|
---|
3105 | pslldq xmm1,4
|
---|
3106 | pxor xmm3,xmm1
|
---|
3107 | pslldq xmm1,4
|
---|
3108 | pxor xmm3,xmm1
|
---|
3109 | pslldq xmm1,4
|
---|
3110 | pxor xmm1,xmm3
|
---|
3111 | pxor xmm2,xmm1
|
---|
3112 | movdqu [16+edx],xmm2
|
---|
3113 | lea edx,[32+edx]
|
---|
3114 | movdqa xmm1,xmm2
|
---|
3115 | jmp NEAR L$132loop_key256
|
---|
3116 | L$133done_key256:
|
---|
3117 | mov ecx,13
|
---|
3118 | mov DWORD [16+edx],ecx
|
---|
3119 | L$120good_key:
|
---|
3120 | pxor xmm0,xmm0
|
---|
3121 | pxor xmm1,xmm1
|
---|
3122 | pxor xmm2,xmm2
|
---|
3123 | pxor xmm3,xmm3
|
---|
3124 | pxor xmm4,xmm4
|
---|
3125 | pxor xmm5,xmm5
|
---|
3126 | xor eax,eax
|
---|
3127 | pop ebx
|
---|
3128 | pop ebp
|
---|
3129 | ret
|
---|
3130 | align 4
|
---|
3131 | L$111bad_pointer:
|
---|
3132 | mov eax,-1
|
---|
3133 | pop ebx
|
---|
3134 | pop ebp
|
---|
3135 | ret
|
---|
3136 | align 4
|
---|
3137 | L$115bad_keybits:
|
---|
3138 | pxor xmm0,xmm0
|
---|
3139 | mov eax,-2
|
---|
3140 | pop ebx
|
---|
3141 | pop ebp
|
---|
3142 | ret
|
---|
3143 | global _aesni_set_encrypt_key
|
---|
3144 | align 16
|
---|
3145 | _aesni_set_encrypt_key:
|
---|
3146 | L$_aesni_set_encrypt_key_begin:
|
---|
3147 | mov eax,DWORD [4+esp]
|
---|
3148 | mov ecx,DWORD [8+esp]
|
---|
3149 | mov edx,DWORD [12+esp]
|
---|
3150 | call __aesni_set_encrypt_key
|
---|
3151 | ret
|
---|
3152 | global _aesni_set_decrypt_key
|
---|
3153 | align 16
|
---|
3154 | _aesni_set_decrypt_key:
|
---|
3155 | L$_aesni_set_decrypt_key_begin:
|
---|
3156 | mov eax,DWORD [4+esp]
|
---|
3157 | mov ecx,DWORD [8+esp]
|
---|
3158 | mov edx,DWORD [12+esp]
|
---|
3159 | call __aesni_set_encrypt_key
|
---|
3160 | mov edx,DWORD [12+esp]
|
---|
3161 | shl ecx,4
|
---|
3162 | test eax,eax
|
---|
3163 | jnz NEAR L$134dec_key_ret
|
---|
3164 | lea eax,[16+ecx*1+edx]
|
---|
3165 | movups xmm0,[edx]
|
---|
3166 | movups xmm1,[eax]
|
---|
3167 | movups [eax],xmm0
|
---|
3168 | movups [edx],xmm1
|
---|
3169 | lea edx,[16+edx]
|
---|
3170 | lea eax,[eax-16]
|
---|
3171 | L$135dec_key_inverse:
|
---|
3172 | movups xmm0,[edx]
|
---|
3173 | movups xmm1,[eax]
|
---|
3174 | db 102,15,56,219,192
|
---|
3175 | db 102,15,56,219,201
|
---|
3176 | lea edx,[16+edx]
|
---|
3177 | lea eax,[eax-16]
|
---|
3178 | movups [16+eax],xmm0
|
---|
3179 | movups [edx-16],xmm1
|
---|
3180 | cmp eax,edx
|
---|
3181 | ja NEAR L$135dec_key_inverse
|
---|
3182 | movups xmm0,[edx]
|
---|
3183 | db 102,15,56,219,192
|
---|
3184 | movups [edx],xmm0
|
---|
3185 | pxor xmm0,xmm0
|
---|
3186 | pxor xmm1,xmm1
|
---|
3187 | xor eax,eax
|
---|
3188 | L$134dec_key_ret:
|
---|
3189 | ret
|
---|
3190 | align 64
|
---|
3191 | L$key_const:
|
---|
3192 | dd 202313229,202313229,202313229,202313229
|
---|
3193 | dd 67569157,67569157,67569157,67569157
|
---|
3194 | dd 1,1,1,1
|
---|
3195 | dd 27,27,27,27
|
---|
3196 | db 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
|
---|
3197 | db 83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
|
---|
3198 | db 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
|
---|
3199 | db 115,108,46,111,114,103,62,0
|
---|
3200 | segment .bss
|
---|
3201 | common _OPENSSL_ia32cap_P 16
|
---|