Lines Matching refs:tfm

158 	struct crypto_tfm *tfm;  member
177 struct crypto_blkcipher *tfm; member
183 struct crypto_tfm *tfm; member
184 void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
191 struct crypto_hash *tfm; member
254 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
281 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
347 int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key,
349 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
350 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
354 int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src,
356 int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src,
465 int (*cra_init)(struct crypto_tfm *tfm);
466 void (*cra_exit)(struct crypto_tfm *tfm);
492 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
507 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
516 int (*cit_setkey)(struct crypto_tfm *tfm,
518 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
519 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
529 int (*setkey)(struct crypto_hash *tfm, const u8 *key,
535 int (*cot_compress)(struct crypto_tfm *tfm,
538 int (*cot_decompress)(struct crypto_tfm *tfm,
561 void (*exit)(struct crypto_tfm *tfm);
619 void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
621 static inline void crypto_free_tfm(struct crypto_tfm *tfm) in crypto_free_tfm() argument
623 return crypto_destroy_tfm(tfm, tfm); in crypto_free_tfm()
631 static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm) in crypto_tfm_alg_name() argument
633 return tfm->__crt_alg->cra_name; in crypto_tfm_alg_name()
636 static inline const char *crypto_tfm_alg_driver_name(struct crypto_tfm *tfm) in crypto_tfm_alg_driver_name() argument
638 return tfm->__crt_alg->cra_driver_name; in crypto_tfm_alg_driver_name()
641 static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm) in crypto_tfm_alg_priority() argument
643 return tfm->__crt_alg->cra_priority; in crypto_tfm_alg_priority()
646 static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) in crypto_tfm_alg_type() argument
648 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; in crypto_tfm_alg_type()
651 static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) in crypto_tfm_alg_blocksize() argument
653 return tfm->__crt_alg->cra_blocksize; in crypto_tfm_alg_blocksize()
656 static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) in crypto_tfm_alg_alignmask() argument
658 return tfm->__crt_alg->cra_alignmask; in crypto_tfm_alg_alignmask()
661 static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm) in crypto_tfm_get_flags() argument
663 return tfm->crt_flags; in crypto_tfm_get_flags()
666 static inline void crypto_tfm_set_flags(struct crypto_tfm *tfm, u32 flags) in crypto_tfm_set_flags() argument
668 tfm->crt_flags |= flags; in crypto_tfm_set_flags()
671 static inline void crypto_tfm_clear_flags(struct crypto_tfm *tfm, u32 flags) in crypto_tfm_clear_flags() argument
673 tfm->crt_flags &= ~flags; in crypto_tfm_clear_flags()
676 static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) in crypto_tfm_ctx() argument
678 return tfm->__crt_ctx; in crypto_tfm_ctx()
683 struct crypto_tfm *tfm; in crypto_tfm_ctx_alignment() local
684 return __alignof__(tfm->__crt_ctx); in crypto_tfm_ctx_alignment()
691 struct crypto_tfm *tfm) in __crypto_ablkcipher_cast() argument
693 return (struct crypto_ablkcipher *)tfm; in __crypto_ablkcipher_cast()
758 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_tfm() argument
760 return &tfm->base; in crypto_ablkcipher_tfm()
767 static inline void crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) in crypto_free_ablkcipher() argument
769 crypto_free_tfm(crypto_ablkcipher_tfm(tfm)); in crypto_free_ablkcipher()
790 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_crt() argument
792 return &crypto_ablkcipher_tfm(tfm)->crt_ablkcipher; in crypto_ablkcipher_crt()
805 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_ivsize() argument
807 return crypto_ablkcipher_crt(tfm)->ivsize; in crypto_ablkcipher_ivsize()
821 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_blocksize() argument
823 return crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_blocksize()
827 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_alignmask() argument
829 return crypto_tfm_alg_alignmask(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_alignmask()
832 static inline u32 crypto_ablkcipher_get_flags(struct crypto_ablkcipher *tfm) in crypto_ablkcipher_get_flags() argument
834 return crypto_tfm_get_flags(crypto_ablkcipher_tfm(tfm)); in crypto_ablkcipher_get_flags()
837 static inline void crypto_ablkcipher_set_flags(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_set_flags() argument
840 crypto_tfm_set_flags(crypto_ablkcipher_tfm(tfm), flags); in crypto_ablkcipher_set_flags()
843 static inline void crypto_ablkcipher_clear_flags(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_clear_flags() argument
846 crypto_tfm_clear_flags(crypto_ablkcipher_tfm(tfm), flags); in crypto_ablkcipher_clear_flags()
865 static inline int crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm, in crypto_ablkcipher_setkey() argument
868 struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(tfm); in crypto_ablkcipher_setkey()
885 return __crypto_ablkcipher_cast(req->base.tfm); in crypto_ablkcipher_reqtfm()
942 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_reqsize() argument
944 return crypto_ablkcipher_crt(tfm)->reqsize; in crypto_ablkcipher_reqsize()
956 struct ablkcipher_request *req, struct crypto_ablkcipher *tfm) in ablkcipher_request_set_tfm() argument
958 req->base.tfm = crypto_ablkcipher_tfm(crypto_ablkcipher_crt(tfm)->base); in ablkcipher_request_set_tfm()
980 struct crypto_ablkcipher *tfm, gfp_t gfp) in ablkcipher_request_alloc() argument
985 crypto_ablkcipher_reqsize(tfm), gfp); in ablkcipher_request_alloc()
988 ablkcipher_request_set_tfm(req, tfm); in ablkcipher_request_alloc()
1094 struct crypto_tfm *tfm) in __crypto_blkcipher_cast() argument
1096 return (struct crypto_blkcipher *)tfm; in __crypto_blkcipher_cast()
1100 struct crypto_tfm *tfm) in crypto_blkcipher_cast() argument
1102 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER); in crypto_blkcipher_cast()
1103 return __crypto_blkcipher_cast(tfm); in crypto_blkcipher_cast()
1131 struct crypto_blkcipher *tfm) in crypto_blkcipher_tfm() argument
1133 return &tfm->base; in crypto_blkcipher_tfm()
1140 static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm) in crypto_free_blkcipher() argument
1142 crypto_free_tfm(crypto_blkcipher_tfm(tfm)); in crypto_free_blkcipher()
1170 static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm) in crypto_blkcipher_name() argument
1172 return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_name()
1176 struct crypto_blkcipher *tfm) in crypto_blkcipher_crt() argument
1178 return &crypto_blkcipher_tfm(tfm)->crt_blkcipher; in crypto_blkcipher_crt()
1182 struct crypto_blkcipher *tfm) in crypto_blkcipher_alg() argument
1184 return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher; in crypto_blkcipher_alg()
1196 static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm) in crypto_blkcipher_ivsize() argument
1198 return crypto_blkcipher_alg(tfm)->ivsize; in crypto_blkcipher_ivsize()
1212 struct crypto_blkcipher *tfm) in crypto_blkcipher_blocksize() argument
1214 return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_blocksize()
1218 struct crypto_blkcipher *tfm) in crypto_blkcipher_alignmask() argument
1220 return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_alignmask()
1223 static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm) in crypto_blkcipher_get_flags() argument
1225 return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm)); in crypto_blkcipher_get_flags()
1228 static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm, in crypto_blkcipher_set_flags() argument
1231 crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags); in crypto_blkcipher_set_flags()
1234 static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm, in crypto_blkcipher_clear_flags() argument
1237 crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags); in crypto_blkcipher_clear_flags()
1256 static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm, in crypto_blkcipher_setkey() argument
1259 return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm), in crypto_blkcipher_setkey()
1286 desc->info = crypto_blkcipher_crt(desc->tfm)->iv; in crypto_blkcipher_encrypt()
1287 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); in crypto_blkcipher_encrypt()
1314 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); in crypto_blkcipher_encrypt_iv()
1339 desc->info = crypto_blkcipher_crt(desc->tfm)->iv; in crypto_blkcipher_decrypt()
1340 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); in crypto_blkcipher_decrypt()
1364 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); in crypto_blkcipher_decrypt_iv()
1376 static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm, in crypto_blkcipher_set_iv() argument
1379 memcpy(crypto_blkcipher_crt(tfm)->iv, src, len); in crypto_blkcipher_set_iv()
1392 static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm, in crypto_blkcipher_get_iv() argument
1395 memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len); in crypto_blkcipher_get_iv()
1415 static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm) in __crypto_cipher_cast() argument
1417 return (struct crypto_cipher *)tfm; in __crypto_cipher_cast()
1420 static inline struct crypto_cipher *crypto_cipher_cast(struct crypto_tfm *tfm) in crypto_cipher_cast() argument
1422 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); in crypto_cipher_cast()
1423 return __crypto_cipher_cast(tfm); in crypto_cipher_cast()
1450 static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm) in crypto_cipher_tfm() argument
1452 return &tfm->base; in crypto_cipher_tfm()
1459 static inline void crypto_free_cipher(struct crypto_cipher *tfm) in crypto_free_cipher() argument
1461 crypto_free_tfm(crypto_cipher_tfm(tfm)); in crypto_free_cipher()
1483 static inline struct cipher_tfm *crypto_cipher_crt(struct crypto_cipher *tfm) in crypto_cipher_crt() argument
1485 return &crypto_cipher_tfm(tfm)->crt_cipher; in crypto_cipher_crt()
1498 static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm) in crypto_cipher_blocksize() argument
1500 return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm)); in crypto_cipher_blocksize()
1503 static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm) in crypto_cipher_alignmask() argument
1505 return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm)); in crypto_cipher_alignmask()
1508 static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm) in crypto_cipher_get_flags() argument
1510 return crypto_tfm_get_flags(crypto_cipher_tfm(tfm)); in crypto_cipher_get_flags()
1513 static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm, in crypto_cipher_set_flags() argument
1516 crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags); in crypto_cipher_set_flags()
1519 static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm, in crypto_cipher_clear_flags() argument
1522 crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags); in crypto_cipher_clear_flags()
1541 static inline int crypto_cipher_setkey(struct crypto_cipher *tfm, in crypto_cipher_setkey() argument
1544 return crypto_cipher_crt(tfm)->cit_setkey(crypto_cipher_tfm(tfm), in crypto_cipher_setkey()
1557 static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm, in crypto_cipher_encrypt_one() argument
1560 crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm), in crypto_cipher_encrypt_one()
1573 static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm, in crypto_cipher_decrypt_one() argument
1576 crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm), in crypto_cipher_decrypt_one()
1587 static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm) in __crypto_hash_cast() argument
1589 return (struct crypto_hash *)tfm; in __crypto_hash_cast()
1592 static inline struct crypto_hash *crypto_hash_cast(struct crypto_tfm *tfm) in crypto_hash_cast() argument
1594 BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_HASH) & in crypto_hash_cast()
1596 return __crypto_hash_cast(tfm); in crypto_hash_cast()
1624 static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm) in crypto_hash_tfm() argument
1626 return &tfm->base; in crypto_hash_tfm()
1633 static inline void crypto_free_hash(struct crypto_hash *tfm) in crypto_free_hash() argument
1635 crypto_free_tfm(crypto_hash_tfm(tfm)); in crypto_free_hash()
1658 static inline struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm) in crypto_hash_crt() argument
1660 return &crypto_hash_tfm(tfm)->crt_hash; in crypto_hash_crt()
1672 static inline unsigned int crypto_hash_blocksize(struct crypto_hash *tfm) in crypto_hash_blocksize() argument
1674 return crypto_tfm_alg_blocksize(crypto_hash_tfm(tfm)); in crypto_hash_blocksize()
1677 static inline unsigned int crypto_hash_alignmask(struct crypto_hash *tfm) in crypto_hash_alignmask() argument
1679 return crypto_tfm_alg_alignmask(crypto_hash_tfm(tfm)); in crypto_hash_alignmask()
1691 static inline unsigned int crypto_hash_digestsize(struct crypto_hash *tfm) in crypto_hash_digestsize() argument
1693 return crypto_hash_crt(tfm)->digestsize; in crypto_hash_digestsize()
1696 static inline u32 crypto_hash_get_flags(struct crypto_hash *tfm) in crypto_hash_get_flags() argument
1698 return crypto_tfm_get_flags(crypto_hash_tfm(tfm)); in crypto_hash_get_flags()
1701 static inline void crypto_hash_set_flags(struct crypto_hash *tfm, u32 flags) in crypto_hash_set_flags() argument
1703 crypto_tfm_set_flags(crypto_hash_tfm(tfm), flags); in crypto_hash_set_flags()
1706 static inline void crypto_hash_clear_flags(struct crypto_hash *tfm, u32 flags) in crypto_hash_clear_flags() argument
1708 crypto_tfm_clear_flags(crypto_hash_tfm(tfm), flags); in crypto_hash_clear_flags()
1726 return crypto_hash_crt(desc->tfm)->init(desc); in crypto_hash_init()
1747 return crypto_hash_crt(desc->tfm)->update(desc, sg, nbytes); in crypto_hash_update()
1766 return crypto_hash_crt(desc->tfm)->final(desc, out); in crypto_hash_final()
1787 return crypto_hash_crt(desc->tfm)->digest(desc, sg, nbytes, out); in crypto_hash_digest()
1807 static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm) in __crypto_comp_cast() argument
1809 return (struct crypto_comp *)tfm; in __crypto_comp_cast()
1812 static inline struct crypto_comp *crypto_comp_cast(struct crypto_tfm *tfm) in crypto_comp_cast() argument
1814 BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_COMPRESS) & in crypto_comp_cast()
1816 return __crypto_comp_cast(tfm); in crypto_comp_cast()
1829 static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm) in crypto_comp_tfm() argument
1831 return &tfm->base; in crypto_comp_tfm()
1834 static inline void crypto_free_comp(struct crypto_comp *tfm) in crypto_free_comp() argument
1836 crypto_free_tfm(crypto_comp_tfm(tfm)); in crypto_free_comp()
1848 static inline const char *crypto_comp_name(struct crypto_comp *tfm) in crypto_comp_name() argument
1850 return crypto_tfm_alg_name(crypto_comp_tfm(tfm)); in crypto_comp_name()
1853 static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm) in crypto_comp_crt() argument
1855 return &crypto_comp_tfm(tfm)->crt_compress; in crypto_comp_crt()
1858 static inline int crypto_comp_compress(struct crypto_comp *tfm, in crypto_comp_compress() argument
1862 return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm), in crypto_comp_compress()
1866 static inline int crypto_comp_decompress(struct crypto_comp *tfm, in crypto_comp_decompress() argument
1870 return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm), in crypto_comp_decompress()