提交 7fa885e2 编写于 作者: A Ard Biesheuvel 提交者: Herbert Xu

crypto: arm64/sm4-ce - check for the right CPU feature bit

ARMv8.2 specifies special instructions for the SM3 cryptographic hash
and the SM4 symmetric cipher. While it is unlikely that a core would
implement one and not the other, we should only use SM4 instructions
if the SM4 CPU feature bit is set, and we currently check the SM3
feature bit instead. So fix that.

Fixes: e99ce921 ("crypto: arm64 - add support for SM4...")
Cc: <stable@vger.kernel.org>
Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 f1bf9e60
...@@ -69,5 +69,5 @@ static void __exit sm4_ce_mod_fini(void) ...@@ -69,5 +69,5 @@ static void __exit sm4_ce_mod_fini(void)
crypto_unregister_alg(&sm4_ce_alg); crypto_unregister_alg(&sm4_ce_alg);
} }
module_cpu_feature_match(SM3, sm4_ce_mod_init); module_cpu_feature_match(SM4, sm4_ce_mod_init);
module_exit(sm4_ce_mod_fini); module_exit(sm4_ce_mod_fini);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册