diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-04-05 17:38:39 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-04-05 17:58:21 +0300 |
commit | 74ef3ecbf94e704975e238a99c0e0480cebf46ac (patch) | |
tree | ad075c220b62dfd878534f1a6d5cb96fe5ed39a6 /cipher/sha256-avx-amd64.S | |
parent | f3d4bd90662faaedd37ce0dae1f9e7f91748e91e (diff) | |
download | libgcrypt-74ef3ecbf94e704975e238a99c0e0480cebf46ac.tar.gz |
Burn stack in transform functions for SHA2 AMD64 implementations
* cipher/sha256-avx-amd64.S: Burn stack inside transform functions.
* cipher/sha256-avx2-bmi2-amd64.S: Ditto.
* cipher/sha256-ssse3-amd64.S: Ditto.
* cipher/sha512-avx-amd64.S: Ditto.
* cipher/sha512-avx2-bmi2-amd64.S: Ditto.
* cipher/sha512-ssse3-amd64.S: Ditto.
--
This change reduces per call overhead for SHA256 & SHA512.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/sha256-avx-amd64.S')
-rw-r--r-- | cipher/sha256-avx-amd64.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cipher/sha256-avx-amd64.S b/cipher/sha256-avx-amd64.S index 6953855b..b8b01b15 100644 --- a/cipher/sha256-avx-amd64.S +++ b/cipher/sha256-avx-amd64.S @@ -480,9 +480,12 @@ _gcry_sha256_transform_amd64_avx: cmp INP, [rsp + _INP_END] jne .Loop0 +.Ldone_hash: vzeroall -.Ldone_hash: + vmovdqa [rsp + _XFER], XFER + xor eax, eax + add rsp, STACK_SIZE pop r15 @@ -491,8 +494,6 @@ _gcry_sha256_transform_amd64_avx: pop rbp pop rbx - mov eax, STACK_SIZE + 5*8 - ret |