aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-03-10 15:00:50 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2019-03-22 08:57:26 -0400
commit1661131a0479a2e0f7d16b43ce12a0106c442e37 (patch)
treeed00b371ecf10e87a751ba662b46788963f47cd1 /include/crypto
parent16c4dd83a1b2a23004e2728b7c6222592e64e354 (diff)
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 'include/crypto')
-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 @@
6#ifndef _CRYPTO_INTERNAL_SIMD_H 6#ifndef _CRYPTO_INTERNAL_SIMD_H
7#define _CRYPTO_INTERNAL_SIMD_H 7#define _CRYPTO_INTERNAL_SIMD_H
8 8
9/* skcipher support */
10
9struct simd_skcipher_alg; 11struct simd_skcipher_alg;
10struct skcipher_alg; 12struct skcipher_alg;
11 13
@@ -22,4 +24,22 @@ int simd_register_skciphers_compat(struct skcipher_alg *algs, int count,
22void simd_unregister_skciphers(struct skcipher_alg *algs, int count, 24void simd_unregister_skciphers(struct skcipher_alg *algs, int count,
23 struct simd_skcipher_alg **simd_algs); 25 struct simd_skcipher_alg **simd_algs);
24 26
27/* AEAD support */
28
29struct simd_aead_alg;
30struct aead_alg;
31
32struct simd_aead_alg *simd_aead_create_compat(const char *algname,
33 const char *drvname,
34 const char *basename);
35struct simd_aead_alg *simd_aead_create(const char *algname,
36 const char *basename);
37void simd_aead_free(struct simd_aead_alg *alg);
38
39int simd_register_aeads_compat(struct aead_alg *algs, int count,
40 struct simd_aead_alg **simd_algs);
41
42void simd_unregister_aeads(struct aead_alg *algs, int count,
43 struct simd_aead_alg **simd_algs);
44
25#endif /* _CRYPTO_INTERNAL_SIMD_H */ 45#endif /* _CRYPTO_INTERNAL_SIMD_H */