--- zzzz-none-000/linux-5.4.213/include/linux/crypto.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/include/linux/crypto.h 2024-08-14 09:02:08.000000000 +0000 @@ -104,6 +104,8 @@ */ #define CRYPTO_NOLOAD 0x00008000 +#define CRYPTO_ALG_ALLOCATES_MEMORY 0x00010000 + /* * Transform masks and values (for crt_flags). */ @@ -577,7 +579,7 @@ int (*cra_init)(struct crypto_tfm *tfm); void (*cra_exit)(struct crypto_tfm *tfm); void (*cra_destroy)(struct crypto_alg *alg); - + struct module *cra_module; #ifdef CONFIG_CRYPTO_STATS @@ -764,7 +766,7 @@ struct crypto_tfm { u32 crt_flags; - + union { struct ablkcipher_tfm ablkcipher; struct blkcipher_tfm blkcipher; @@ -773,7 +775,7 @@ } crt_u; void (*exit)(struct crypto_tfm *tfm); - + struct crypto_alg *__crt_alg; void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; @@ -821,10 +823,10 @@ u32 num; }; -/* +/* * Transform user interface. */ - + struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm); @@ -858,6 +860,11 @@ return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; } +static inline u32 crypto_tfm_alg_flags(struct crypto_tfm *tfm) +{ + return tfm->__crt_alg->cra_flags & ~CRYPTO_ALG_TYPE_MASK; +} + static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) { return tfm->__crt_alg->cra_blocksize;