diff options
author | Hongren (Zenithal) Zheng <i@zenithal.me> | 2022-05-11 17:18:27 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-06-22 12:46:50 +0200 |
commit | eea820f3e239a4c11d618741fd5d00a6bc877347 (patch) | |
tree | 91927cfddc327b5ad6f52924c06c62adf5a48c43 /crypto/sm3 | |
parent | 7ae2bc9df6e0916a8f16183f07dfa1815dd4b66d (diff) |
Add ROTATE inline asm support for SM3
And move ROTATE inline asm to header.
Now this benefits SM3, SHA (when with Zbb only and no Zknh)
and other hash functions
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18287)
Diffstat (limited to 'crypto/sm3')
-rw-r--r-- | crypto/sm3/sm3_local.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crypto/sm3/sm3_local.h b/crypto/sm3/sm3_local.h index 48ec9ae90b..cb5a187a12 100644 --- a/crypto/sm3/sm3_local.h +++ b/crypto/sm3/sm3_local.h @@ -57,14 +57,14 @@ void ossl_sm3_transform(SM3_CTX *c, const unsigned char *data); # if defined(__GNUC__) && __GNUC__>=2 && \ !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__riscv_zksh) -# define P0(x) ({ MD32_REG_T ret; \ - asm ("sm3p0 %0, %1" \ - : "=r"(ret) \ - : "r"(x)); ret; }) -# define P1(x) ({ MD32_REG_T ret; \ - asm ("sm3p1 %0, %1" \ - : "=r"(ret) \ - : "r"(x)); ret; }) +# define P0(x) ({ MD32_REG_T ret; \ + asm ("sm3p0 %0, %1" \ + : "=r"(ret) \ + : "r"(x)); ret; }) +# define P1(x) ({ MD32_REG_T ret; \ + asm ("sm3p1 %0, %1" \ + : "=r"(ret) \ + : "r"(x)); ret; }) # endif # endif #endif |