diff options
| author | tb <> | 2024-02-24 15:30:14 +0000 |
|---|---|---|
| committer | tb <> | 2024-02-24 15:30:14 +0000 |
| commit | c730c3b3b1845cc7c4a4aceff2031f1135faa6bb (patch) | |
| tree | 162dfb371639bf1514d472f64e2a4d1279851907 /src/lib/libcrypto/aes | |
| parent | 1fc6cbdf068b16378dacfb22c3ce1e29313ee314 (diff) | |
| download | openbsd-c730c3b3b1845cc7c4a4aceff2031f1135faa6bb.tar.gz openbsd-c730c3b3b1845cc7c4a4aceff2031f1135faa6bb.tar.bz2 openbsd-c730c3b3b1845cc7c4a4aceff2031f1135faa6bb.zip | |
Replace uses of endbr64 with _CET_ENDBR from cet.h
cet.h is needed for other platforms to emit the relevant .gnu.properties
sections that are necessary for them to enable IBT. It also avoids issues
with older toolchains on macOS that explode on encountering endbr64.
based on a diff by kettenis
ok beck kettenis
Diffstat (limited to 'src/lib/libcrypto/aes')
| -rwxr-xr-x | src/lib/libcrypto/aes/asm/aes-x86_64.pl | 26 | ||||
| -rw-r--r-- | src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/aes/asm/aesni-x86_64.pl | 32 | ||||
| -rw-r--r-- | src/lib/libcrypto/aes/asm/bsaes-x86_64.pl | 28 | ||||
| -rw-r--r-- | src/lib/libcrypto/aes/asm/vpaes-x86_64.pl | 28 |
5 files changed, 61 insertions, 61 deletions
diff --git a/src/lib/libcrypto/aes/asm/aes-x86_64.pl b/src/lib/libcrypto/aes/asm/aes-x86_64.pl index 78ba20ca59..299214800b 100755 --- a/src/lib/libcrypto/aes/asm/aes-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/aes-x86_64.pl | |||
| @@ -318,7 +318,7 @@ $code.=<<___; | |||
| 318 | .type _x86_64_AES_encrypt,\@abi-omnipotent | 318 | .type _x86_64_AES_encrypt,\@abi-omnipotent |
| 319 | .align 16 | 319 | .align 16 |
| 320 | _x86_64_AES_encrypt: | 320 | _x86_64_AES_encrypt: |
| 321 | endbr64 | 321 | _CET_ENDBR |
| 322 | xor 0($key),$s0 # xor with key | 322 | xor 0($key),$s0 # xor with key |
| 323 | xor 4($key),$s1 | 323 | xor 4($key),$s1 |
| 324 | xor 8($key),$s2 | 324 | xor 8($key),$s2 |
| @@ -549,7 +549,7 @@ $code.=<<___; | |||
| 549 | .type _x86_64_AES_encrypt_compact,\@abi-omnipotent | 549 | .type _x86_64_AES_encrypt_compact,\@abi-omnipotent |
| 550 | .align 16 | 550 | .align 16 |
| 551 | _x86_64_AES_encrypt_compact: | 551 | _x86_64_AES_encrypt_compact: |
| 552 | endbr64 | 552 | _CET_ENDBR |
| 553 | lea 128($sbox),$inp # size optimization | 553 | lea 128($sbox),$inp # size optimization |
| 554 | mov 0-128($inp),$acc1 # prefetch Te4 | 554 | mov 0-128($inp),$acc1 # prefetch Te4 |
| 555 | mov 32-128($inp),$acc2 | 555 | mov 32-128($inp),$acc2 |
| @@ -595,7 +595,7 @@ $code.=<<___; | |||
| 595 | .hidden asm_AES_encrypt | 595 | .hidden asm_AES_encrypt |
| 596 | asm_AES_encrypt: | 596 | asm_AES_encrypt: |
| 597 | AES_encrypt: | 597 | AES_encrypt: |
| 598 | endbr64 | 598 | _CET_ENDBR |
| 599 | push %rbx | 599 | push %rbx |
| 600 | push %rbp | 600 | push %rbp |
| 601 | push %r12 | 601 | push %r12 |
| @@ -887,7 +887,7 @@ $code.=<<___; | |||
| 887 | .type _x86_64_AES_decrypt,\@abi-omnipotent | 887 | .type _x86_64_AES_decrypt,\@abi-omnipotent |
| 888 | .align 16 | 888 | .align 16 |
| 889 | _x86_64_AES_decrypt: | 889 | _x86_64_AES_decrypt: |
| 890 | endbr64 | 890 | _CET_ENDBR |
| 891 | xor 0($key),$s0 # xor with key | 891 | xor 0($key),$s0 # xor with key |
| 892 | xor 4($key),$s1 | 892 | xor 4($key),$s1 |
| 893 | xor 8($key),$s2 | 893 | xor 8($key),$s2 |
| @@ -1142,7 +1142,7 @@ $code.=<<___; | |||
| 1142 | .type _x86_64_AES_decrypt_compact,\@abi-omnipotent | 1142 | .type _x86_64_AES_decrypt_compact,\@abi-omnipotent |
| 1143 | .align 16 | 1143 | .align 16 |
| 1144 | _x86_64_AES_decrypt_compact: | 1144 | _x86_64_AES_decrypt_compact: |
| 1145 | endbr64 | 1145 | _CET_ENDBR |
| 1146 | lea 128($sbox),$inp # size optimization | 1146 | lea 128($sbox),$inp # size optimization |
| 1147 | mov 0-128($inp),$acc1 # prefetch Td4 | 1147 | mov 0-128($inp),$acc1 # prefetch Td4 |
| 1148 | mov 32-128($inp),$acc2 | 1148 | mov 32-128($inp),$acc2 |
| @@ -1197,7 +1197,7 @@ $code.=<<___; | |||
| 1197 | .hidden asm_AES_decrypt | 1197 | .hidden asm_AES_decrypt |
| 1198 | asm_AES_decrypt: | 1198 | asm_AES_decrypt: |
| 1199 | AES_decrypt: | 1199 | AES_decrypt: |
| 1200 | endbr64 | 1200 | _CET_ENDBR |
| 1201 | push %rbx | 1201 | push %rbx |
| 1202 | push %rbp | 1202 | push %rbp |
| 1203 | push %r12 | 1203 | push %r12 |
| @@ -1297,7 +1297,7 @@ $code.=<<___; | |||
| 1297 | .type AES_set_encrypt_key,\@function,3 | 1297 | .type AES_set_encrypt_key,\@function,3 |
| 1298 | .align 16 | 1298 | .align 16 |
| 1299 | AES_set_encrypt_key: | 1299 | AES_set_encrypt_key: |
| 1300 | endbr64 | 1300 | _CET_ENDBR |
| 1301 | push %rbx | 1301 | push %rbx |
| 1302 | push %rbp | 1302 | push %rbp |
| 1303 | push %r12 # redundant, but allows to share | 1303 | push %r12 # redundant, but allows to share |
| @@ -1323,7 +1323,7 @@ AES_set_encrypt_key: | |||
| 1323 | .type _x86_64_AES_set_encrypt_key,\@abi-omnipotent | 1323 | .type _x86_64_AES_set_encrypt_key,\@abi-omnipotent |
| 1324 | .align 16 | 1324 | .align 16 |
| 1325 | _x86_64_AES_set_encrypt_key: | 1325 | _x86_64_AES_set_encrypt_key: |
| 1326 | endbr64 | 1326 | _CET_ENDBR |
| 1327 | mov %esi,%ecx # %ecx=bits | 1327 | mov %esi,%ecx # %ecx=bits |
| 1328 | mov %rdi,%rsi # %rsi=userKey | 1328 | mov %rdi,%rsi # %rsi=userKey |
| 1329 | mov %rdx,%rdi # %rdi=key | 1329 | mov %rdx,%rdi # %rdi=key |
| @@ -1569,7 +1569,7 @@ $code.=<<___; | |||
| 1569 | .type AES_set_decrypt_key,\@function,3 | 1569 | .type AES_set_decrypt_key,\@function,3 |
| 1570 | .align 16 | 1570 | .align 16 |
| 1571 | AES_set_decrypt_key: | 1571 | AES_set_decrypt_key: |
| 1572 | endbr64 | 1572 | _CET_ENDBR |
| 1573 | push %rbx | 1573 | push %rbx |
| 1574 | push %rbp | 1574 | push %rbp |
| 1575 | push %r12 | 1575 | push %r12 |
| @@ -1669,7 +1669,7 @@ $code.=<<___; | |||
| 1669 | .hidden asm_AES_cbc_encrypt | 1669 | .hidden asm_AES_cbc_encrypt |
| 1670 | asm_AES_cbc_encrypt: | 1670 | asm_AES_cbc_encrypt: |
| 1671 | AES_cbc_encrypt: | 1671 | AES_cbc_encrypt: |
| 1672 | endbr64 | 1672 | _CET_ENDBR |
| 1673 | cmp \$0,%rdx # check length | 1673 | cmp \$0,%rdx # check length |
| 1674 | je .Lcbc_epilogue | 1674 | je .Lcbc_epilogue |
| 1675 | pushfq | 1675 | pushfq |
| @@ -2561,7 +2561,7 @@ $code.=<<___; | |||
| 2561 | .type block_se_handler,\@abi-omnipotent | 2561 | .type block_se_handler,\@abi-omnipotent |
| 2562 | .align 16 | 2562 | .align 16 |
| 2563 | block_se_handler: | 2563 | block_se_handler: |
| 2564 | endbr64 | 2564 | _CET_ENDBR |
| 2565 | push %rsi | 2565 | push %rsi |
| 2566 | push %rdi | 2566 | push %rdi |
| 2567 | push %rbx | 2567 | push %rbx |
| @@ -2620,7 +2620,7 @@ block_se_handler: | |||
| 2620 | .type key_se_handler,\@abi-omnipotent | 2620 | .type key_se_handler,\@abi-omnipotent |
| 2621 | .align 16 | 2621 | .align 16 |
| 2622 | key_se_handler: | 2622 | key_se_handler: |
| 2623 | endbr64 | 2623 | _CET_ENDBR |
| 2624 | push %rsi | 2624 | push %rsi |
| 2625 | push %rdi | 2625 | push %rdi |
| 2626 | push %rbx | 2626 | push %rbx |
| @@ -2678,7 +2678,7 @@ key_se_handler: | |||
| 2678 | .type cbc_se_handler,\@abi-omnipotent | 2678 | .type cbc_se_handler,\@abi-omnipotent |
| 2679 | .align 16 | 2679 | .align 16 |
| 2680 | cbc_se_handler: | 2680 | cbc_se_handler: |
| 2681 | endbr64 | 2681 | _CET_ENDBR |
| 2682 | push %rsi | 2682 | push %rsi |
| 2683 | push %rdi | 2683 | push %rdi |
| 2684 | push %rbx | 2684 | push %rbx |
diff --git a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl index 879d16793f..5eb5b7bf65 100644 --- a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl | |||
| @@ -89,7 +89,7 @@ $code.=<<___; | |||
| 89 | .type aesni_cbc_sha1_enc,\@abi-omnipotent | 89 | .type aesni_cbc_sha1_enc,\@abi-omnipotent |
| 90 | .align 16 | 90 | .align 16 |
| 91 | aesni_cbc_sha1_enc: | 91 | aesni_cbc_sha1_enc: |
| 92 | endbr64 | 92 | _CET_ENDBR |
| 93 | # caller should check for SSSE3 and AES-NI bits | 93 | # caller should check for SSSE3 and AES-NI bits |
| 94 | mov OPENSSL_ia32cap_P+0(%rip),%r10d | 94 | mov OPENSSL_ia32cap_P+0(%rip),%r10d |
| 95 | mov OPENSSL_ia32cap_P+4(%rip),%r11d | 95 | mov OPENSSL_ia32cap_P+4(%rip),%r11d |
| @@ -133,7 +133,7 @@ $code.=<<___; | |||
| 133 | .type aesni_cbc_sha1_enc_ssse3,\@function,6 | 133 | .type aesni_cbc_sha1_enc_ssse3,\@function,6 |
| 134 | .align 16 | 134 | .align 16 |
| 135 | aesni_cbc_sha1_enc_ssse3: | 135 | aesni_cbc_sha1_enc_ssse3: |
| 136 | endbr64 | 136 | _CET_ENDBR |
| 137 | mov `($win64?56:8)`(%rsp),$inp # load 7th argument | 137 | mov `($win64?56:8)`(%rsp),$inp # load 7th argument |
| 138 | #shr \$6,$len # debugging artefact | 138 | #shr \$6,$len # debugging artefact |
| 139 | #jz .Lepilogue_ssse3 # debugging artefact | 139 | #jz .Lepilogue_ssse3 # debugging artefact |
| @@ -652,7 +652,7 @@ $code.=<<___; | |||
| 652 | .type aesni_cbc_sha1_enc_avx,\@function,6 | 652 | .type aesni_cbc_sha1_enc_avx,\@function,6 |
| 653 | .align 16 | 653 | .align 16 |
| 654 | aesni_cbc_sha1_enc_avx: | 654 | aesni_cbc_sha1_enc_avx: |
| 655 | endbr64 | 655 | _CET_ENDBR |
| 656 | mov `($win64?56:8)`(%rsp),$inp # load 7th argument | 656 | mov `($win64?56:8)`(%rsp),$inp # load 7th argument |
| 657 | #shr \$6,$len # debugging artefact | 657 | #shr \$6,$len # debugging artefact |
| 658 | #jz .Lepilogue_avx # debugging artefact | 658 | #jz .Lepilogue_avx # debugging artefact |
| @@ -1103,7 +1103,7 @@ $code.=<<___; | |||
| 1103 | .type ssse3_handler,\@abi-omnipotent | 1103 | .type ssse3_handler,\@abi-omnipotent |
| 1104 | .align 16 | 1104 | .align 16 |
| 1105 | ssse3_handler: | 1105 | ssse3_handler: |
| 1106 | endbr64 | 1106 | _CET_ENDBR |
| 1107 | push %rsi | 1107 | push %rsi |
| 1108 | push %rdi | 1108 | push %rdi |
| 1109 | push %rbx | 1109 | push %rbx |
diff --git a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl index 07d40a84ab..43013a51fb 100644 --- a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl | |||
| @@ -242,7 +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 | _CET_ENDBR |
| 246 | movups ($inp),$inout0 # load input | 246 | movups ($inp),$inout0 # load input |
| 247 | mov 240($key),$rounds # key->rounds | 247 | mov 240($key),$rounds # key->rounds |
| 248 | ___ | 248 | ___ |
| @@ -256,7 +256,7 @@ $code.=<<___; | |||
| 256 | .type ${PREFIX}_decrypt,\@abi-omnipotent | 256 | .type ${PREFIX}_decrypt,\@abi-omnipotent |
| 257 | .align 16 | 257 | .align 16 |
| 258 | ${PREFIX}_decrypt: | 258 | ${PREFIX}_decrypt: |
| 259 | endbr64 | 259 | _CET_ENDBR |
| 260 | movups ($inp),$inout0 # load input | 260 | movups ($inp),$inout0 # load input |
| 261 | mov 240($key),$rounds # key->rounds | 261 | mov 240($key),$rounds # key->rounds |
| 262 | ___ | 262 | ___ |
| @@ -286,7 +286,7 @@ $code.=<<___; | |||
| 286 | .type _aesni_${dir}rypt3,\@abi-omnipotent | 286 | .type _aesni_${dir}rypt3,\@abi-omnipotent |
| 287 | .align 16 | 287 | .align 16 |
| 288 | _aesni_${dir}rypt3: | 288 | _aesni_${dir}rypt3: |
| 289 | endbr64 | 289 | _CET_ENDBR |
| 290 | $movkey ($key),$rndkey0 | 290 | $movkey ($key),$rndkey0 |
| 291 | shr \$1,$rounds | 291 | shr \$1,$rounds |
| 292 | $movkey 16($key),$rndkey1 | 292 | $movkey 16($key),$rndkey1 |
| @@ -331,7 +331,7 @@ $code.=<<___; | |||
| 331 | .type _aesni_${dir}rypt4,\@abi-omnipotent | 331 | .type _aesni_${dir}rypt4,\@abi-omnipotent |
| 332 | .align 16 | 332 | .align 16 |
| 333 | _aesni_${dir}rypt4: | 333 | _aesni_${dir}rypt4: |
| 334 | endbr64 | 334 | _CET_ENDBR |
| 335 | $movkey ($key),$rndkey0 | 335 | $movkey ($key),$rndkey0 |
| 336 | shr \$1,$rounds | 336 | shr \$1,$rounds |
| 337 | $movkey 16($key),$rndkey1 | 337 | $movkey 16($key),$rndkey1 |
| @@ -377,7 +377,7 @@ $code.=<<___; | |||
| 377 | .type _aesni_${dir}rypt6,\@abi-omnipotent | 377 | .type _aesni_${dir}rypt6,\@abi-omnipotent |
| 378 | .align 16 | 378 | .align 16 |
| 379 | _aesni_${dir}rypt6: | 379 | _aesni_${dir}rypt6: |
| 380 | endbr64 | 380 | _CET_ENDBR |
| 381 | $movkey ($key),$rndkey0 | 381 | $movkey ($key),$rndkey0 |
| 382 | shr \$1,$rounds | 382 | shr \$1,$rounds |
| 383 | $movkey 16($key),$rndkey1 | 383 | $movkey 16($key),$rndkey1 |
| @@ -442,7 +442,7 @@ $code.=<<___; | |||
| 442 | .type _aesni_${dir}rypt8,\@abi-omnipotent | 442 | .type _aesni_${dir}rypt8,\@abi-omnipotent |
| 443 | .align 16 | 443 | .align 16 |
| 444 | _aesni_${dir}rypt8: | 444 | _aesni_${dir}rypt8: |
| 445 | endbr64 | 445 | _CET_ENDBR |
| 446 | $movkey ($key),$rndkey0 | 446 | $movkey ($key),$rndkey0 |
| 447 | shr \$1,$rounds | 447 | shr \$1,$rounds |
| 448 | $movkey 16($key),$rndkey1 | 448 | $movkey 16($key),$rndkey1 |
| @@ -531,7 +531,7 @@ $code.=<<___; | |||
| 531 | .type aesni_ecb_encrypt,\@function,5 | 531 | .type aesni_ecb_encrypt,\@function,5 |
| 532 | .align 16 | 532 | .align 16 |
| 533 | aesni_ecb_encrypt: | 533 | aesni_ecb_encrypt: |
| 534 | endbr64 | 534 | _CET_ENDBR |
| 535 | and \$-16,$len | 535 | and \$-16,$len |
| 536 | jz .Lecb_ret | 536 | jz .Lecb_ret |
| 537 | 537 | ||
| @@ -837,7 +837,7 @@ $code.=<<___; | |||
| 837 | .type aesni_ccm64_encrypt_blocks,\@function,6 | 837 | .type aesni_ccm64_encrypt_blocks,\@function,6 |
| 838 | .align 16 | 838 | .align 16 |
| 839 | aesni_ccm64_encrypt_blocks: | 839 | aesni_ccm64_encrypt_blocks: |
| 840 | endbr64 | 840 | _CET_ENDBR |
| 841 | ___ | 841 | ___ |
| 842 | $code.=<<___ if ($win64); | 842 | $code.=<<___ if ($win64); |
| 843 | lea -0x58(%rsp),%rsp | 843 | lea -0x58(%rsp),%rsp |
| @@ -1025,7 +1025,7 @@ $code.=<<___; | |||
| 1025 | .type aesni_ctr32_encrypt_blocks,\@function,5 | 1025 | .type aesni_ctr32_encrypt_blocks,\@function,5 |
| 1026 | .align 16 | 1026 | .align 16 |
| 1027 | aesni_ctr32_encrypt_blocks: | 1027 | aesni_ctr32_encrypt_blocks: |
| 1028 | endbr64 | 1028 | _CET_ENDBR |
| 1029 | lea (%rsp),%rax | 1029 | lea (%rsp),%rax |
| 1030 | push %rbp | 1030 | push %rbp |
| 1031 | sub \$$frame_size,%rsp | 1031 | sub \$$frame_size,%rsp |
| @@ -2487,7 +2487,7 @@ $code.=<<___; | |||
| 2487 | .type ${PREFIX}_set_decrypt_key,\@abi-omnipotent | 2487 | .type ${PREFIX}_set_decrypt_key,\@abi-omnipotent |
| 2488 | .align 16 | 2488 | .align 16 |
| 2489 | ${PREFIX}_set_decrypt_key: | 2489 | ${PREFIX}_set_decrypt_key: |
| 2490 | endbr64 | 2490 | _CET_ENDBR |
| 2491 | sub \$8,%rsp | 2491 | sub \$8,%rsp |
| 2492 | call __aesni_set_encrypt_key | 2492 | call __aesni_set_encrypt_key |
| 2493 | shl \$4,$bits # rounds-1 after _aesni_set_encrypt_key | 2493 | shl \$4,$bits # rounds-1 after _aesni_set_encrypt_key |
| @@ -2538,7 +2538,7 @@ $code.=<<___; | |||
| 2538 | .type ${PREFIX}_set_encrypt_key,\@abi-omnipotent | 2538 | .type ${PREFIX}_set_encrypt_key,\@abi-omnipotent |
| 2539 | .align 16 | 2539 | .align 16 |
| 2540 | ${PREFIX}_set_encrypt_key: | 2540 | ${PREFIX}_set_encrypt_key: |
| 2541 | endbr64 | 2541 | _CET_ENDBR |
| 2542 | __aesni_set_encrypt_key: | 2542 | __aesni_set_encrypt_key: |
| 2543 | sub \$8,%rsp | 2543 | sub \$8,%rsp |
| 2544 | mov \$-1,%rax | 2544 | mov \$-1,%rax |
| @@ -2760,7 +2760,7 @@ $code.=<<___ if ($PREFIX eq "aesni"); | |||
| 2760 | .type ecb_se_handler,\@abi-omnipotent | 2760 | .type ecb_se_handler,\@abi-omnipotent |
| 2761 | .align 16 | 2761 | .align 16 |
| 2762 | ecb_se_handler: | 2762 | ecb_se_handler: |
| 2763 | endbr64 | 2763 | _CET_ENDBR |
| 2764 | push %rsi | 2764 | push %rsi |
| 2765 | push %rdi | 2765 | push %rdi |
| 2766 | push %rbx | 2766 | push %rbx |
| @@ -2780,7 +2780,7 @@ ecb_se_handler: | |||
| 2780 | .type ccm64_se_handler,\@abi-omnipotent | 2780 | .type ccm64_se_handler,\@abi-omnipotent |
| 2781 | .align 16 | 2781 | .align 16 |
| 2782 | ccm64_se_handler: | 2782 | ccm64_se_handler: |
| 2783 | endbr64 | 2783 | _CET_ENDBR |
| 2784 | push %rsi | 2784 | push %rsi |
| 2785 | push %rdi | 2785 | push %rdi |
| 2786 | push %rbx | 2786 | push %rbx |
| @@ -2822,7 +2822,7 @@ ccm64_se_handler: | |||
| 2822 | .type ctr32_se_handler,\@abi-omnipotent | 2822 | .type ctr32_se_handler,\@abi-omnipotent |
| 2823 | .align 16 | 2823 | .align 16 |
| 2824 | ctr32_se_handler: | 2824 | ctr32_se_handler: |
| 2825 | endbr64 | 2825 | _CET_ENDBR |
| 2826 | push %rsi | 2826 | push %rsi |
| 2827 | push %rdi | 2827 | push %rdi |
| 2828 | push %rbx | 2828 | push %rbx |
| @@ -2858,7 +2858,7 @@ ctr32_se_handler: | |||
| 2858 | .type xts_se_handler,\@abi-omnipotent | 2858 | .type xts_se_handler,\@abi-omnipotent |
| 2859 | .align 16 | 2859 | .align 16 |
| 2860 | xts_se_handler: | 2860 | xts_se_handler: |
| 2861 | endbr64 | 2861 | _CET_ENDBR |
| 2862 | push %rsi | 2862 | push %rsi |
| 2863 | push %rdi | 2863 | push %rdi |
| 2864 | push %rbx | 2864 | push %rbx |
| @@ -2900,7 +2900,7 @@ $code.=<<___; | |||
| 2900 | .type cbc_se_handler,\@abi-omnipotent | 2900 | .type cbc_se_handler,\@abi-omnipotent |
| 2901 | .align 16 | 2901 | .align 16 |
| 2902 | cbc_se_handler: | 2902 | cbc_se_handler: |
| 2903 | endbr64 | 2903 | _CET_ENDBR |
| 2904 | push %rsi | 2904 | push %rsi |
| 2905 | push %rdi | 2905 | push %rdi |
| 2906 | push %rbx | 2906 | push %rbx |
diff --git a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl index 7098ba27f4..c44a338114 100644 --- a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl | |||
| @@ -813,7 +813,7 @@ $code.=<<___; | |||
| 813 | .type _bsaes_encrypt8,\@abi-omnipotent | 813 | .type _bsaes_encrypt8,\@abi-omnipotent |
| 814 | .align 64 | 814 | .align 64 |
| 815 | _bsaes_encrypt8: | 815 | _bsaes_encrypt8: |
| 816 | endbr64 | 816 | _CET_ENDBR |
| 817 | lea .LBS0(%rip), $const # constants table | 817 | lea .LBS0(%rip), $const # constants table |
| 818 | 818 | ||
| 819 | movdqa ($key), @XMM[9] # round 0 key | 819 | movdqa ($key), @XMM[9] # round 0 key |
| @@ -878,7 +878,7 @@ $code.=<<___; | |||
| 878 | .type _bsaes_decrypt8,\@abi-omnipotent | 878 | .type _bsaes_decrypt8,\@abi-omnipotent |
| 879 | .align 64 | 879 | .align 64 |
| 880 | _bsaes_decrypt8: | 880 | _bsaes_decrypt8: |
| 881 | endbr64 | 881 | _CET_ENDBR |
| 882 | lea .LBS0(%rip), $const # constants table | 882 | lea .LBS0(%rip), $const # constants table |
| 883 | 883 | ||
| 884 | movdqa ($key), @XMM[9] # round 0 key | 884 | movdqa ($key), @XMM[9] # round 0 key |
| @@ -970,7 +970,7 @@ $code.=<<___; | |||
| 970 | .type _bsaes_key_convert,\@abi-omnipotent | 970 | .type _bsaes_key_convert,\@abi-omnipotent |
| 971 | .align 16 | 971 | .align 16 |
| 972 | _bsaes_key_convert: | 972 | _bsaes_key_convert: |
| 973 | endbr64 | 973 | _CET_ENDBR |
| 974 | lea .Lmasks(%rip), $const | 974 | lea .Lmasks(%rip), $const |
| 975 | movdqu ($inp), %xmm7 # load round 0 key | 975 | movdqu ($inp), %xmm7 # load round 0 key |
| 976 | lea 0x10($inp), $inp | 976 | lea 0x10($inp), $inp |
| @@ -1060,7 +1060,7 @@ $code.=<<___; | |||
| 1060 | .type bsaes_enc_key_convert,\@function,2 | 1060 | .type bsaes_enc_key_convert,\@function,2 |
| 1061 | .align 16 | 1061 | .align 16 |
| 1062 | bsaes_enc_key_convert: | 1062 | bsaes_enc_key_convert: |
| 1063 | endbr64 | 1063 | _CET_ENDBR |
| 1064 | mov 240($inp),%r10d # pass rounds | 1064 | mov 240($inp),%r10d # pass rounds |
| 1065 | mov $inp,%rcx # pass key | 1065 | mov $inp,%rcx # pass key |
| 1066 | mov $out,%rax # pass key schedule | 1066 | mov $out,%rax # pass key schedule |
| @@ -1075,7 +1075,7 @@ bsaes_enc_key_convert: | |||
| 1075 | .align 16 | 1075 | .align 16 |
| 1076 | bsaes_encrypt_128: | 1076 | bsaes_encrypt_128: |
| 1077 | .Lenc128_loop: | 1077 | .Lenc128_loop: |
| 1078 | endbr64 | 1078 | _CET_ENDBR |
| 1079 | movdqu 0x00($inp), @XMM[0] # load input | 1079 | movdqu 0x00($inp), @XMM[0] # load input |
| 1080 | movdqu 0x10($inp), @XMM[1] | 1080 | movdqu 0x10($inp), @XMM[1] |
| 1081 | movdqu 0x20($inp), @XMM[2] | 1081 | movdqu 0x20($inp), @XMM[2] |
| @@ -1108,7 +1108,7 @@ bsaes_encrypt_128: | |||
| 1108 | .type bsaes_dec_key_convert,\@function,2 | 1108 | .type bsaes_dec_key_convert,\@function,2 |
| 1109 | .align 16 | 1109 | .align 16 |
| 1110 | bsaes_dec_key_convert: | 1110 | bsaes_dec_key_convert: |
| 1111 | endbr64 | 1111 | _CET_ENDBR |
| 1112 | mov 240($inp),%r10d # pass rounds | 1112 | mov 240($inp),%r10d # pass rounds |
| 1113 | mov $inp,%rcx # pass key | 1113 | mov $inp,%rcx # pass key |
| 1114 | mov $out,%rax # pass key schedule | 1114 | mov $out,%rax # pass key schedule |
| @@ -1123,7 +1123,7 @@ bsaes_dec_key_convert: | |||
| 1123 | .type bsaes_decrypt_128,\@function,4 | 1123 | .type bsaes_decrypt_128,\@function,4 |
| 1124 | .align 16 | 1124 | .align 16 |
| 1125 | bsaes_decrypt_128: | 1125 | bsaes_decrypt_128: |
| 1126 | endbr64 | 1126 | _CET_ENDBR |
| 1127 | .Ldec128_loop: | 1127 | .Ldec128_loop: |
| 1128 | movdqu 0x00($inp), @XMM[0] # load input | 1128 | movdqu 0x00($inp), @XMM[0] # load input |
| 1129 | movdqu 0x10($inp), @XMM[1] | 1129 | movdqu 0x10($inp), @XMM[1] |
| @@ -1169,7 +1169,7 @@ $code.=<<___; | |||
| 1169 | .type bsaes_ecb_encrypt_blocks,\@abi-omnipotent | 1169 | .type bsaes_ecb_encrypt_blocks,\@abi-omnipotent |
| 1170 | .align 16 | 1170 | .align 16 |
| 1171 | bsaes_ecb_encrypt_blocks: | 1171 | bsaes_ecb_encrypt_blocks: |
| 1172 | endbr64 | 1172 | _CET_ENDBR |
| 1173 | mov %rsp, %rax | 1173 | mov %rsp, %rax |
| 1174 | .Lecb_enc_prologue: | 1174 | .Lecb_enc_prologue: |
| 1175 | push %rbp | 1175 | push %rbp |
| @@ -1371,7 +1371,7 @@ $code.=<<___; | |||
| 1371 | .type bsaes_ecb_decrypt_blocks,\@abi-omnipotent | 1371 | .type bsaes_ecb_decrypt_blocks,\@abi-omnipotent |
| 1372 | .align 16 | 1372 | .align 16 |
| 1373 | bsaes_ecb_decrypt_blocks: | 1373 | bsaes_ecb_decrypt_blocks: |
| 1374 | endbr64 | 1374 | _CET_ENDBR |
| 1375 | mov %rsp, %rax | 1375 | mov %rsp, %rax |
| 1376 | .Lecb_dec_prologue: | 1376 | .Lecb_dec_prologue: |
| 1377 | push %rbp | 1377 | push %rbp |
| @@ -1577,7 +1577,7 @@ $code.=<<___; | |||
| 1577 | .type bsaes_cbc_encrypt,\@abi-omnipotent | 1577 | .type bsaes_cbc_encrypt,\@abi-omnipotent |
| 1578 | .align 16 | 1578 | .align 16 |
| 1579 | bsaes_cbc_encrypt: | 1579 | bsaes_cbc_encrypt: |
| 1580 | endbr64 | 1580 | _CET_ENDBR |
| 1581 | ___ | 1581 | ___ |
| 1582 | $code.=<<___ if ($win64); | 1582 | $code.=<<___ if ($win64); |
| 1583 | mov 48(%rsp),$arg6 # pull direction flag | 1583 | mov 48(%rsp),$arg6 # pull direction flag |
| @@ -1865,7 +1865,7 @@ $code.=<<___; | |||
| 1865 | .type bsaes_ctr32_encrypt_blocks,\@abi-omnipotent | 1865 | .type bsaes_ctr32_encrypt_blocks,\@abi-omnipotent |
| 1866 | .align 16 | 1866 | .align 16 |
| 1867 | bsaes_ctr32_encrypt_blocks: | 1867 | bsaes_ctr32_encrypt_blocks: |
| 1868 | endbr64 | 1868 | _CET_ENDBR |
| 1869 | mov %rsp, %rax | 1869 | mov %rsp, %rax |
| 1870 | .Lctr_enc_prologue: | 1870 | .Lctr_enc_prologue: |
| 1871 | push %rbp | 1871 | push %rbp |
| @@ -2107,7 +2107,7 @@ $code.=<<___; | |||
| 2107 | .type bsaes_xts_encrypt,\@abi-omnipotent | 2107 | .type bsaes_xts_encrypt,\@abi-omnipotent |
| 2108 | .align 16 | 2108 | .align 16 |
| 2109 | bsaes_xts_encrypt: | 2109 | bsaes_xts_encrypt: |
| 2110 | endbr64 | 2110 | _CET_ENDBR |
| 2111 | mov %rsp, %rax | 2111 | mov %rsp, %rax |
| 2112 | .Lxts_enc_prologue: | 2112 | .Lxts_enc_prologue: |
| 2113 | push %rbp | 2113 | push %rbp |
| @@ -2489,7 +2489,7 @@ $code.=<<___; | |||
| 2489 | .type bsaes_xts_decrypt,\@abi-omnipotent | 2489 | .type bsaes_xts_decrypt,\@abi-omnipotent |
| 2490 | .align 16 | 2490 | .align 16 |
| 2491 | bsaes_xts_decrypt: | 2491 | bsaes_xts_decrypt: |
| 2492 | endbr64 | 2492 | _CET_ENDBR |
| 2493 | mov %rsp, %rax | 2493 | mov %rsp, %rax |
| 2494 | .Lxts_dec_prologue: | 2494 | .Lxts_dec_prologue: |
| 2495 | push %rbp | 2495 | push %rbp |
| @@ -2966,7 +2966,7 @@ $code.=<<___; | |||
| 2966 | .type se_handler,\@abi-omnipotent | 2966 | .type se_handler,\@abi-omnipotent |
| 2967 | .align 16 | 2967 | .align 16 |
| 2968 | se_handler: | 2968 | se_handler: |
| 2969 | endbr64 | 2969 | _CET_ENDBR |
| 2970 | push %rsi | 2970 | push %rsi |
| 2971 | push %rdi | 2971 | push %rdi |
| 2972 | push %rbx | 2972 | push %rbx |
diff --git a/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl b/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl index 8ff8d8602b..7d92e8d8ca 100644 --- a/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl +++ b/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl | |||
| @@ -82,7 +82,7 @@ $code.=<<___; | |||
| 82 | .type _vpaes_encrypt_core,\@abi-omnipotent | 82 | .type _vpaes_encrypt_core,\@abi-omnipotent |
| 83 | .align 16 | 83 | .align 16 |
| 84 | _vpaes_encrypt_core: | 84 | _vpaes_encrypt_core: |
| 85 | endbr64 | 85 | _CET_ENDBR |
| 86 | mov %rdx, %r9 | 86 | mov %rdx, %r9 |
| 87 | mov \$16, %r11 | 87 | mov \$16, %r11 |
| 88 | mov 240(%rdx),%eax | 88 | mov 240(%rdx),%eax |
| @@ -173,7 +173,7 @@ _vpaes_encrypt_core: | |||
| 173 | .type _vpaes_decrypt_core,\@abi-omnipotent | 173 | .type _vpaes_decrypt_core,\@abi-omnipotent |
| 174 | .align 16 | 174 | .align 16 |
| 175 | _vpaes_decrypt_core: | 175 | _vpaes_decrypt_core: |
| 176 | endbr64 | 176 | _CET_ENDBR |
| 177 | mov %rdx, %r9 # load key | 177 | mov %rdx, %r9 # load key |
| 178 | mov 240(%rdx),%eax | 178 | mov 240(%rdx),%eax |
| 179 | movdqa %xmm9, %xmm1 | 179 | movdqa %xmm9, %xmm1 |
| @@ -281,7 +281,7 @@ _vpaes_decrypt_core: | |||
| 281 | .type _vpaes_schedule_core,\@abi-omnipotent | 281 | .type _vpaes_schedule_core,\@abi-omnipotent |
| 282 | .align 16 | 282 | .align 16 |
| 283 | _vpaes_schedule_core: | 283 | _vpaes_schedule_core: |
| 284 | endbr64 | 284 | _CET_ENDBR |
| 285 | # rdi = key | 285 | # rdi = key |
| 286 | # rsi = size in bits | 286 | # rsi = size in bits |
| 287 | # rdx = buffer | 287 | # rdx = buffer |
| @@ -467,7 +467,7 @@ _vpaes_schedule_core: | |||
| 467 | .type _vpaes_schedule_192_smear,\@abi-omnipotent | 467 | .type _vpaes_schedule_192_smear,\@abi-omnipotent |
| 468 | .align 16 | 468 | .align 16 |
| 469 | _vpaes_schedule_192_smear: | 469 | _vpaes_schedule_192_smear: |
| 470 | endbr64 | 470 | _CET_ENDBR |
| 471 | pshufd \$0x80, %xmm6, %xmm0 # d c 0 0 -> c 0 0 0 | 471 | pshufd \$0x80, %xmm6, %xmm0 # d c 0 0 -> c 0 0 0 |
| 472 | pxor %xmm0, %xmm6 # -> c+d c 0 0 | 472 | pxor %xmm0, %xmm6 # -> c+d c 0 0 |
| 473 | pshufd \$0xFE, %xmm7, %xmm0 # b a _ _ -> b b b a | 473 | pshufd \$0xFE, %xmm7, %xmm0 # b a _ _ -> b b b a |
| @@ -499,7 +499,7 @@ _vpaes_schedule_192_smear: | |||
| 499 | .type _vpaes_schedule_round,\@abi-omnipotent | 499 | .type _vpaes_schedule_round,\@abi-omnipotent |
| 500 | .align 16 | 500 | .align 16 |
| 501 | _vpaes_schedule_round: | 501 | _vpaes_schedule_round: |
| 502 | endbr64 | 502 | _CET_ENDBR |
| 503 | # extract rcon from xmm8 | 503 | # extract rcon from xmm8 |
| 504 | pxor %xmm1, %xmm1 | 504 | pxor %xmm1, %xmm1 |
| 505 | palignr \$15, %xmm8, %xmm1 | 505 | palignr \$15, %xmm8, %xmm1 |
| @@ -567,7 +567,7 @@ _vpaes_schedule_low_round: | |||
| 567 | .type _vpaes_schedule_transform,\@abi-omnipotent | 567 | .type _vpaes_schedule_transform,\@abi-omnipotent |
| 568 | .align 16 | 568 | .align 16 |
| 569 | _vpaes_schedule_transform: | 569 | _vpaes_schedule_transform: |
| 570 | endbr64 | 570 | _CET_ENDBR |
| 571 | movdqa %xmm9, %xmm1 | 571 | movdqa %xmm9, %xmm1 |
| 572 | pandn %xmm0, %xmm1 | 572 | pandn %xmm0, %xmm1 |
| 573 | psrld \$4, %xmm1 | 573 | psrld \$4, %xmm1 |
| @@ -606,7 +606,7 @@ _vpaes_schedule_transform: | |||
| 606 | .type _vpaes_schedule_mangle,\@abi-omnipotent | 606 | .type _vpaes_schedule_mangle,\@abi-omnipotent |
| 607 | .align 16 | 607 | .align 16 |
| 608 | _vpaes_schedule_mangle: | 608 | _vpaes_schedule_mangle: |
| 609 | endbr64 | 609 | _CET_ENDBR |
| 610 | movdqa %xmm0, %xmm4 # save xmm0 for later | 610 | movdqa %xmm0, %xmm4 # save xmm0 for later |
| 611 | movdqa .Lk_mc_forward(%rip),%xmm5 | 611 | movdqa .Lk_mc_forward(%rip),%xmm5 |
| 612 | test %rcx, %rcx | 612 | test %rcx, %rcx |
| @@ -680,7 +680,7 @@ _vpaes_schedule_mangle: | |||
| 680 | .type ${PREFIX}_set_encrypt_key,\@function,3 | 680 | .type ${PREFIX}_set_encrypt_key,\@function,3 |
| 681 | .align 16 | 681 | .align 16 |
| 682 | ${PREFIX}_set_encrypt_key: | 682 | ${PREFIX}_set_encrypt_key: |
| 683 | endbr64 | 683 | _CET_ENDBR |
| 684 | ___ | 684 | ___ |
| 685 | $code.=<<___ if ($win64); | 685 | $code.=<<___ if ($win64); |
| 686 | lea -0xb8(%rsp),%rsp | 686 | lea -0xb8(%rsp),%rsp |
| @@ -729,7 +729,7 @@ $code.=<<___; | |||
| 729 | .type ${PREFIX}_set_decrypt_key,\@function,3 | 729 | .type ${PREFIX}_set_decrypt_key,\@function,3 |
| 730 | .align 16 | 730 | .align 16 |
| 731 | ${PREFIX}_set_decrypt_key: | 731 | ${PREFIX}_set_decrypt_key: |
| 732 | endbr64 | 732 | _CET_ENDBR |
| 733 | ___ | 733 | ___ |
| 734 | $code.=<<___ if ($win64); | 734 | $code.=<<___ if ($win64); |
| 735 | lea -0xb8(%rsp),%rsp | 735 | lea -0xb8(%rsp),%rsp |
| @@ -783,7 +783,7 @@ $code.=<<___; | |||
| 783 | .type ${PREFIX}_encrypt,\@function,3 | 783 | .type ${PREFIX}_encrypt,\@function,3 |
| 784 | .align 16 | 784 | .align 16 |
| 785 | ${PREFIX}_encrypt: | 785 | ${PREFIX}_encrypt: |
| 786 | endbr64 | 786 | _CET_ENDBR |
| 787 | ___ | 787 | ___ |
| 788 | $code.=<<___ if ($win64); | 788 | $code.=<<___ if ($win64); |
| 789 | lea -0xb8(%rsp),%rsp | 789 | lea -0xb8(%rsp),%rsp |
| @@ -827,7 +827,7 @@ $code.=<<___; | |||
| 827 | .type ${PREFIX}_decrypt,\@function,3 | 827 | .type ${PREFIX}_decrypt,\@function,3 |
| 828 | .align 16 | 828 | .align 16 |
| 829 | ${PREFIX}_decrypt: | 829 | ${PREFIX}_decrypt: |
| 830 | endbr64 | 830 | _CET_ENDBR |
| 831 | ___ | 831 | ___ |
| 832 | $code.=<<___ if ($win64); | 832 | $code.=<<___ if ($win64); |
| 833 | lea -0xb8(%rsp),%rsp | 833 | lea -0xb8(%rsp),%rsp |
| @@ -877,7 +877,7 @@ $code.=<<___; | |||
| 877 | .type ${PREFIX}_cbc_encrypt,\@function,6 | 877 | .type ${PREFIX}_cbc_encrypt,\@function,6 |
| 878 | .align 16 | 878 | .align 16 |
| 879 | ${PREFIX}_cbc_encrypt: | 879 | ${PREFIX}_cbc_encrypt: |
| 880 | endbr64 | 880 | _CET_ENDBR |
| 881 | xchg $key,$len | 881 | xchg $key,$len |
| 882 | ___ | 882 | ___ |
| 883 | ($len,$key)=($key,$len); | 883 | ($len,$key)=($key,$len); |
| @@ -961,7 +961,7 @@ $code.=<<___; | |||
| 961 | .type _vpaes_preheat,\@abi-omnipotent | 961 | .type _vpaes_preheat,\@abi-omnipotent |
| 962 | .align 16 | 962 | .align 16 |
| 963 | _vpaes_preheat: | 963 | _vpaes_preheat: |
| 964 | endbr64 | 964 | _CET_ENDBR |
| 965 | lea .Lk_s0F(%rip), %r10 | 965 | lea .Lk_s0F(%rip), %r10 |
| 966 | movdqa -0x20(%r10), %xmm10 # .Lk_inv | 966 | movdqa -0x20(%r10), %xmm10 # .Lk_inv |
| 967 | movdqa -0x10(%r10), %xmm11 # .Lk_inv+16 | 967 | movdqa -0x10(%r10), %xmm11 # .Lk_inv+16 |
| @@ -1092,7 +1092,7 @@ $code.=<<___; | |||
| 1092 | .type se_handler,\@abi-omnipotent | 1092 | .type se_handler,\@abi-omnipotent |
| 1093 | .align 16 | 1093 | .align 16 |
| 1094 | se_handler: | 1094 | se_handler: |
| 1095 | endbr64 | 1095 | _CET_ENDBR |
| 1096 | push %rsi | 1096 | push %rsi |
| 1097 | push %rdi | 1097 | push %rdi |
| 1098 | push %rbx | 1098 | push %rbx |
