mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-14 23:16:25 +07:00
1661131a04
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>
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Shared crypto simd helpers
|
|
*/
|
|
|
|
#ifndef _CRYPTO_INTERNAL_SIMD_H
|
|
#define _CRYPTO_INTERNAL_SIMD_H
|
|
|
|
/* skcipher support */
|
|
|
|
struct simd_skcipher_alg;
|
|
struct skcipher_alg;
|
|
|
|
struct simd_skcipher_alg *simd_skcipher_create_compat(const char *algname,
|
|
const char *drvname,
|
|
const char *basename);
|
|
struct simd_skcipher_alg *simd_skcipher_create(const char *algname,
|
|
const char *basename);
|
|
void simd_skcipher_free(struct simd_skcipher_alg *alg);
|
|
|
|
int simd_register_skciphers_compat(struct skcipher_alg *algs, int count,
|
|
struct simd_skcipher_alg **simd_algs);
|
|
|
|
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 */
|