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 | align 64
|
---|
9 | L$_vpaes_consts:
|
---|
10 | dd 218628480,235210255,168496130,67568393
|
---|
11 | dd 252381056,17041926,33884169,51187212
|
---|
12 | dd 252645135,252645135,252645135,252645135
|
---|
13 | dd 1512730624,3266504856,1377990664,3401244816
|
---|
14 | dd 830229760,1275146365,2969422977,3447763452
|
---|
15 | dd 3411033600,2979783055,338359620,2782886510
|
---|
16 | dd 4209124096,907596821,221174255,1006095553
|
---|
17 | dd 191964160,3799684038,3164090317,1589111125
|
---|
18 | dd 182528256,1777043520,2877432650,3265356744
|
---|
19 | dd 1874708224,3503451415,3305285752,363511674
|
---|
20 | dd 1606117888,3487855781,1093350906,2384367825
|
---|
21 | dd 197121,67569157,134941193,202313229
|
---|
22 | dd 67569157,134941193,202313229,197121
|
---|
23 | dd 134941193,202313229,197121,67569157
|
---|
24 | dd 202313229,197121,67569157,134941193
|
---|
25 | dd 33619971,100992007,168364043,235736079
|
---|
26 | dd 235736079,33619971,100992007,168364043
|
---|
27 | dd 168364043,235736079,33619971,100992007
|
---|
28 | dd 100992007,168364043,235736079,33619971
|
---|
29 | dd 50462976,117835012,185207048,252579084
|
---|
30 | dd 252314880,51251460,117574920,184942860
|
---|
31 | dd 184682752,252054788,50987272,118359308
|
---|
32 | dd 118099200,185467140,251790600,50727180
|
---|
33 | dd 2946363062,528716217,1300004225,1881839624
|
---|
34 | dd 1532713819,1532713819,1532713819,1532713819
|
---|
35 | dd 3602276352,4288629033,3737020424,4153884961
|
---|
36 | dd 1354558464,32357713,2958822624,3775749553
|
---|
37 | dd 1201988352,132424512,1572796698,503232858
|
---|
38 | dd 2213177600,1597421020,4103937655,675398315
|
---|
39 | dd 2749646592,4273543773,1511898873,121693092
|
---|
40 | dd 3040248576,1103263732,2871565598,1608280554
|
---|
41 | dd 2236667136,2588920351,482954393,64377734
|
---|
42 | dd 3069987328,291237287,2117370568,3650299247
|
---|
43 | dd 533321216,3573750986,2572112006,1401264716
|
---|
44 | dd 1339849704,2721158661,548607111,3445553514
|
---|
45 | dd 2128193280,3054596040,2183486460,1257083700
|
---|
46 | dd 655635200,1165381986,3923443150,2344132524
|
---|
47 | dd 190078720,256924420,290342170,357187870
|
---|
48 | dd 1610966272,2263057382,4103205268,309794674
|
---|
49 | dd 2592527872,2233205587,1335446729,3402964816
|
---|
50 | dd 3973531904,3225098121,3002836325,1918774430
|
---|
51 | dd 3870401024,2102906079,2284471353,4117666579
|
---|
52 | dd 617007872,1021508343,366931923,691083277
|
---|
53 | dd 2528395776,3491914898,2968704004,1613121270
|
---|
54 | dd 3445188352,3247741094,844474987,4093578302
|
---|
55 | dd 651481088,1190302358,1689581232,574775300
|
---|
56 | dd 4289380608,206939853,2555985458,2489840491
|
---|
57 | dd 2130264064,327674451,3566485037,3349835193
|
---|
58 | dd 2470714624,316102159,3636825756,3393945945
|
---|
59 | db 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
|
---|
60 | db 111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
|
---|
61 | db 83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
|
---|
62 | db 114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
|
---|
63 | db 118,101,114,115,105,116,121,41,0
|
---|
64 | align 64
|
---|
65 | align 16
|
---|
66 | __vpaes_preheat:
|
---|
67 | add ebp,DWORD [esp]
|
---|
68 | movdqa xmm7,[ebp-48]
|
---|
69 | movdqa xmm6,[ebp-16]
|
---|
70 | ret
|
---|
71 | align 16
|
---|
72 | __vpaes_encrypt_core:
|
---|
73 | mov ecx,16
|
---|
74 | mov eax,DWORD [240+edx]
|
---|
75 | movdqa xmm1,xmm6
|
---|
76 | movdqa xmm2,[ebp]
|
---|
77 | pandn xmm1,xmm0
|
---|
78 | pand xmm0,xmm6
|
---|
79 | movdqu xmm5,[edx]
|
---|
80 | db 102,15,56,0,208
|
---|
81 | movdqa xmm0,[16+ebp]
|
---|
82 | pxor xmm2,xmm5
|
---|
83 | psrld xmm1,4
|
---|
84 | add edx,16
|
---|
85 | db 102,15,56,0,193
|
---|
86 | lea ebx,[192+ebp]
|
---|
87 | pxor xmm0,xmm2
|
---|
88 | jmp NEAR L$000enc_entry
|
---|
89 | align 16
|
---|
90 | L$001enc_loop:
|
---|
91 | movdqa xmm4,[32+ebp]
|
---|
92 | movdqa xmm0,[48+ebp]
|
---|
93 | db 102,15,56,0,226
|
---|
94 | db 102,15,56,0,195
|
---|
95 | pxor xmm4,xmm5
|
---|
96 | movdqa xmm5,[64+ebp]
|
---|
97 | pxor xmm0,xmm4
|
---|
98 | movdqa xmm1,[ecx*1+ebx-64]
|
---|
99 | db 102,15,56,0,234
|
---|
100 | movdqa xmm2,[80+ebp]
|
---|
101 | movdqa xmm4,[ecx*1+ebx]
|
---|
102 | db 102,15,56,0,211
|
---|
103 | movdqa xmm3,xmm0
|
---|
104 | pxor xmm2,xmm5
|
---|
105 | db 102,15,56,0,193
|
---|
106 | add edx,16
|
---|
107 | pxor xmm0,xmm2
|
---|
108 | db 102,15,56,0,220
|
---|
109 | add ecx,16
|
---|
110 | pxor xmm3,xmm0
|
---|
111 | db 102,15,56,0,193
|
---|
112 | and ecx,48
|
---|
113 | sub eax,1
|
---|
114 | pxor xmm0,xmm3
|
---|
115 | L$000enc_entry:
|
---|
116 | movdqa xmm1,xmm6
|
---|
117 | movdqa xmm5,[ebp-32]
|
---|
118 | pandn xmm1,xmm0
|
---|
119 | psrld xmm1,4
|
---|
120 | pand xmm0,xmm6
|
---|
121 | db 102,15,56,0,232
|
---|
122 | movdqa xmm3,xmm7
|
---|
123 | pxor xmm0,xmm1
|
---|
124 | db 102,15,56,0,217
|
---|
125 | movdqa xmm4,xmm7
|
---|
126 | pxor xmm3,xmm5
|
---|
127 | db 102,15,56,0,224
|
---|
128 | movdqa xmm2,xmm7
|
---|
129 | pxor xmm4,xmm5
|
---|
130 | db 102,15,56,0,211
|
---|
131 | movdqa xmm3,xmm7
|
---|
132 | pxor xmm2,xmm0
|
---|
133 | db 102,15,56,0,220
|
---|
134 | movdqu xmm5,[edx]
|
---|
135 | pxor xmm3,xmm1
|
---|
136 | jnz NEAR L$001enc_loop
|
---|
137 | movdqa xmm4,[96+ebp]
|
---|
138 | movdqa xmm0,[112+ebp]
|
---|
139 | db 102,15,56,0,226
|
---|
140 | pxor xmm4,xmm5
|
---|
141 | db 102,15,56,0,195
|
---|
142 | movdqa xmm1,[64+ecx*1+ebx]
|
---|
143 | pxor xmm0,xmm4
|
---|
144 | db 102,15,56,0,193
|
---|
145 | ret
|
---|
146 | align 16
|
---|
147 | __vpaes_decrypt_core:
|
---|
148 | lea ebx,[608+ebp]
|
---|
149 | mov eax,DWORD [240+edx]
|
---|
150 | movdqa xmm1,xmm6
|
---|
151 | movdqa xmm2,[ebx-64]
|
---|
152 | pandn xmm1,xmm0
|
---|
153 | mov ecx,eax
|
---|
154 | psrld xmm1,4
|
---|
155 | movdqu xmm5,[edx]
|
---|
156 | shl ecx,4
|
---|
157 | pand xmm0,xmm6
|
---|
158 | db 102,15,56,0,208
|
---|
159 | movdqa xmm0,[ebx-48]
|
---|
160 | xor ecx,48
|
---|
161 | db 102,15,56,0,193
|
---|
162 | and ecx,48
|
---|
163 | pxor xmm2,xmm5
|
---|
164 | movdqa xmm5,[176+ebp]
|
---|
165 | pxor xmm0,xmm2
|
---|
166 | add edx,16
|
---|
167 | lea ecx,[ecx*1+ebx-352]
|
---|
168 | jmp NEAR L$002dec_entry
|
---|
169 | align 16
|
---|
170 | L$003dec_loop:
|
---|
171 | movdqa xmm4,[ebx-32]
|
---|
172 | movdqa xmm1,[ebx-16]
|
---|
173 | db 102,15,56,0,226
|
---|
174 | db 102,15,56,0,203
|
---|
175 | pxor xmm0,xmm4
|
---|
176 | movdqa xmm4,[ebx]
|
---|
177 | pxor xmm0,xmm1
|
---|
178 | movdqa xmm1,[16+ebx]
|
---|
179 | db 102,15,56,0,226
|
---|
180 | db 102,15,56,0,197
|
---|
181 | db 102,15,56,0,203
|
---|
182 | pxor xmm0,xmm4
|
---|
183 | movdqa xmm4,[32+ebx]
|
---|
184 | pxor xmm0,xmm1
|
---|
185 | movdqa xmm1,[48+ebx]
|
---|
186 | db 102,15,56,0,226
|
---|
187 | db 102,15,56,0,197
|
---|
188 | db 102,15,56,0,203
|
---|
189 | pxor xmm0,xmm4
|
---|
190 | movdqa xmm4,[64+ebx]
|
---|
191 | pxor xmm0,xmm1
|
---|
192 | movdqa xmm1,[80+ebx]
|
---|
193 | db 102,15,56,0,226
|
---|
194 | db 102,15,56,0,197
|
---|
195 | db 102,15,56,0,203
|
---|
196 | pxor xmm0,xmm4
|
---|
197 | add edx,16
|
---|
198 | db 102,15,58,15,237,12
|
---|
199 | pxor xmm0,xmm1
|
---|
200 | sub eax,1
|
---|
201 | L$002dec_entry:
|
---|
202 | movdqa xmm1,xmm6
|
---|
203 | movdqa xmm2,[ebp-32]
|
---|
204 | pandn xmm1,xmm0
|
---|
205 | pand xmm0,xmm6
|
---|
206 | psrld xmm1,4
|
---|
207 | db 102,15,56,0,208
|
---|
208 | movdqa xmm3,xmm7
|
---|
209 | pxor xmm0,xmm1
|
---|
210 | db 102,15,56,0,217
|
---|
211 | movdqa xmm4,xmm7
|
---|
212 | pxor xmm3,xmm2
|
---|
213 | db 102,15,56,0,224
|
---|
214 | pxor xmm4,xmm2
|
---|
215 | movdqa xmm2,xmm7
|
---|
216 | db 102,15,56,0,211
|
---|
217 | movdqa xmm3,xmm7
|
---|
218 | pxor xmm2,xmm0
|
---|
219 | db 102,15,56,0,220
|
---|
220 | movdqu xmm0,[edx]
|
---|
221 | pxor xmm3,xmm1
|
---|
222 | jnz NEAR L$003dec_loop
|
---|
223 | movdqa xmm4,[96+ebx]
|
---|
224 | db 102,15,56,0,226
|
---|
225 | pxor xmm4,xmm0
|
---|
226 | movdqa xmm0,[112+ebx]
|
---|
227 | movdqa xmm2,[ecx]
|
---|
228 | db 102,15,56,0,195
|
---|
229 | pxor xmm0,xmm4
|
---|
230 | db 102,15,56,0,194
|
---|
231 | ret
|
---|
232 | align 16
|
---|
233 | __vpaes_schedule_core:
|
---|
234 | add ebp,DWORD [esp]
|
---|
235 | movdqu xmm0,[esi]
|
---|
236 | movdqa xmm2,[320+ebp]
|
---|
237 | movdqa xmm3,xmm0
|
---|
238 | lea ebx,[ebp]
|
---|
239 | movdqa [4+esp],xmm2
|
---|
240 | call __vpaes_schedule_transform
|
---|
241 | movdqa xmm7,xmm0
|
---|
242 | test edi,edi
|
---|
243 | jnz NEAR L$004schedule_am_decrypting
|
---|
244 | movdqu [edx],xmm0
|
---|
245 | jmp NEAR L$005schedule_go
|
---|
246 | L$004schedule_am_decrypting:
|
---|
247 | movdqa xmm1,[256+ecx*1+ebp]
|
---|
248 | db 102,15,56,0,217
|
---|
249 | movdqu [edx],xmm3
|
---|
250 | xor ecx,48
|
---|
251 | L$005schedule_go:
|
---|
252 | cmp eax,192
|
---|
253 | ja NEAR L$006schedule_256
|
---|
254 | je NEAR L$007schedule_192
|
---|
255 | L$008schedule_128:
|
---|
256 | mov eax,10
|
---|
257 | L$009loop_schedule_128:
|
---|
258 | call __vpaes_schedule_round
|
---|
259 | dec eax
|
---|
260 | jz NEAR L$010schedule_mangle_last
|
---|
261 | call __vpaes_schedule_mangle
|
---|
262 | jmp NEAR L$009loop_schedule_128
|
---|
263 | align 16
|
---|
264 | L$007schedule_192:
|
---|
265 | movdqu xmm0,[8+esi]
|
---|
266 | call __vpaes_schedule_transform
|
---|
267 | movdqa xmm6,xmm0
|
---|
268 | pxor xmm4,xmm4
|
---|
269 | movhlps xmm6,xmm4
|
---|
270 | mov eax,4
|
---|
271 | L$011loop_schedule_192:
|
---|
272 | call __vpaes_schedule_round
|
---|
273 | db 102,15,58,15,198,8
|
---|
274 | call __vpaes_schedule_mangle
|
---|
275 | call __vpaes_schedule_192_smear
|
---|
276 | call __vpaes_schedule_mangle
|
---|
277 | call __vpaes_schedule_round
|
---|
278 | dec eax
|
---|
279 | jz NEAR L$010schedule_mangle_last
|
---|
280 | call __vpaes_schedule_mangle
|
---|
281 | call __vpaes_schedule_192_smear
|
---|
282 | jmp NEAR L$011loop_schedule_192
|
---|
283 | align 16
|
---|
284 | L$006schedule_256:
|
---|
285 | movdqu xmm0,[16+esi]
|
---|
286 | call __vpaes_schedule_transform
|
---|
287 | mov eax,7
|
---|
288 | L$012loop_schedule_256:
|
---|
289 | call __vpaes_schedule_mangle
|
---|
290 | movdqa xmm6,xmm0
|
---|
291 | call __vpaes_schedule_round
|
---|
292 | dec eax
|
---|
293 | jz NEAR L$010schedule_mangle_last
|
---|
294 | call __vpaes_schedule_mangle
|
---|
295 | pshufd xmm0,xmm0,255
|
---|
296 | movdqa [20+esp],xmm7
|
---|
297 | movdqa xmm7,xmm6
|
---|
298 | call L$_vpaes_schedule_low_round
|
---|
299 | movdqa xmm7,[20+esp]
|
---|
300 | jmp NEAR L$012loop_schedule_256
|
---|
301 | align 16
|
---|
302 | L$010schedule_mangle_last:
|
---|
303 | lea ebx,[384+ebp]
|
---|
304 | test edi,edi
|
---|
305 | jnz NEAR L$013schedule_mangle_last_dec
|
---|
306 | movdqa xmm1,[256+ecx*1+ebp]
|
---|
307 | db 102,15,56,0,193
|
---|
308 | lea ebx,[352+ebp]
|
---|
309 | add edx,32
|
---|
310 | L$013schedule_mangle_last_dec:
|
---|
311 | add edx,-16
|
---|
312 | pxor xmm0,[336+ebp]
|
---|
313 | call __vpaes_schedule_transform
|
---|
314 | movdqu [edx],xmm0
|
---|
315 | pxor xmm0,xmm0
|
---|
316 | pxor xmm1,xmm1
|
---|
317 | pxor xmm2,xmm2
|
---|
318 | pxor xmm3,xmm3
|
---|
319 | pxor xmm4,xmm4
|
---|
320 | pxor xmm5,xmm5
|
---|
321 | pxor xmm6,xmm6
|
---|
322 | pxor xmm7,xmm7
|
---|
323 | ret
|
---|
324 | align 16
|
---|
325 | __vpaes_schedule_192_smear:
|
---|
326 | pshufd xmm1,xmm6,128
|
---|
327 | pshufd xmm0,xmm7,254
|
---|
328 | pxor xmm6,xmm1
|
---|
329 | pxor xmm1,xmm1
|
---|
330 | pxor xmm6,xmm0
|
---|
331 | movdqa xmm0,xmm6
|
---|
332 | movhlps xmm6,xmm1
|
---|
333 | ret
|
---|
334 | align 16
|
---|
335 | __vpaes_schedule_round:
|
---|
336 | movdqa xmm2,[8+esp]
|
---|
337 | pxor xmm1,xmm1
|
---|
338 | db 102,15,58,15,202,15
|
---|
339 | db 102,15,58,15,210,15
|
---|
340 | pxor xmm7,xmm1
|
---|
341 | pshufd xmm0,xmm0,255
|
---|
342 | db 102,15,58,15,192,1
|
---|
343 | movdqa [8+esp],xmm2
|
---|
344 | L$_vpaes_schedule_low_round:
|
---|
345 | movdqa xmm1,xmm7
|
---|
346 | pslldq xmm7,4
|
---|
347 | pxor xmm7,xmm1
|
---|
348 | movdqa xmm1,xmm7
|
---|
349 | pslldq xmm7,8
|
---|
350 | pxor xmm7,xmm1
|
---|
351 | pxor xmm7,[336+ebp]
|
---|
352 | movdqa xmm4,[ebp-16]
|
---|
353 | movdqa xmm5,[ebp-48]
|
---|
354 | movdqa xmm1,xmm4
|
---|
355 | pandn xmm1,xmm0
|
---|
356 | psrld xmm1,4
|
---|
357 | pand xmm0,xmm4
|
---|
358 | movdqa xmm2,[ebp-32]
|
---|
359 | db 102,15,56,0,208
|
---|
360 | pxor xmm0,xmm1
|
---|
361 | movdqa xmm3,xmm5
|
---|
362 | db 102,15,56,0,217
|
---|
363 | pxor xmm3,xmm2
|
---|
364 | movdqa xmm4,xmm5
|
---|
365 | db 102,15,56,0,224
|
---|
366 | pxor xmm4,xmm2
|
---|
367 | movdqa xmm2,xmm5
|
---|
368 | db 102,15,56,0,211
|
---|
369 | pxor xmm2,xmm0
|
---|
370 | movdqa xmm3,xmm5
|
---|
371 | db 102,15,56,0,220
|
---|
372 | pxor xmm3,xmm1
|
---|
373 | movdqa xmm4,[32+ebp]
|
---|
374 | db 102,15,56,0,226
|
---|
375 | movdqa xmm0,[48+ebp]
|
---|
376 | db 102,15,56,0,195
|
---|
377 | pxor xmm0,xmm4
|
---|
378 | pxor xmm0,xmm7
|
---|
379 | movdqa xmm7,xmm0
|
---|
380 | ret
|
---|
381 | align 16
|
---|
382 | __vpaes_schedule_transform:
|
---|
383 | movdqa xmm2,[ebp-16]
|
---|
384 | movdqa xmm1,xmm2
|
---|
385 | pandn xmm1,xmm0
|
---|
386 | psrld xmm1,4
|
---|
387 | pand xmm0,xmm2
|
---|
388 | movdqa xmm2,[ebx]
|
---|
389 | db 102,15,56,0,208
|
---|
390 | movdqa xmm0,[16+ebx]
|
---|
391 | db 102,15,56,0,193
|
---|
392 | pxor xmm0,xmm2
|
---|
393 | ret
|
---|
394 | align 16
|
---|
395 | __vpaes_schedule_mangle:
|
---|
396 | movdqa xmm4,xmm0
|
---|
397 | movdqa xmm5,[128+ebp]
|
---|
398 | test edi,edi
|
---|
399 | jnz NEAR L$014schedule_mangle_dec
|
---|
400 | add edx,16
|
---|
401 | pxor xmm4,[336+ebp]
|
---|
402 | db 102,15,56,0,229
|
---|
403 | movdqa xmm3,xmm4
|
---|
404 | db 102,15,56,0,229
|
---|
405 | pxor xmm3,xmm4
|
---|
406 | db 102,15,56,0,229
|
---|
407 | pxor xmm3,xmm4
|
---|
408 | jmp NEAR L$015schedule_mangle_both
|
---|
409 | align 16
|
---|
410 | L$014schedule_mangle_dec:
|
---|
411 | movdqa xmm2,[ebp-16]
|
---|
412 | lea esi,[416+ebp]
|
---|
413 | movdqa xmm1,xmm2
|
---|
414 | pandn xmm1,xmm4
|
---|
415 | psrld xmm1,4
|
---|
416 | pand xmm4,xmm2
|
---|
417 | movdqa xmm2,[esi]
|
---|
418 | db 102,15,56,0,212
|
---|
419 | movdqa xmm3,[16+esi]
|
---|
420 | db 102,15,56,0,217
|
---|
421 | pxor xmm3,xmm2
|
---|
422 | db 102,15,56,0,221
|
---|
423 | movdqa xmm2,[32+esi]
|
---|
424 | db 102,15,56,0,212
|
---|
425 | pxor xmm2,xmm3
|
---|
426 | movdqa xmm3,[48+esi]
|
---|
427 | db 102,15,56,0,217
|
---|
428 | pxor xmm3,xmm2
|
---|
429 | db 102,15,56,0,221
|
---|
430 | movdqa xmm2,[64+esi]
|
---|
431 | db 102,15,56,0,212
|
---|
432 | pxor xmm2,xmm3
|
---|
433 | movdqa xmm3,[80+esi]
|
---|
434 | db 102,15,56,0,217
|
---|
435 | pxor xmm3,xmm2
|
---|
436 | db 102,15,56,0,221
|
---|
437 | movdqa xmm2,[96+esi]
|
---|
438 | db 102,15,56,0,212
|
---|
439 | pxor xmm2,xmm3
|
---|
440 | movdqa xmm3,[112+esi]
|
---|
441 | db 102,15,56,0,217
|
---|
442 | pxor xmm3,xmm2
|
---|
443 | add edx,-16
|
---|
444 | L$015schedule_mangle_both:
|
---|
445 | movdqa xmm1,[256+ecx*1+ebp]
|
---|
446 | db 102,15,56,0,217
|
---|
447 | add ecx,-16
|
---|
448 | and ecx,48
|
---|
449 | movdqu [edx],xmm3
|
---|
450 | ret
|
---|
451 | global _vpaes_set_encrypt_key
|
---|
452 | align 16
|
---|
453 | _vpaes_set_encrypt_key:
|
---|
454 | L$_vpaes_set_encrypt_key_begin:
|
---|
455 | push ebp
|
---|
456 | push ebx
|
---|
457 | push esi
|
---|
458 | push edi
|
---|
459 | mov esi,DWORD [20+esp]
|
---|
460 | lea ebx,[esp-56]
|
---|
461 | mov eax,DWORD [24+esp]
|
---|
462 | and ebx,-16
|
---|
463 | mov edx,DWORD [28+esp]
|
---|
464 | xchg ebx,esp
|
---|
465 | mov DWORD [48+esp],ebx
|
---|
466 | mov ebx,eax
|
---|
467 | shr ebx,5
|
---|
468 | add ebx,5
|
---|
469 | mov DWORD [240+edx],ebx
|
---|
470 | mov ecx,48
|
---|
471 | mov edi,0
|
---|
472 | lea ebp,[(L$_vpaes_consts+0x30-L$016pic_point)]
|
---|
473 | call __vpaes_schedule_core
|
---|
474 | L$016pic_point:
|
---|
475 | mov esp,DWORD [48+esp]
|
---|
476 | xor eax,eax
|
---|
477 | pop edi
|
---|
478 | pop esi
|
---|
479 | pop ebx
|
---|
480 | pop ebp
|
---|
481 | ret
|
---|
482 | global _vpaes_set_decrypt_key
|
---|
483 | align 16
|
---|
484 | _vpaes_set_decrypt_key:
|
---|
485 | L$_vpaes_set_decrypt_key_begin:
|
---|
486 | push ebp
|
---|
487 | push ebx
|
---|
488 | push esi
|
---|
489 | push edi
|
---|
490 | mov esi,DWORD [20+esp]
|
---|
491 | lea ebx,[esp-56]
|
---|
492 | mov eax,DWORD [24+esp]
|
---|
493 | and ebx,-16
|
---|
494 | mov edx,DWORD [28+esp]
|
---|
495 | xchg ebx,esp
|
---|
496 | mov DWORD [48+esp],ebx
|
---|
497 | mov ebx,eax
|
---|
498 | shr ebx,5
|
---|
499 | add ebx,5
|
---|
500 | mov DWORD [240+edx],ebx
|
---|
501 | shl ebx,4
|
---|
502 | lea edx,[16+ebx*1+edx]
|
---|
503 | mov edi,1
|
---|
504 | mov ecx,eax
|
---|
505 | shr ecx,1
|
---|
506 | and ecx,32
|
---|
507 | xor ecx,32
|
---|
508 | lea ebp,[(L$_vpaes_consts+0x30-L$017pic_point)]
|
---|
509 | call __vpaes_schedule_core
|
---|
510 | L$017pic_point:
|
---|
511 | mov esp,DWORD [48+esp]
|
---|
512 | xor eax,eax
|
---|
513 | pop edi
|
---|
514 | pop esi
|
---|
515 | pop ebx
|
---|
516 | pop ebp
|
---|
517 | ret
|
---|
518 | global _vpaes_encrypt
|
---|
519 | align 16
|
---|
520 | _vpaes_encrypt:
|
---|
521 | L$_vpaes_encrypt_begin:
|
---|
522 | push ebp
|
---|
523 | push ebx
|
---|
524 | push esi
|
---|
525 | push edi
|
---|
526 | lea ebp,[(L$_vpaes_consts+0x30-L$018pic_point)]
|
---|
527 | call __vpaes_preheat
|
---|
528 | L$018pic_point:
|
---|
529 | mov esi,DWORD [20+esp]
|
---|
530 | lea ebx,[esp-56]
|
---|
531 | mov edi,DWORD [24+esp]
|
---|
532 | and ebx,-16
|
---|
533 | mov edx,DWORD [28+esp]
|
---|
534 | xchg ebx,esp
|
---|
535 | mov DWORD [48+esp],ebx
|
---|
536 | movdqu xmm0,[esi]
|
---|
537 | call __vpaes_encrypt_core
|
---|
538 | movdqu [edi],xmm0
|
---|
539 | mov esp,DWORD [48+esp]
|
---|
540 | pop edi
|
---|
541 | pop esi
|
---|
542 | pop ebx
|
---|
543 | pop ebp
|
---|
544 | ret
|
---|
545 | global _vpaes_decrypt
|
---|
546 | align 16
|
---|
547 | _vpaes_decrypt:
|
---|
548 | L$_vpaes_decrypt_begin:
|
---|
549 | push ebp
|
---|
550 | push ebx
|
---|
551 | push esi
|
---|
552 | push edi
|
---|
553 | lea ebp,[(L$_vpaes_consts+0x30-L$019pic_point)]
|
---|
554 | call __vpaes_preheat
|
---|
555 | L$019pic_point:
|
---|
556 | mov esi,DWORD [20+esp]
|
---|
557 | lea ebx,[esp-56]
|
---|
558 | mov edi,DWORD [24+esp]
|
---|
559 | and ebx,-16
|
---|
560 | mov edx,DWORD [28+esp]
|
---|
561 | xchg ebx,esp
|
---|
562 | mov DWORD [48+esp],ebx
|
---|
563 | movdqu xmm0,[esi]
|
---|
564 | call __vpaes_decrypt_core
|
---|
565 | movdqu [edi],xmm0
|
---|
566 | mov esp,DWORD [48+esp]
|
---|
567 | pop edi
|
---|
568 | pop esi
|
---|
569 | pop ebx
|
---|
570 | pop ebp
|
---|
571 | ret
|
---|
572 | global _vpaes_cbc_encrypt
|
---|
573 | align 16
|
---|
574 | _vpaes_cbc_encrypt:
|
---|
575 | L$_vpaes_cbc_encrypt_begin:
|
---|
576 | push ebp
|
---|
577 | push ebx
|
---|
578 | push esi
|
---|
579 | push edi
|
---|
580 | mov esi,DWORD [20+esp]
|
---|
581 | mov edi,DWORD [24+esp]
|
---|
582 | mov eax,DWORD [28+esp]
|
---|
583 | mov edx,DWORD [32+esp]
|
---|
584 | sub eax,16
|
---|
585 | jc NEAR L$020cbc_abort
|
---|
586 | lea ebx,[esp-56]
|
---|
587 | mov ebp,DWORD [36+esp]
|
---|
588 | and ebx,-16
|
---|
589 | mov ecx,DWORD [40+esp]
|
---|
590 | xchg ebx,esp
|
---|
591 | movdqu xmm1,[ebp]
|
---|
592 | sub edi,esi
|
---|
593 | mov DWORD [48+esp],ebx
|
---|
594 | mov DWORD [esp],edi
|
---|
595 | mov DWORD [4+esp],edx
|
---|
596 | mov DWORD [8+esp],ebp
|
---|
597 | mov edi,eax
|
---|
598 | lea ebp,[(L$_vpaes_consts+0x30-L$021pic_point)]
|
---|
599 | call __vpaes_preheat
|
---|
600 | L$021pic_point:
|
---|
601 | cmp ecx,0
|
---|
602 | je NEAR L$022cbc_dec_loop
|
---|
603 | jmp NEAR L$023cbc_enc_loop
|
---|
604 | align 16
|
---|
605 | L$023cbc_enc_loop:
|
---|
606 | movdqu xmm0,[esi]
|
---|
607 | pxor xmm0,xmm1
|
---|
608 | call __vpaes_encrypt_core
|
---|
609 | mov ebx,DWORD [esp]
|
---|
610 | mov edx,DWORD [4+esp]
|
---|
611 | movdqa xmm1,xmm0
|
---|
612 | movdqu [esi*1+ebx],xmm0
|
---|
613 | lea esi,[16+esi]
|
---|
614 | sub edi,16
|
---|
615 | jnc NEAR L$023cbc_enc_loop
|
---|
616 | jmp NEAR L$024cbc_done
|
---|
617 | align 16
|
---|
618 | L$022cbc_dec_loop:
|
---|
619 | movdqu xmm0,[esi]
|
---|
620 | movdqa [16+esp],xmm1
|
---|
621 | movdqa [32+esp],xmm0
|
---|
622 | call __vpaes_decrypt_core
|
---|
623 | mov ebx,DWORD [esp]
|
---|
624 | mov edx,DWORD [4+esp]
|
---|
625 | pxor xmm0,[16+esp]
|
---|
626 | movdqa xmm1,[32+esp]
|
---|
627 | movdqu [esi*1+ebx],xmm0
|
---|
628 | lea esi,[16+esi]
|
---|
629 | sub edi,16
|
---|
630 | jnc NEAR L$022cbc_dec_loop
|
---|
631 | L$024cbc_done:
|
---|
632 | mov ebx,DWORD [8+esp]
|
---|
633 | mov esp,DWORD [48+esp]
|
---|
634 | movdqu [ebx],xmm1
|
---|
635 | L$020cbc_abort:
|
---|
636 | pop edi
|
---|
637 | pop esi
|
---|
638 | pop ebx
|
---|
639 | pop ebp
|
---|
640 | ret
|
---|