aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/internal/simd.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-03-10 12:00:50 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2019-03-22 20:57:26 +0800
commit1661131a0479a2e0f7d16b43ce12a0106c442e37 (patch)
treeed00b371ecf10e87a751ba662b46788963f47cd1 /include/crypto/internal/simd.h
parentcrypto: caam/jr - optimize job ring enqueue and dequeue operations (diff)
downloadlinux-dev-1661131a0479a2e0f7d16b43ce12a0106c442e37.tar.xz
linux-dev-1661131a0479a2e0f7d16b43ce12a0106c442e37.zip
crypto: simd - support wrapping AEAD algorithms
Update the crypto_simd module to support wrapping AEAD algorithms. Previously it only supported skciphers. The code for each is similar. I'll be converting the x86 implementations of AES-GCM, AEGIS, and MORUS to use this. Currently they each independently implement the same functionality. This will not only simplify the code, but it will also fix the bug detected by the improved self-tests: the user-provided aead_request is modified. This is because these algorithms currently reuse the original request, whereas the crypto_simd helpers build a new request in the original request's context. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--include/crypto/internal/simd.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/crypto/internal/simd.h b/include/crypto/internal/simd.h
index f18344518e32..a23b18b6ad61 100644
--- a/include/crypto/internal/simd.h
+++ b/include/crypto/internal/simd.h
@@ -6,6 +6,8 @@
#ifndef _CRYPTO_INTERNAL_SIMD_H
#define _CRYPTO_INTERNAL_SIMD_H
+/* skcipher support */
+
struct simd_skcipher_alg;
struct skcipher_alg;
@@ -22,4 +24,22 @@ int simd_register_skciphers_compat(struct skcipher_alg *algs, int count,
void simd_unregister_skciphers(struct skcipher_alg *algs, int count,
struct simd_skcipher_alg **simd_algs);
+/* AEAD support */
+
+struct simd_aead_alg;
+struct aead_alg;
+
+struct simd_aead_alg *simd_aead_create_compat(const char *algname,
+ const char *drvname,
+ const char *basename);
+struct simd_aead_alg *simd_aead_create(const char *algname,
+ const char *basename);
+void simd_aead_free(struct simd_aead_alg *alg);
+
+int simd_register_aeads_compat(struct aead_alg *algs, int count,
+ struct simd_aead_alg **simd_algs);
+
+void simd_unregister_aeads(struct aead_alg *algs, int count,
+ struct simd_aead_alg **simd_algs);
+
#endif /* _CRYPTO_INTERNAL_SIMD_H */