summaryrefslogtreecommitdiff
path: root/cipher/sm4-aesni-avx2-amd64.S
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2022-01-08 20:56:19 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-01-11 20:10:12 +0200
commit11ade08efbfbc36dbf3571f1026946269950bc40 (patch)
tree73c1739f302ca2cbac73c244b8dbd533ab516a8f /cipher/sm4-aesni-avx2-amd64.S
parentff2a647d36677f6ad9edbe992a6c0ab0f7cf9510 (diff)
downloadlibgcrypt-11ade08efbfbc36dbf3571f1026946269950bc40.tar.gz
Add straight-line speculation hardening for amd64 and i386 assembly
* cipher/asm-common-amd64.h (ret_spec_stop): New. * cipher/arcfour-amd64.S: Use 'ret_spec_stop' for 'ret' instruction. * cipher/blake2b-amd64-avx2.S: Likewise. * cipher/blake2s-amd64-avx.S: Likewise. * cipher/blowfish-amd64.S: Likewise. * cipher/camellia-aesni-avx-amd64.S: Likewise. * cipher/camellia-aesni-avx2-amd64.h: Likewise. * cipher/cast5-amd64.S: Likewise. * cipher/chacha20-amd64-avx2.S: Likewise. * cipher/chacha20-amd64-ssse3.S: Likewise. * cipher/des-amd64.S: Likewise. * cipher/rijndael-aarch64.S: Likewise. * cipher/rijndael-amd64.S: Likewise. * cipher/rijndael-ssse3-amd64-asm.S: Likewise. * cipher/rijndael-vaes-avx2-amd64.S: Likewise. * cipher/salsa20-amd64.S: Likewise. * cipher/serpent-avx2-amd64.S: Likewise. * cipher/serpent-sse2-amd64.S: Likewise. * cipher/sha1-avx-amd64.S: Likewise. * cipher/sha1-avx-bmi2-amd64.S: Likewise. * cipher/sha1-avx2-bmi2-amd64.S: Likewise. * cipher/sha1-ssse3-amd64.S: Likewise. * cipher/sha256-avx-amd64.S: Likewise. * cipher/sha256-avx2-bmi2-amd64.S: Likewise. * cipher/sha256-ssse3-amd64.S: Likewise. * cipher/sha512-avx-amd64.S: Likewise. * cipher/sha512-avx2-bmi2-amd64.S: Likewise. * cipher/sha512-ssse3-amd64.S: Likewise. * cipher/sm3-avx-bmi2-amd64.S: Likewise. * cipher/sm4-aesni-avx-amd64.S: Likewise. * cipher/sm4-aesni-avx2-amd64.S: Likewise. * cipher/twofish-amd64.S: Likewise. * cipher/twofish-avx2-amd64.S: Likewise. * cipher/whirlpool-sse2-amd64.S: Likewise. * mpi/amd64/func_abi.h (CFI_*): Remove, include from "asm-common-amd64.h" instead. (FUNC_EXIT): Use 'ret_spec_stop' for 'ret' instruction. * mpi/asm-common-amd64.h: New. * mpi/i386/mpih-add1.S: Use 'ret_spec_stop' for 'ret' instruction. * mpi/i386/mpih-lshift.S: Likewise. * mpi/i386/mpih-mul1.S: Likewise. * mpi/i386/mpih-mul2.S: Likewise. * mpi/i386/mpih-mul3.S: Likewise. * mpi/i386/mpih-rshift.S: Likewise. * mpi/i386/mpih-sub1.S: Likewise. * mpi/i386/syntax.h (ret_spec_stop): New. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/sm4-aesni-avx2-amd64.S')
-rw-r--r--cipher/sm4-aesni-avx2-amd64.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/cipher/sm4-aesni-avx2-amd64.S b/cipher/sm4-aesni-avx2-amd64.S
index 6e46c0dc..7a8b9558 100644
--- a/cipher/sm4-aesni-avx2-amd64.S
+++ b/cipher/sm4-aesni-avx2-amd64.S
@@ -276,7 +276,7 @@ __sm4_crypt_blk16:
vpshufb RTMP2, RB2, RB2;
vpshufb RTMP2, RB3, RB3;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size __sm4_crypt_blk16,.-__sm4_crypt_blk16;)
@@ -394,7 +394,7 @@ _gcry_sm4_aesni_avx2_ctr_enc:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_ctr_enc,.-_gcry_sm4_aesni_avx2_ctr_enc;)
@@ -447,7 +447,7 @@ _gcry_sm4_aesni_avx2_cbc_dec:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_cbc_dec,.-_gcry_sm4_aesni_avx2_cbc_dec;)
@@ -502,7 +502,7 @@ _gcry_sm4_aesni_avx2_cfb_dec:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_cfb_dec,.-_gcry_sm4_aesni_avx2_cfb_dec;)
@@ -616,7 +616,7 @@ _gcry_sm4_aesni_avx2_ocb_enc:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_ocb_enc,.-_gcry_sm4_aesni_avx2_ocb_enc;)
@@ -740,7 +740,7 @@ _gcry_sm4_aesni_avx2_ocb_dec:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_ocb_dec,.-_gcry_sm4_aesni_avx2_ocb_dec;)
@@ -843,7 +843,7 @@ _gcry_sm4_aesni_avx2_ocb_auth:
vzeroall;
- ret;
+ ret_spec_stop;
CFI_ENDPROC();
ELF(.size _gcry_sm4_aesni_avx2_ocb_auth,.-_gcry_sm4_aesni_avx2_ocb_auth;)