Commit 20342e3f authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: x86/sha1 - autoload if SHA-NI detected

The x86 SHA-1 module contains four implementations: SSSE3, AVX, AVX2,
and SHA-NI.  Commit 1c43c0f1 ("crypto: x86/sha - load modules based
on CPU features") made the module be autoloaded when SSSE3, AVX, or AVX2
is detected.  The omission of SHA-NI appears to be an oversight, perhaps
because of the outdated file-level comment.  This patch fixes this,
though in practice this makes no difference because SSSE3 is a subset of
the other three features anyway.  Indeed, sha1_ni_transform() executes
SSSE3 instructions such as pshufb.
Reviewed-by: default avatarRoxana Nicolescu <roxana.nicolescu@canonical.com>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e53c7413
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/* /*
* Cryptographic API. * Cryptographic API.
* *
* Glue code for the SHA1 Secure Hash Algorithm assembler implementation using * Glue code for the SHA1 Secure Hash Algorithm assembler implementations
* Supplemental SSE3 instructions. * using SSSE3, AVX, AVX2, and SHA-NI instructions.
* *
* This file is based on sha1_generic.c * This file is based on sha1_generic.c
* *
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <asm/simd.h> #include <asm/simd.h>
static const struct x86_cpu_id module_cpu_ids[] = { static const struct x86_cpu_id module_cpu_ids[] = {
#ifdef CONFIG_AS_SHA1_NI
X86_MATCH_FEATURE(X86_FEATURE_SHA_NI, NULL),
#endif
X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL),
X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL),
X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment