Lines Matching refs:tfm
175 struct crypto_tfm *tfm; member
194 struct crypto_blkcipher *tfm; member
200 struct crypto_tfm *tfm; member
201 void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
266 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
293 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
359 int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key,
361 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
362 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
366 int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src,
368 int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src,
485 int (*cra_init)(struct crypto_tfm *tfm);
486 void (*cra_exit)(struct crypto_tfm *tfm);
551 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
564 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
573 int (*cit_setkey)(struct crypto_tfm *tfm,
575 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
576 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
580 int (*cot_compress)(struct crypto_tfm *tfm,
583 int (*cot_decompress)(struct crypto_tfm *tfm,
604 void (*exit)(struct crypto_tfm *tfm);
658 void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
660 static inline void crypto_free_tfm(struct crypto_tfm *tfm) in crypto_free_tfm() argument
662 return crypto_destroy_tfm(tfm, tfm); in crypto_free_tfm()
670 static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm) in crypto_tfm_alg_name() argument
672 return tfm->__crt_alg->cra_name; in crypto_tfm_alg_name()
675 static inline const char *crypto_tfm_alg_driver_name(struct crypto_tfm *tfm) in crypto_tfm_alg_driver_name() argument
677 return tfm->__crt_alg->cra_driver_name; in crypto_tfm_alg_driver_name()
680 static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm) in crypto_tfm_alg_priority() argument
682 return tfm->__crt_alg->cra_priority; in crypto_tfm_alg_priority()
685 static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) in crypto_tfm_alg_type() argument
687 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; in crypto_tfm_alg_type()
690 static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) in crypto_tfm_alg_blocksize() argument
692 return tfm->__crt_alg->cra_blocksize; in crypto_tfm_alg_blocksize()
695 static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) in crypto_tfm_alg_alignmask() argument
697 return tfm->__crt_alg->cra_alignmask; in crypto_tfm_alg_alignmask()
700 static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm) in crypto_tfm_get_flags() argument
702 return tfm->crt_flags; in crypto_tfm_get_flags()
705 static inline void crypto_tfm_set_flags(struct crypto_tfm *tfm, u32 flags) in crypto_tfm_set_flags() argument
707 tfm->crt_flags |= flags; in crypto_tfm_set_flags()
710 static inline void crypto_tfm_clear_flags(struct crypto_tfm *tfm, u32 flags) in crypto_tfm_clear_flags() argument
712 tfm->crt_flags &= ~flags; in crypto_tfm_clear_flags()
715 static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) in crypto_tfm_ctx() argument
717 return tfm->__crt_ctx; in crypto_tfm_ctx()
722 struct crypto_tfm *tfm; in crypto_tfm_ctx_alignment() local
723 return __alignof__(tfm->__crt_ctx); in crypto_tfm_ctx_alignment()
730 struct crypto_tfm *tfm) in __crypto_ablkcipher_cast() argument
732 return (struct crypto_ablkcipher *)tfm; in __crypto_ablkcipher_cast()
780 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_tfm() argument
782 return &tfm->base; in crypto_ablkcipher_tfm()
789 static inline void crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) in crypto_free_ablkcipher() argument
791 crypto_free_tfm(crypto_ablkcipher_tfm(tfm)); in crypto_free_ablkcipher()
812 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_crt() argument
814 return &crypto_ablkcipher_tfm(tfm)->crt_ablkcipher; in crypto_ablkcipher_crt()
827 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_ivsize() argument
829 return crypto_ablkcipher_crt(tfm)->ivsize; in crypto_ablkcipher_ivsize()
843 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_blocksize() argument
845 return crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_blocksize()
849 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_alignmask() argument
851 return crypto_tfm_alg_alignmask(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_alignmask()
854 static inline u32 crypto_ablkcipher_get_flags(struct crypto_ablkcipher *tfm) in crypto_ablkcipher_get_flags() argument
856 return crypto_tfm_get_flags(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_get_flags()
859 static inline void crypto_ablkcipher_set_flags(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_set_flags() argument
862 crypto_tfm_set_flags(crypto_ablkcipher_tfm(tfm), flags); in crypto_ablkcipher_set_flags()
865 static inline void crypto_ablkcipher_clear_flags(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_clear_flags() argument
868 crypto_tfm_clear_flags(crypto_ablkcipher_tfm(tfm), flags); in crypto_ablkcipher_clear_flags()
887 static inline int crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_setkey() argument
890 struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(tfm); in crypto_ablkcipher_setkey()
907 return __crypto_ablkcipher_cast(req->base.tfm); in crypto_ablkcipher_reqtfm()
964 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_reqsize() argument
966 return crypto_ablkcipher_crt(tfm)->reqsize; in crypto_ablkcipher_reqsize()
978 struct ablkcipher_request *req, struct crypto_ablkcipher *tfm) in ablkcipher_request_set_tfm() argument
980 req->base.tfm = crypto_ablkcipher_tfm(crypto_ablkcipher_crt(tfm)->base); in ablkcipher_request_set_tfm()
1001 struct crypto_ablkcipher *tfm, gfp_t gfp) in ablkcipher_request_alloc() argument
1006 crypto_ablkcipher_reqsize(tfm), gfp); in ablkcipher_request_alloc()
1009 ablkcipher_request_set_tfm(req, tfm); in ablkcipher_request_alloc()
1115 struct crypto_tfm *tfm) in __crypto_blkcipher_cast() argument
1117 return (struct crypto_blkcipher *)tfm; in __crypto_blkcipher_cast()
1121 struct crypto_tfm *tfm) in crypto_blkcipher_cast() argument
1123 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER); in crypto_blkcipher_cast()
1124 return __crypto_blkcipher_cast(tfm); in crypto_blkcipher_cast()
1152 struct crypto_blkcipher *tfm) in crypto_blkcipher_tfm() argument
1154 return &tfm->base; in crypto_blkcipher_tfm()
1161 static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm) in crypto_free_blkcipher() argument
1163 crypto_free_tfm(crypto_blkcipher_tfm(tfm)); in crypto_free_blkcipher()
1191 static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm) in crypto_blkcipher_name() argument
1193 return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_name()
1197 struct crypto_blkcipher *tfm) in crypto_blkcipher_crt() argument
1199 return &crypto_blkcipher_tfm(tfm)->crt_blkcipher; in crypto_blkcipher_crt()
1203 struct crypto_blkcipher *tfm) in crypto_blkcipher_alg() argument
1205 return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher; in crypto_blkcipher_alg()
1217 static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm) in crypto_blkcipher_ivsize() argument
1219 return crypto_blkcipher_alg(tfm)->ivsize; in crypto_blkcipher_ivsize()
1233 struct crypto_blkcipher *tfm) in crypto_blkcipher_blocksize() argument
1235 return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_blocksize()
1239 struct crypto_blkcipher *tfm) in crypto_blkcipher_alignmask() argument
1241 return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_alignmask()
1244 static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm) in crypto_blkcipher_get_flags() argument
1246 return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_get_flags()
1249 static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm, in crypto_blkcipher_set_flags() argument
1252 crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags); in crypto_blkcipher_set_flags()
1255 static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm, in crypto_blkcipher_clear_flags() argument
1258 crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags); in crypto_blkcipher_clear_flags()
1277 static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm, in crypto_blkcipher_setkey() argument
1280 return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm), in crypto_blkcipher_setkey()
1307 desc->info = crypto_blkcipher_crt(desc->tfm)->iv; in crypto_blkcipher_encrypt()
1308 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); in crypto_blkcipher_encrypt()
1335 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); in crypto_blkcipher_encrypt_iv()
1360 desc->info = crypto_blkcipher_crt(desc->tfm)->iv; in crypto_blkcipher_decrypt()
1361 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); in crypto_blkcipher_decrypt()
1385 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); in crypto_blkcipher_decrypt_iv()
1397 static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm, in crypto_blkcipher_set_iv() argument
1400 memcpy(crypto_blkcipher_crt(tfm)->iv, src, len); in crypto_blkcipher_set_iv()
1413 static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm, in crypto_blkcipher_get_iv() argument
1416 memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len); in crypto_blkcipher_get_iv()
1436 static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm) in __crypto_cipher_cast() argument
1438 return (struct crypto_cipher *)tfm; in __crypto_cipher_cast()
1441 static inline struct crypto_cipher *crypto_cipher_cast(struct crypto_tfm *tfm) in crypto_cipher_cast() argument
1443 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); in crypto_cipher_cast()
1444 return __crypto_cipher_cast(tfm); in crypto_cipher_cast()
1471 static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm) in crypto_cipher_tfm() argument
1473 return &tfm->base; in crypto_cipher_tfm()
1480 static inline void crypto_free_cipher(struct crypto_cipher *tfm) in crypto_free_cipher() argument
1482 crypto_free_tfm(crypto_cipher_tfm(tfm)); in crypto_free_cipher()
1504 static inline struct cipher_tfm *crypto_cipher_crt(struct crypto_cipher *tfm) in crypto_cipher_crt() argument
1506 return &crypto_cipher_tfm(tfm)->crt_cipher; in crypto_cipher_crt()
1519 static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm) in crypto_cipher_blocksize() argument
1521 return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm)); in crypto_cipher_blocksize()
1524 static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm) in crypto_cipher_alignmask() argument
1526 return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm)); in crypto_cipher_alignmask()
1529 static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm) in crypto_cipher_get_flags() argument
1531 return crypto_tfm_get_flags(crypto_cipher_tfm(tfm)); in crypto_cipher_get_flags()
1534 static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm, in crypto_cipher_set_flags() argument
1537 crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags); in crypto_cipher_set_flags()
1540 static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm, in crypto_cipher_clear_flags() argument
1543 crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags); in crypto_cipher_clear_flags()
1562 static inline int crypto_cipher_setkey(struct crypto_cipher *tfm, in crypto_cipher_setkey() argument
1565 return crypto_cipher_crt(tfm)->cit_setkey(crypto_cipher_tfm(tfm), in crypto_cipher_setkey()
1578 static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm, in crypto_cipher_encrypt_one() argument
1581 crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm), in crypto_cipher_encrypt_one()
1594 static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm, in crypto_cipher_decrypt_one() argument
1597 crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm), in crypto_cipher_decrypt_one()
1601 static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm) in __crypto_comp_cast() argument
1603 return (struct crypto_comp *)tfm; in __crypto_comp_cast()
1606 static inline struct crypto_comp *crypto_comp_cast(struct crypto_tfm *tfm) in crypto_comp_cast() argument
1608 BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_COMPRESS) & in crypto_comp_cast()
1610 return __crypto_comp_cast(tfm); in crypto_comp_cast()
1623 static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm) in crypto_comp_tfm() argument
1625 return &tfm->base; in crypto_comp_tfm()
1628 static inline void crypto_free_comp(struct crypto_comp *tfm) in crypto_free_comp() argument
1630 crypto_free_tfm(crypto_comp_tfm(tfm)); in crypto_free_comp()
1642 static inline const char *crypto_comp_name(struct crypto_comp *tfm) in crypto_comp_name() argument
1644 return crypto_tfm_alg_name(crypto_comp_tfm(tfm)); in crypto_comp_name()
1647 static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm) in crypto_comp_crt() argument
1649 return &crypto_comp_tfm(tfm)->crt_compress; in crypto_comp_crt()
1652 static inline int crypto_comp_compress(struct crypto_comp *tfm, in crypto_comp_compress() argument
1656 return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm), in crypto_comp_compress()
1660 static inline int crypto_comp_decompress(struct crypto_comp *tfm, in crypto_comp_decompress() argument
1664 return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm), in crypto_comp_decompress()