diff options
Diffstat (limited to 'src/lib/libcrypto/aes/asm/aesni-x86_64.pl')
-rw-r--r-- | src/lib/libcrypto/aes/asm/aesni-x86_64.pl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl index d394e6f696..c261a37958 100644 --- a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl | |||
@@ -242,6 +242,7 @@ $code.=<<___; | |||
242 | .type ${PREFIX}_encrypt,\@abi-omnipotent | 242 | .type ${PREFIX}_encrypt,\@abi-omnipotent |
243 | .align 16 | 243 | .align 16 |
244 | ${PREFIX}_encrypt: | 244 | ${PREFIX}_encrypt: |
245 | endbr64 | ||
245 | movups ($inp),$inout0 # load input | 246 | movups ($inp),$inout0 # load input |
246 | mov 240($key),$rounds # key->rounds | 247 | mov 240($key),$rounds # key->rounds |
247 | ___ | 248 | ___ |
@@ -255,6 +256,7 @@ $code.=<<___; | |||
255 | .type ${PREFIX}_decrypt,\@abi-omnipotent | 256 | .type ${PREFIX}_decrypt,\@abi-omnipotent |
256 | .align 16 | 257 | .align 16 |
257 | ${PREFIX}_decrypt: | 258 | ${PREFIX}_decrypt: |
259 | endbr64 | ||
258 | movups ($inp),$inout0 # load input | 260 | movups ($inp),$inout0 # load input |
259 | mov 240($key),$rounds # key->rounds | 261 | mov 240($key),$rounds # key->rounds |
260 | ___ | 262 | ___ |
@@ -284,6 +286,7 @@ $code.=<<___; | |||
284 | .type _aesni_${dir}rypt3,\@abi-omnipotent | 286 | .type _aesni_${dir}rypt3,\@abi-omnipotent |
285 | .align 16 | 287 | .align 16 |
286 | _aesni_${dir}rypt3: | 288 | _aesni_${dir}rypt3: |
289 | endbr64 | ||
287 | $movkey ($key),$rndkey0 | 290 | $movkey ($key),$rndkey0 |
288 | shr \$1,$rounds | 291 | shr \$1,$rounds |
289 | $movkey 16($key),$rndkey1 | 292 | $movkey 16($key),$rndkey1 |
@@ -328,6 +331,7 @@ $code.=<<___; | |||
328 | .type _aesni_${dir}rypt4,\@abi-omnipotent | 331 | .type _aesni_${dir}rypt4,\@abi-omnipotent |
329 | .align 16 | 332 | .align 16 |
330 | _aesni_${dir}rypt4: | 333 | _aesni_${dir}rypt4: |
334 | endbr64 | ||
331 | $movkey ($key),$rndkey0 | 335 | $movkey ($key),$rndkey0 |
332 | shr \$1,$rounds | 336 | shr \$1,$rounds |
333 | $movkey 16($key),$rndkey1 | 337 | $movkey 16($key),$rndkey1 |
@@ -373,6 +377,7 @@ $code.=<<___; | |||
373 | .type _aesni_${dir}rypt6,\@abi-omnipotent | 377 | .type _aesni_${dir}rypt6,\@abi-omnipotent |
374 | .align 16 | 378 | .align 16 |
375 | _aesni_${dir}rypt6: | 379 | _aesni_${dir}rypt6: |
380 | endbr64 | ||
376 | $movkey ($key),$rndkey0 | 381 | $movkey ($key),$rndkey0 |
377 | shr \$1,$rounds | 382 | shr \$1,$rounds |
378 | $movkey 16($key),$rndkey1 | 383 | $movkey 16($key),$rndkey1 |
@@ -437,6 +442,7 @@ $code.=<<___; | |||
437 | .type _aesni_${dir}rypt8,\@abi-omnipotent | 442 | .type _aesni_${dir}rypt8,\@abi-omnipotent |
438 | .align 16 | 443 | .align 16 |
439 | _aesni_${dir}rypt8: | 444 | _aesni_${dir}rypt8: |
445 | endbr64 | ||
440 | $movkey ($key),$rndkey0 | 446 | $movkey ($key),$rndkey0 |
441 | shr \$1,$rounds | 447 | shr \$1,$rounds |
442 | $movkey 16($key),$rndkey1 | 448 | $movkey 16($key),$rndkey1 |
@@ -525,6 +531,7 @@ $code.=<<___; | |||
525 | .type aesni_ecb_encrypt,\@function,5 | 531 | .type aesni_ecb_encrypt,\@function,5 |
526 | .align 16 | 532 | .align 16 |
527 | aesni_ecb_encrypt: | 533 | aesni_ecb_encrypt: |
534 | endbr64 | ||
528 | and \$-16,$len | 535 | and \$-16,$len |
529 | jz .Lecb_ret | 536 | jz .Lecb_ret |
530 | 537 | ||
@@ -830,6 +837,7 @@ $code.=<<___; | |||
830 | .type aesni_ccm64_encrypt_blocks,\@function,6 | 837 | .type aesni_ccm64_encrypt_blocks,\@function,6 |
831 | .align 16 | 838 | .align 16 |
832 | aesni_ccm64_encrypt_blocks: | 839 | aesni_ccm64_encrypt_blocks: |
840 | endbr64 | ||
833 | ___ | 841 | ___ |
834 | $code.=<<___ if ($win64); | 842 | $code.=<<___ if ($win64); |
835 | lea -0x58(%rsp),%rsp | 843 | lea -0x58(%rsp),%rsp |
@@ -2478,6 +2486,7 @@ $code.=<<___; | |||
2478 | .type ${PREFIX}_set_decrypt_key,\@abi-omnipotent | 2486 | .type ${PREFIX}_set_decrypt_key,\@abi-omnipotent |
2479 | .align 16 | 2487 | .align 16 |
2480 | ${PREFIX}_set_decrypt_key: | 2488 | ${PREFIX}_set_decrypt_key: |
2489 | endbr64 | ||
2481 | sub \$8,%rsp | 2490 | sub \$8,%rsp |
2482 | call __aesni_set_encrypt_key | 2491 | call __aesni_set_encrypt_key |
2483 | shl \$4,$bits # rounds-1 after _aesni_set_encrypt_key | 2492 | shl \$4,$bits # rounds-1 after _aesni_set_encrypt_key |
@@ -2528,6 +2537,7 @@ $code.=<<___; | |||
2528 | .type ${PREFIX}_set_encrypt_key,\@abi-omnipotent | 2537 | .type ${PREFIX}_set_encrypt_key,\@abi-omnipotent |
2529 | .align 16 | 2538 | .align 16 |
2530 | ${PREFIX}_set_encrypt_key: | 2539 | ${PREFIX}_set_encrypt_key: |
2540 | endbr64 | ||
2531 | __aesni_set_encrypt_key: | 2541 | __aesni_set_encrypt_key: |
2532 | sub \$8,%rsp | 2542 | sub \$8,%rsp |
2533 | mov \$-1,%rax | 2543 | mov \$-1,%rax |
@@ -2749,6 +2759,7 @@ $code.=<<___ if ($PREFIX eq "aesni"); | |||
2749 | .type ecb_se_handler,\@abi-omnipotent | 2759 | .type ecb_se_handler,\@abi-omnipotent |
2750 | .align 16 | 2760 | .align 16 |
2751 | ecb_se_handler: | 2761 | ecb_se_handler: |
2762 | endbr64 | ||
2752 | push %rsi | 2763 | push %rsi |
2753 | push %rdi | 2764 | push %rdi |
2754 | push %rbx | 2765 | push %rbx |
@@ -2768,6 +2779,7 @@ ecb_se_handler: | |||
2768 | .type ccm64_se_handler,\@abi-omnipotent | 2779 | .type ccm64_se_handler,\@abi-omnipotent |
2769 | .align 16 | 2780 | .align 16 |
2770 | ccm64_se_handler: | 2781 | ccm64_se_handler: |
2782 | endbr64 | ||
2771 | push %rsi | 2783 | push %rsi |
2772 | push %rdi | 2784 | push %rdi |
2773 | push %rbx | 2785 | push %rbx |
@@ -2809,6 +2821,7 @@ ccm64_se_handler: | |||
2809 | .type ctr32_se_handler,\@abi-omnipotent | 2821 | .type ctr32_se_handler,\@abi-omnipotent |
2810 | .align 16 | 2822 | .align 16 |
2811 | ctr32_se_handler: | 2823 | ctr32_se_handler: |
2824 | endbr64 | ||
2812 | push %rsi | 2825 | push %rsi |
2813 | push %rdi | 2826 | push %rdi |
2814 | push %rbx | 2827 | push %rbx |
@@ -2844,6 +2857,7 @@ ctr32_se_handler: | |||
2844 | .type xts_se_handler,\@abi-omnipotent | 2857 | .type xts_se_handler,\@abi-omnipotent |
2845 | .align 16 | 2858 | .align 16 |
2846 | xts_se_handler: | 2859 | xts_se_handler: |
2860 | endbr64 | ||
2847 | push %rsi | 2861 | push %rsi |
2848 | push %rdi | 2862 | push %rdi |
2849 | push %rbx | 2863 | push %rbx |
@@ -2885,6 +2899,7 @@ $code.=<<___; | |||
2885 | .type cbc_se_handler,\@abi-omnipotent | 2899 | .type cbc_se_handler,\@abi-omnipotent |
2886 | .align 16 | 2900 | .align 16 |
2887 | cbc_se_handler: | 2901 | cbc_se_handler: |
2902 | endbr64 | ||
2888 | push %rsi | 2903 | push %rsi |
2889 | push %rdi | 2904 | push %rdi |
2890 | push %rbx | 2905 | push %rbx |