12 #ifndef _CRYPTO_ALGAPI_H
13 #define _CRYPTO_ALGAPI_H
16 #include <linux/list.h>
17 #include <linux/kernel.h>
150 static inline void crypto_set_spawn(
struct crypto_spawn *spawn,
194 unsigned int blocksize);
202 static inline void *crypto_tfm_ctx_aligned(
struct crypto_tfm *
tfm)
205 crypto_tfm_alg_alignmask(tfm) + 1);
222 return &crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_ablkcipher;
227 return crypto_tfm_ctx(&tfm->
base);
232 return crypto_tfm_ctx_aligned(&tfm->
base);
237 return &crypto_aead_tfm(tfm)->__crt_alg->cra_aead;
240 static inline void *crypto_aead_ctx(
struct crypto_aead *tfm)
242 return crypto_tfm_ctx(&tfm->
base);
248 return crypto_tfm_alg_instance(&aead->
base);
262 return crypto_tfm_ctx(&tfm->
base);
265 static inline void *crypto_blkcipher_ctx_aligned(
struct crypto_blkcipher *tfm)
267 return crypto_tfm_ctx_aligned(&tfm->
base);
281 return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher;
292 static inline void *crypto_hash_ctx(
struct crypto_hash *tfm)
294 return crypto_tfm_ctx(&tfm->
base);
297 static inline void *crypto_hash_ctx_aligned(
struct crypto_hash *tfm)
299 return crypto_tfm_ctx_aligned(&tfm->
base);
302 static inline void blkcipher_walk_init(
struct blkcipher_walk *walk,
320 INIT_LIST_HEAD(&walk->
buffers);
323 static inline void ablkcipher_walk_complete(
struct ablkcipher_walk *walk)
353 static inline int ablkcipher_tfm_in_queue(
struct crypto_queue *queue,
366 req->
base.complete(&req->
base, err);
371 return req->
base.flags;
384 static inline int crypto_requires_sync(
u32 type,
u32 mask)