Home
last modified time | relevance | path

Searched refs:tfm (Results 1 – 25 of 148) sorted by relevance

123456

/linux-4.19.296/include/linux/
Dcrypto.h175 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,
[all …]
/linux-4.19.296/include/crypto/
Dhash.h141 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
148 struct crypto_shash *tfm; member
187 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
208 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
230 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
232 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
252 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
254 return &tfm->base; in crypto_ahash_tfm()
263 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
265 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
[all …]
Dskcipher.h56 int (*setkey)(struct crypto_skcipher *tfm, const u8 *key,
126 int (*setkey)(struct crypto_skcipher *tfm, const u8 *key,
130 int (*init)(struct crypto_skcipher *tfm);
131 void (*exit)(struct crypto_skcipher *tfm);
142 #define SKCIPHER_REQUEST_ON_STACK(name, tfm) \ argument
144 crypto_skcipher_reqsize(tfm)] CRYPTO_MINALIGN_ATTR; \
178 struct crypto_tfm *tfm) in __crypto_skcipher_cast() argument
180 return container_of(tfm, struct crypto_skcipher, base); in __crypto_skcipher_cast()
201 struct crypto_skcipher *tfm) in crypto_skcipher_tfm() argument
203 return &tfm->base; in crypto_skcipher_tfm()
[all …]
Dakcipher.h97 int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
99 int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
101 unsigned int (*max_size)(struct crypto_akcipher *tfm);
102 int (*init)(struct crypto_akcipher *tfm);
103 void (*exit)(struct crypto_akcipher *tfm);
134 struct crypto_akcipher *tfm) in crypto_akcipher_tfm() argument
136 return &tfm->base; in crypto_akcipher_tfm()
145 struct crypto_tfm *tfm) in __crypto_akcipher_tfm() argument
147 return container_of(tfm, struct crypto_akcipher, base); in __crypto_akcipher_tfm()
151 struct crypto_akcipher *tfm) in crypto_akcipher_alg() argument
[all …]
Dkpp.h77 int (*set_secret)(struct crypto_kpp *tfm, const void *buffer,
82 unsigned int (*max_size)(struct crypto_kpp *tfm);
84 int (*init)(struct crypto_kpp *tfm);
85 void (*exit)(struct crypto_kpp *tfm);
112 static inline struct crypto_tfm *crypto_kpp_tfm(struct crypto_kpp *tfm) in crypto_kpp_tfm() argument
114 return &tfm->base; in crypto_kpp_tfm()
122 static inline struct crypto_kpp *__crypto_kpp_tfm(struct crypto_tfm *tfm) in __crypto_kpp_tfm() argument
124 return container_of(tfm, struct crypto_kpp, base); in __crypto_kpp_tfm()
127 static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm) in crypto_kpp_alg() argument
129 return __crypto_kpp_alg(crypto_kpp_tfm(tfm)->__crt_alg); in crypto_kpp_alg()
[all …]
Daead.h137 int (*setkey)(struct crypto_aead *tfm, const u8 *key,
139 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
142 int (*init)(struct crypto_aead *tfm);
143 void (*exit)(struct crypto_aead *tfm);
161 static inline struct crypto_aead *__crypto_aead_cast(struct crypto_tfm *tfm) in __crypto_aead_cast() argument
163 return container_of(tfm, struct crypto_aead, base); in __crypto_aead_cast()
182 static inline struct crypto_tfm *crypto_aead_tfm(struct crypto_aead *tfm) in crypto_aead_tfm() argument
184 return &tfm->base; in crypto_aead_tfm()
193 static inline void crypto_free_aead(struct crypto_aead *tfm) in crypto_free_aead() argument
195 crypto_destroy_tfm(tfm, crypto_aead_tfm(tfm)); in crypto_free_aead()
[all …]
Drng.h47 int (*generate)(struct crypto_rng *tfm,
50 int (*seed)(struct crypto_rng *tfm, const u8 *seed, unsigned int slen);
51 void (*set_ent)(struct crypto_rng *tfm, const u8 *data,
97 static inline struct crypto_tfm *crypto_rng_tfm(struct crypto_rng *tfm) in crypto_rng_tfm() argument
99 return &tfm->base; in crypto_rng_tfm()
110 static inline struct rng_alg *crypto_rng_alg(struct crypto_rng *tfm) in crypto_rng_alg() argument
112 return container_of(crypto_rng_tfm(tfm)->__crt_alg, in crypto_rng_alg()
122 static inline void crypto_free_rng(struct crypto_rng *tfm) in crypto_free_rng() argument
124 crypto_destroy_tfm(tfm, crypto_rng_tfm(tfm)); in crypto_free_rng()
141 static inline int crypto_rng_generate(struct crypto_rng *tfm, in crypto_rng_generate() argument
[all …]
Dcryptd.h26 struct crypto_ablkcipher *tfm) in __cryptd_ablkcipher_cast() argument
28 return (struct cryptd_ablkcipher *)tfm; in __cryptd_ablkcipher_cast()
34 struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm);
35 bool cryptd_ablkcipher_queued(struct cryptd_ablkcipher *tfm);
36 void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm);
44 struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm);
46 bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm);
47 void cryptd_free_skcipher(struct cryptd_skcipher *tfm);
54 struct crypto_ahash *tfm) in __cryptd_ahash_cast() argument
56 return (struct cryptd_ahash *)tfm; in __cryptd_ahash_cast()
[all …]
Dacompress.h85 int (*init)(struct crypto_acomp *tfm);
86 void (*exit)(struct crypto_acomp *tfm);
115 static inline struct crypto_tfm *crypto_acomp_tfm(struct crypto_acomp *tfm) in crypto_acomp_tfm() argument
117 return &tfm->base; in crypto_acomp_tfm()
125 static inline struct crypto_acomp *__crypto_acomp_tfm(struct crypto_tfm *tfm) in __crypto_acomp_tfm() argument
127 return container_of(tfm, struct crypto_acomp, base); in __crypto_acomp_tfm()
130 static inline struct acomp_alg *crypto_acomp_alg(struct crypto_acomp *tfm) in crypto_acomp_alg() argument
132 return __crypto_acomp_alg(crypto_acomp_tfm(tfm)->__crt_alg); in crypto_acomp_alg()
135 static inline unsigned int crypto_acomp_reqsize(struct crypto_acomp *tfm) in crypto_acomp_reqsize() argument
137 return tfm->reqsize; in crypto_acomp_reqsize()
[all …]
Dcbc.h21 struct skcipher_walk *walk, struct crypto_skcipher *tfm, in crypto_cbc_encrypt_segment() argument
24 unsigned int bsize = crypto_skcipher_blocksize(tfm); in crypto_cbc_encrypt_segment()
32 fn(tfm, iv, dst); in crypto_cbc_encrypt_segment()
43 struct skcipher_walk *walk, struct crypto_skcipher *tfm, in crypto_cbc_encrypt_inplace() argument
46 unsigned int bsize = crypto_skcipher_blocksize(tfm); in crypto_cbc_encrypt_inplace()
53 fn(tfm, src, src); in crypto_cbc_encrypt_inplace()
68 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in crypto_cbc_encrypt_walk() local
76 err = crypto_cbc_encrypt_inplace(&walk, tfm, fn); in crypto_cbc_encrypt_walk()
78 err = crypto_cbc_encrypt_segment(&walk, tfm, fn); in crypto_cbc_encrypt_walk()
86 struct skcipher_walk *walk, struct crypto_skcipher *tfm, in crypto_cbc_decrypt_segment() argument
[all …]
/linux-4.19.296/include/crypto/internal/
Dscompress.h34 void *(*alloc_ctx)(struct crypto_scomp *tfm);
35 void (*free_ctx)(struct crypto_scomp *tfm, void *ctx);
36 int (*compress)(struct crypto_scomp *tfm, const u8 *src,
39 int (*decompress)(struct crypto_scomp *tfm, const u8 *src,
50 static inline struct crypto_scomp *__crypto_scomp_tfm(struct crypto_tfm *tfm) in __crypto_scomp_tfm() argument
52 return container_of(tfm, struct crypto_scomp, base); in __crypto_scomp_tfm()
55 static inline struct crypto_tfm *crypto_scomp_tfm(struct crypto_scomp *tfm) in crypto_scomp_tfm() argument
57 return &tfm->base; in crypto_scomp_tfm()
60 static inline void crypto_free_scomp(struct crypto_scomp *tfm) in crypto_free_scomp() argument
62 crypto_destroy_tfm(tfm, crypto_scomp_tfm(tfm)); in crypto_free_scomp()
[all …]
/linux-4.19.296/crypto/
Dcipher.c24 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
27 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey_unaligned()
28 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
40 ret = cia->cia_setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
47 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
49 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey()
50 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
52 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey()
54 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
59 return setkey_unaligned(tfm, key, keylen); in setkey()
[all …]
Dcryptd.c148 refcnt = crypto_tfm_ctx(request->tfm); in cryptd_enqueue_request()
199 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
201 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
245 struct crypto_ablkcipher *tfm; in cryptd_blkcipher_crypt() local
254 desc.tfm = child; in cryptd_blkcipher_crypt()
263 tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_crypt()
264 ctx = crypto_ablkcipher_ctx(tfm); in cryptd_blkcipher_crypt()
272 crypto_free_ablkcipher(tfm); in cryptd_blkcipher_crypt()
277 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
286 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
[all …]
Dshash.c28 static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key, in shash_no_setkey() argument
47 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() argument
50 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned()
51 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_setkey_unaligned()
63 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
68 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
72 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
75 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
78 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
79 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
[all …]
Dcfb.c36 static unsigned int crypto_cfb_bsize(struct crypto_skcipher *tfm) in crypto_cfb_bsize() argument
38 struct crypto_cfb_ctx *ctx = crypto_skcipher_ctx(tfm); in crypto_cfb_bsize()
44 static void crypto_cfb_encrypt_one(struct crypto_skcipher *tfm, in crypto_cfb_encrypt_one() argument
47 struct crypto_cfb_ctx *ctx = crypto_skcipher_ctx(tfm); in crypto_cfb_encrypt_one()
54 struct crypto_skcipher *tfm) in crypto_cfb_final() argument
56 const unsigned long alignmask = crypto_skcipher_alignmask(tfm); in crypto_cfb_final()
64 crypto_cfb_encrypt_one(tfm, iv, stream); in crypto_cfb_final()
69 struct crypto_skcipher *tfm) in crypto_cfb_encrypt_segment() argument
71 const unsigned int bsize = crypto_cfb_bsize(tfm); in crypto_cfb_encrypt_segment()
78 crypto_cfb_encrypt_one(tfm, iv, dst); in crypto_cfb_encrypt_segment()
[all …]
Dapi.c297 static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_ops() argument
299 const struct crypto_type *type_obj = tfm->__crt_alg->cra_type; in crypto_init_ops()
302 return type_obj->init(tfm, type, mask); in crypto_init_ops()
304 switch (crypto_tfm_alg_type(tfm)) { in crypto_init_ops()
306 return crypto_init_cipher_ops(tfm); in crypto_init_ops()
309 return crypto_init_compress_ops(tfm); in crypto_init_ops()
319 static void crypto_exit_ops(struct crypto_tfm *tfm) in crypto_exit_ops() argument
321 const struct crypto_type *type = tfm->__crt_alg->cra_type; in crypto_exit_ops()
323 if (type && tfm->exit) in crypto_exit_ops()
324 tfm->exit(tfm); in crypto_exit_ops()
[all …]
Dblkcipher.c301 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt()
303 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt()
304 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt()
313 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_phys()
315 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_phys()
316 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_phys()
352 walk->cipher_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt_block()
353 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt_block()
354 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt_block()
361 struct crypto_aead *tfm, in blkcipher_aead_walk_virt_block() argument
[all …]
Dcompress.c20 static int crypto_compress(struct crypto_tfm *tfm, in crypto_compress() argument
24 return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst, in crypto_compress()
28 static int crypto_decompress(struct crypto_tfm *tfm, in crypto_decompress() argument
32 return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst, in crypto_decompress()
36 int crypto_init_compress_ops(struct crypto_tfm *tfm) in crypto_init_compress_ops() argument
38 struct compress_tfm *ops = &tfm->crt_compress; in crypto_init_compress_ops()
Dskcipher.c456 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in skcipher_walk_skcipher() local
473 walk->blocksize = crypto_skcipher_blocksize(tfm); in skcipher_walk_skcipher()
474 walk->stride = crypto_skcipher_walksize(tfm); in skcipher_walk_skcipher()
475 walk->ivsize = crypto_skcipher_ivsize(tfm); in skcipher_walk_skcipher()
476 walk->alignmask = crypto_skcipher_alignmask(tfm); in skcipher_walk_skcipher()
516 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in skcipher_walk_aead_common() local
542 walk->blocksize = crypto_aead_blocksize(tfm); in skcipher_walk_aead_common()
543 walk->stride = crypto_aead_chunksize(tfm); in skcipher_walk_aead_common()
544 walk->ivsize = crypto_aead_ivsize(tfm); in skcipher_walk_aead_common()
545 walk->alignmask = crypto_aead_alignmask(tfm); in skcipher_walk_aead_common()
[all …]
Dsimd.c43 static int simd_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key, in simd_skcipher_setkey() argument
46 struct simd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in simd_skcipher_setkey()
51 crypto_skcipher_set_flags(child, crypto_skcipher_get_flags(tfm) & in simd_skcipher_setkey()
54 crypto_skcipher_set_flags(tfm, crypto_skcipher_get_flags(child) & in simd_skcipher_setkey()
61 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in simd_skcipher_encrypt() local
62 struct simd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in simd_skcipher_encrypt()
82 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in simd_skcipher_decrypt() local
83 struct simd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in simd_skcipher_decrypt()
101 static void simd_skcipher_exit(struct crypto_skcipher *tfm) in simd_skcipher_exit() argument
103 struct simd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in simd_skcipher_exit()
[all …]
Daead.c32 static int setkey_unaligned(struct crypto_aead *tfm, const u8 *key, in setkey_unaligned() argument
35 unsigned long alignmask = crypto_aead_alignmask(tfm); in setkey_unaligned()
47 ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
53 int crypto_aead_setkey(struct crypto_aead *tfm, in crypto_aead_setkey() argument
56 unsigned long alignmask = crypto_aead_alignmask(tfm); in crypto_aead_setkey()
60 err = setkey_unaligned(tfm, key, keylen); in crypto_aead_setkey()
62 err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen); in crypto_aead_setkey()
65 crypto_aead_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_aead_setkey()
69 crypto_aead_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_aead_setkey()
74 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in crypto_aead_setauthsize() argument
[all …]
D842.c40 static void *crypto842_alloc_ctx(struct crypto_scomp *tfm) in crypto842_alloc_ctx() argument
51 static int crypto842_init(struct crypto_tfm *tfm) in crypto842_init() argument
53 struct crypto842_ctx *ctx = crypto_tfm_ctx(tfm); in crypto842_init()
62 static void crypto842_free_ctx(struct crypto_scomp *tfm, void *ctx) in crypto842_free_ctx() argument
67 static void crypto842_exit(struct crypto_tfm *tfm) in crypto842_exit() argument
69 struct crypto842_ctx *ctx = crypto_tfm_ctx(tfm); in crypto842_exit()
74 static int crypto842_compress(struct crypto_tfm *tfm, in crypto842_compress() argument
78 struct crypto842_ctx *ctx = crypto_tfm_ctx(tfm); in crypto842_compress()
83 static int crypto842_scompress(struct crypto_scomp *tfm, in crypto842_scompress() argument
90 static int crypto842_decompress(struct crypto_tfm *tfm, in crypto842_decompress() argument
[all …]
Dalgif_aead.c55 struct crypto_aead *tfm = aeadc->aead; in aead_sufficient_data() local
56 unsigned int as = crypto_aead_authsize(tfm); in aead_sufficient_data()
72 struct crypto_aead *tfm = aeadc->aead; in aead_sendmsg() local
73 unsigned int ivsize = crypto_aead_ivsize(tfm); in aead_sendmsg()
101 struct crypto_aead *tfm = aeadc->aead; in _aead_recvmsg() local
103 unsigned int i, as = crypto_aead_authsize(tfm); in _aead_recvmsg()
158 crypto_aead_reqsize(tfm)); in _aead_recvmsg()
287 aead_request_set_tfm(&areq->cra_u.aead_req, tfm); in _aead_recvmsg()
387 struct aead_tfm *tfm; in aead_check_key() local
397 tfm = pask->private; in aead_check_key()
[all …]
Dablkcipher.c103 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_done() local
136 memcpy(req->info, walk->iv, tfm->crt_ablkcipher.ivsize); in ablkcipher_walk_done()
183 struct crypto_tfm *tfm, in ablkcipher_copy_iv() argument
187 unsigned int ivsize = tfm->crt_ablkcipher.ivsize; in ablkcipher_copy_iv()
221 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_next() local
226 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_next()
228 if (unlikely(n < crypto_tfm_alg_blocksize(tfm))) { in ablkcipher_walk_next()
266 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_first() local
269 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_first()
280 int err = ablkcipher_copy_iv(walk, tfm, alignmask); in ablkcipher_walk_first()
[all …]
/linux-4.19.296/lib/
Dlibcrc32c.c41 static struct crypto_shash *tfm; variable
45 SHASH_DESC_ON_STACK(shash, tfm); in crc32c()
49 shash->tfm = tfm; in crc32c()
65 tfm = crypto_alloc_shash("crc32c", 0, 0); in libcrc32c_mod_init()
66 return PTR_ERR_OR_ZERO(tfm); in libcrc32c_mod_init()
71 crypto_free_shash(tfm); in libcrc32c_mod_fini()
76 return crypto_shash_driver_name(tfm); in crc32c_impl()

123456