Home
last modified time | relevance | path

Searched refs:tfm (Results 1 – 200 of 279) sorted by relevance

12

/linux-4.1.27/include/linux/
Dcrypto.h160 struct crypto_tfm *tfm; member
205 struct crypto_blkcipher *tfm; member
211 struct crypto_tfm *tfm; member
212 void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
219 struct crypto_hash *tfm; member
282 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
323 int (*setkey)(struct crypto_aead *tfm, const u8 *key,
325 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
350 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
416 int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key,
[all …]
/linux-4.1.27/drivers/staging/rtl8192e/rtl8192e/
Drtl_crypto.h141 int (*cit_setkey)(struct crypto_tfm *tfm,
143 int (*cit_encrypt)(struct crypto_tfm *tfm,
147 int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
151 int (*cit_decrypt)(struct crypto_tfm *tfm,
155 int (*cit_decrypt_iv)(struct crypto_tfm *tfm,
163 void (*dit_init)(struct crypto_tfm *tfm);
164 void (*dit_update)(struct crypto_tfm *tfm,
166 void (*dit_final)(struct crypto_tfm *tfm, u8 *out);
167 void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
169 int (*dit_setkey)(struct crypto_tfm *tfm,
[all …]
/linux-4.1.27/include/crypto/
Dcompress.h58 int (*compress_setup)(struct crypto_pcomp *tfm, void *params,
60 int (*compress_init)(struct crypto_pcomp *tfm);
61 int (*compress_update)(struct crypto_pcomp *tfm,
63 int (*compress_final)(struct crypto_pcomp *tfm,
65 int (*decompress_setup)(struct crypto_pcomp *tfm, void *params,
67 int (*decompress_init)(struct crypto_pcomp *tfm);
68 int (*decompress_update)(struct crypto_pcomp *tfm,
70 int (*decompress_final)(struct crypto_pcomp *tfm,
79 static inline struct crypto_tfm *crypto_pcomp_tfm(struct crypto_pcomp *tfm) in crypto_pcomp_tfm() argument
81 return &tfm->base; in crypto_pcomp_tfm()
[all …]
Dhash.h131 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
138 struct crypto_shash *tfm; member
177 int (*setkey)(struct crypto_shash *tfm, const u8 *key,
198 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
221 static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) in __crypto_ahash_cast() argument
223 return container_of(tfm, struct crypto_ahash, base); in __crypto_ahash_cast()
243 static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) in crypto_ahash_tfm() argument
245 return &tfm->base; in crypto_ahash_tfm()
252 static inline void crypto_free_ahash(struct crypto_ahash *tfm) in crypto_free_ahash() argument
254 crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); in crypto_free_ahash()
[all …]
Drng.h30 static inline struct crypto_rng *__crypto_rng_cast(struct crypto_tfm *tfm) in __crypto_rng_cast() argument
32 return (struct crypto_rng *)tfm; in __crypto_rng_cast()
65 static inline struct crypto_tfm *crypto_rng_tfm(struct crypto_rng *tfm) in crypto_rng_tfm() argument
67 return &tfm->base; in crypto_rng_tfm()
78 static inline struct rng_alg *crypto_rng_alg(struct crypto_rng *tfm) in crypto_rng_alg() argument
80 return &crypto_rng_tfm(tfm)->__crt_alg->cra_rng; in crypto_rng_alg()
83 static inline struct rng_tfm *crypto_rng_crt(struct crypto_rng *tfm) in crypto_rng_crt() argument
85 return &crypto_rng_tfm(tfm)->crt_rng; in crypto_rng_crt()
92 static inline void crypto_free_rng(struct crypto_rng *tfm) in crypto_free_rng() argument
94 crypto_free_tfm(crypto_rng_tfm(tfm)); in crypto_free_rng()
[all …]
Dcryptd.h24 struct crypto_ablkcipher *tfm) in __cryptd_ablkcipher_cast() argument
26 return (struct cryptd_ablkcipher *)tfm; in __cryptd_ablkcipher_cast()
32 struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm);
33 void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm);
40 struct crypto_ahash *tfm) in __cryptd_ahash_cast() argument
42 return (struct cryptd_ahash *)tfm; in __cryptd_ahash_cast()
48 struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
50 void cryptd_free_ahash(struct cryptd_ahash *tfm);
57 struct crypto_aead *tfm) in __cryptd_aead_cast() argument
59 return (struct cryptd_aead *)tfm; in __cryptd_aead_cast()
[all …]
Dalgapi.h27 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
28 int (*init_tfm)(struct crypto_tfm *tfm);
183 int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm);
200 struct crypto_aead *tfm,
209 static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) in crypto_tfm_ctx_aligned() argument
211 return PTR_ALIGN(crypto_tfm_ctx(tfm), in crypto_tfm_ctx_aligned()
212 crypto_tfm_alg_alignmask(tfm) + 1); in crypto_tfm_ctx_aligned()
216 struct crypto_tfm *tfm) in crypto_tfm_alg_instance() argument
218 return container_of(tfm->__crt_alg, struct crypto_instance, alg); in crypto_tfm_alg_instance()
227 struct crypto_ablkcipher *tfm) in crypto_ablkcipher_alg() argument
[all …]
Dskcipher.h56 struct skcipher_givcrypt_request *req, struct crypto_ablkcipher *tfm) in skcipher_givcrypt_set_tfm() argument
58 req->creq.base.tfm = crypto_ablkcipher_tfm(tfm); in skcipher_givcrypt_set_tfm()
69 struct crypto_ablkcipher *tfm, gfp_t gfp) in skcipher_givcrypt_alloc() argument
74 crypto_ablkcipher_reqsize(tfm), gfp); in skcipher_givcrypt_alloc()
77 skcipher_givcrypt_set_tfm(req, tfm); in skcipher_givcrypt_alloc()
Daead.h52 struct crypto_aead *tfm) in aead_givcrypt_set_tfm() argument
54 req->areq.base.tfm = crypto_aead_tfm(tfm); in aead_givcrypt_set_tfm()
58 struct crypto_aead *tfm, gfp_t gfp) in aead_givcrypt_alloc() argument
63 crypto_aead_reqsize(tfm), gfp); in aead_givcrypt_alloc()
66 aead_givcrypt_set_tfm(req, tfm); in aead_givcrypt_alloc()
Dablk_helper.h16 extern int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
25 extern void ablk_exit(struct crypto_tfm *tfm);
27 extern int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name);
29 extern int ablk_init(struct crypto_tfm *tfm);
Dmcryptd.h22 struct crypto_ahash *tfm) in __mcryptd_ahash_cast() argument
24 return (struct mcryptd_ahash *)tfm; in __mcryptd_ahash_cast()
67 struct crypto_shash *mcryptd_ahash_child(struct mcryptd_ahash *tfm);
69 void mcryptd_free_ahash(struct mcryptd_ahash *tfm);
/linux-4.1.27/crypto/
Dcipher.c23 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
26 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey_unaligned()
27 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
39 ret = cia->cia_setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
46 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
48 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey()
49 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
51 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey()
53 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
58 return setkey_unaligned(tfm, key, keylen); in setkey()
[all …]
Dablk_helper.c37 int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, in ablk_set_key() argument
40 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_set_key()
45 crypto_ablkcipher_set_flags(child, crypto_ablkcipher_get_flags(tfm) in ablk_set_key()
48 crypto_ablkcipher_set_flags(tfm, crypto_ablkcipher_get_flags(child) in ablk_set_key()
56 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in __ablk_encrypt() local
57 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); in __ablk_encrypt()
60 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm); in __ablk_encrypt()
64 return crypto_blkcipher_crt(desc.tfm)->encrypt( in __ablk_encrypt()
71 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_encrypt() local
72 struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_encrypt()
[all …]
Dshash.c27 static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key, in shash_no_setkey() argument
33 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() argument
36 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned()
37 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_setkey_unaligned()
49 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
54 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
57 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
58 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
61 return shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
63 return shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
[all …]
Dapi.c287 static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_ops() argument
289 const struct crypto_type *type_obj = tfm->__crt_alg->cra_type; in crypto_init_ops()
292 return type_obj->init(tfm, type, mask); in crypto_init_ops()
294 switch (crypto_tfm_alg_type(tfm)) { in crypto_init_ops()
296 return crypto_init_cipher_ops(tfm); in crypto_init_ops()
299 return crypto_init_compress_ops(tfm); in crypto_init_ops()
309 static void crypto_exit_ops(struct crypto_tfm *tfm) in crypto_exit_ops() argument
311 const struct crypto_type *type = tfm->__crt_alg->cra_type; in crypto_exit_ops()
314 if (tfm->exit) in crypto_exit_ops()
315 tfm->exit(tfm); in crypto_exit_ops()
[all …]
Dcbc.c44 struct crypto_cipher *tfm) in crypto_cbc_encrypt_segment() argument
47 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_cbc_encrypt_segment()
48 int bsize = crypto_cipher_blocksize(tfm); in crypto_cbc_encrypt_segment()
56 fn(crypto_cipher_tfm(tfm), dst, iv); in crypto_cbc_encrypt_segment()
68 struct crypto_cipher *tfm) in crypto_cbc_encrypt_inplace() argument
71 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_cbc_encrypt_inplace()
72 int bsize = crypto_cipher_blocksize(tfm); in crypto_cbc_encrypt_inplace()
79 fn(crypto_cipher_tfm(tfm), src, src); in crypto_cbc_encrypt_inplace()
95 struct crypto_blkcipher *tfm = desc->tfm; in crypto_cbc_encrypt() local
96 struct crypto_cbc_ctx *ctx = crypto_blkcipher_ctx(tfm); in crypto_cbc_encrypt()
[all …]
Dpcbc.c47 struct crypto_cipher *tfm) in crypto_pcbc_encrypt_segment() argument
50 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_pcbc_encrypt_segment()
51 int bsize = crypto_cipher_blocksize(tfm); in crypto_pcbc_encrypt_segment()
59 fn(crypto_cipher_tfm(tfm), dst, iv); in crypto_pcbc_encrypt_segment()
72 struct crypto_cipher *tfm) in crypto_pcbc_encrypt_inplace() argument
75 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_pcbc_encrypt_inplace()
76 int bsize = crypto_cipher_blocksize(tfm); in crypto_pcbc_encrypt_inplace()
85 fn(crypto_cipher_tfm(tfm), src, iv); in crypto_pcbc_encrypt_inplace()
102 struct crypto_blkcipher *tfm = desc->tfm; in crypto_pcbc_encrypt() local
103 struct crypto_pcbc_ctx *ctx = crypto_blkcipher_ctx(tfm); in crypto_pcbc_encrypt()
[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()
46 void crypto_exit_compress_ops(struct crypto_tfm *tfm) in crypto_exit_compress_ops() argument
Dblkcipher.c302 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt()
304 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt()
305 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt()
314 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_phys()
316 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_phys()
317 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_phys()
353 walk->cipher_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt_block()
354 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt_block()
355 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt_block()
362 struct crypto_aead *tfm, in blkcipher_aead_walk_virt_block() argument
[all …]
Dcryptd.c164 static inline struct cryptd_queue *cryptd_get_queue(struct crypto_tfm *tfm) in cryptd_get_queue() argument
166 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue()
217 desc.tfm = child; in cryptd_blkcipher_crypt()
233 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
242 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
253 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue() local
256 queue = cryptd_get_queue(crypto_ablkcipher_tfm(tfm)); in cryptd_blkcipher_enqueue()
273 static int cryptd_blkcipher_init_tfm(struct crypto_tfm *tfm) in cryptd_blkcipher_init_tfm() argument
275 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_blkcipher_init_tfm()
278 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_blkcipher_init_tfm()
[all …]
Dctr.c56 struct crypto_cipher *tfm) in crypto_ctr_crypt_final() argument
58 unsigned int bsize = crypto_cipher_blocksize(tfm); in crypto_ctr_crypt_final()
59 unsigned long alignmask = crypto_cipher_alignmask(tfm); in crypto_ctr_crypt_final()
67 crypto_cipher_encrypt_one(tfm, keystream, ctrblk); in crypto_ctr_crypt_final()
75 struct crypto_cipher *tfm) in crypto_ctr_crypt_segment() argument
78 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_ctr_crypt_segment()
79 unsigned int bsize = crypto_cipher_blocksize(tfm); in crypto_ctr_crypt_segment()
87 fn(crypto_cipher_tfm(tfm), dst, ctrblk); in crypto_ctr_crypt_segment()
101 struct crypto_cipher *tfm) in crypto_ctr_crypt_inplace() argument
104 crypto_cipher_alg(tfm)->cia_encrypt; in crypto_ctr_crypt_inplace()
[all …]
Dansi_cprng.c54 struct crypto_cipher *tfm; member
163 crypto_cipher_encrypt_one(ctx->tfm, output, tmp); in _get_more_prng_bytes()
280 crypto_free_cipher(ctx->tfm); in free_prng_context()
313 ret = crypto_cipher_setkey(ctx->tfm, prng_key, klen); in reset_prng_context()
316 crypto_cipher_get_flags(ctx->tfm)); in reset_prng_context()
327 static int cprng_init(struct crypto_tfm *tfm) in cprng_init() argument
329 struct prng_context *ctx = crypto_tfm_ctx(tfm); in cprng_init()
332 ctx->tfm = crypto_alloc_cipher("aes", 0, 0); in cprng_init()
333 if (IS_ERR(ctx->tfm)) { in cprng_init()
336 return PTR_ERR(ctx->tfm); in cprng_init()
[all …]
Dablkcipher.c111 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_done() local
142 memcpy(req->info, walk->iv, tfm->crt_ablkcipher.ivsize); in ablkcipher_walk_done()
190 struct crypto_tfm *tfm, in ablkcipher_copy_iv() argument
194 unsigned int ivsize = tfm->crt_ablkcipher.ivsize; in ablkcipher_copy_iv()
228 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_next() local
233 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_next()
235 if (unlikely(n < crypto_tfm_alg_blocksize(tfm))) { in ablkcipher_walk_next()
273 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_first() local
276 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_first()
287 int err = ablkcipher_copy_iv(walk, tfm, alignmask); in ablkcipher_walk_first()
[all …]
Decb.c43 struct crypto_cipher *tfm, in crypto_ecb_crypt() argument
46 int bsize = crypto_cipher_blocksize(tfm); in crypto_ecb_crypt()
57 fn(crypto_cipher_tfm(tfm), wdst, wsrc); in crypto_ecb_crypt()
74 struct crypto_blkcipher *tfm = desc->tfm; in crypto_ecb_encrypt() local
75 struct crypto_ecb_ctx *ctx = crypto_blkcipher_ctx(tfm); in crypto_ecb_encrypt()
88 struct crypto_blkcipher *tfm = desc->tfm; in crypto_ecb_decrypt() local
89 struct crypto_ecb_ctx *ctx = crypto_blkcipher_ctx(tfm); in crypto_ecb_decrypt()
97 static int crypto_ecb_init_tfm(struct crypto_tfm *tfm) in crypto_ecb_init_tfm() argument
99 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_ecb_init_tfm()
101 struct crypto_ecb_ctx *ctx = crypto_tfm_ctx(tfm); in crypto_ecb_init_tfm()
[all …]
Daead.c29 static int setkey_unaligned(struct crypto_aead *tfm, const u8 *key, in setkey_unaligned() argument
32 struct aead_alg *aead = crypto_aead_alg(tfm); in setkey_unaligned()
33 unsigned long alignmask = crypto_aead_alignmask(tfm); in setkey_unaligned()
45 ret = aead->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
51 static int setkey(struct crypto_aead *tfm, const u8 *key, unsigned int keylen) in setkey() argument
53 struct aead_alg *aead = crypto_aead_alg(tfm); in setkey()
54 unsigned long alignmask = crypto_aead_alignmask(tfm); in setkey()
57 return setkey_unaligned(tfm, key, keylen); in setkey()
59 return aead->setkey(tfm, key, keylen); in setkey()
62 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in crypto_aead_setauthsize() argument
[all …]
Dtestmgr.c191 static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template, in __test_hash() argument
195 const char *algo = crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); in __test_hash()
217 req = ahash_request_alloc(tfm, GFP_KERNEL); in __test_hash()
245 crypto_ahash_clear_flags(tfm, ~0); in __test_hash()
253 ret = crypto_ahash_setkey(tfm, key, template[i].ksize); in __test_hash()
292 crypto_ahash_digestsize(tfm))) { in __test_hash()
295 hexdump(result, crypto_ahash_digestsize(tfm)); in __test_hash()
336 crypto_ahash_clear_flags(tfm, ~0); in __test_hash()
338 ret = crypto_ahash_setkey(tfm, key, template[i].ksize); in __test_hash()
369 crypto_ahash_digestsize(tfm))) { in __test_hash()
[all …]
Dmcryptd.c220 static inline struct mcryptd_queue *mcryptd_get_queue(struct crypto_tfm *tfm) in mcryptd_get_queue() argument
222 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in mcryptd_get_queue()
275 static int mcryptd_hash_init_tfm(struct crypto_tfm *tfm) in mcryptd_hash_init_tfm() argument
277 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in mcryptd_hash_init_tfm()
280 struct mcryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in mcryptd_hash_init_tfm()
288 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in mcryptd_hash_init_tfm()
294 static void mcryptd_hash_exit_tfm(struct crypto_tfm *tfm) in mcryptd_hash_exit_tfm() argument
296 struct mcryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in mcryptd_hash_exit_tfm()
323 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in mcryptd_hash_enqueue() local
325 mcryptd_get_queue(crypto_ahash_tfm(tfm)); in mcryptd_hash_enqueue()
[all …]
Dzlib.c67 static int zlib_init(struct crypto_tfm *tfm) in zlib_init() argument
72 static void zlib_exit(struct crypto_tfm *tfm) in zlib_exit() argument
74 struct zlib_ctx *ctx = crypto_tfm_ctx(tfm); in zlib_exit()
81 static int zlib_compress_setup(struct crypto_pcomp *tfm, void *params, in zlib_compress_setup() argument
84 struct zlib_ctx *ctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm)); in zlib_compress_setup()
130 static int zlib_compress_init(struct crypto_pcomp *tfm) in zlib_compress_init() argument
133 struct zlib_ctx *dctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm)); in zlib_compress_init()
143 static int zlib_compress_update(struct crypto_pcomp *tfm, in zlib_compress_update() argument
147 struct zlib_ctx *dctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm)); in zlib_compress_update()
181 static int zlib_compress_final(struct crypto_pcomp *tfm, in zlib_compress_final() argument
[all …]
Dalgif_hash.c242 struct algif_hash_tfm *tfm; in hash_check_key() local
252 tfm = pask->private; in hash_check_key()
256 if (!tfm->has_key) in hash_check_key()
347 struct algif_hash_tfm *tfm; in hash_bind() local
350 tfm = kzalloc(sizeof(*tfm), GFP_KERNEL); in hash_bind()
351 if (!tfm) in hash_bind()
356 kfree(tfm); in hash_bind()
360 tfm->hash = hash; in hash_bind()
362 return tfm; in hash_bind()
367 struct algif_hash_tfm *tfm = private; in hash_release() local
[all …]
Dlz4.c31 static int lz4_init(struct crypto_tfm *tfm) in lz4_init() argument
33 struct lz4_ctx *ctx = crypto_tfm_ctx(tfm); in lz4_init()
42 static void lz4_exit(struct crypto_tfm *tfm) in lz4_exit() argument
44 struct lz4_ctx *ctx = crypto_tfm_ctx(tfm); in lz4_exit()
48 static int lz4_compress_crypto(struct crypto_tfm *tfm, const u8 *src, in lz4_compress_crypto() argument
51 struct lz4_ctx *ctx = crypto_tfm_ctx(tfm); in lz4_compress_crypto()
64 static int lz4_decompress_crypto(struct crypto_tfm *tfm, const u8 *src, in lz4_decompress_crypto() argument
Dlz4hc.c30 static int lz4hc_init(struct crypto_tfm *tfm) in lz4hc_init() argument
32 struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); in lz4hc_init()
41 static void lz4hc_exit(struct crypto_tfm *tfm) in lz4hc_exit() argument
43 struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); in lz4hc_exit()
48 static int lz4hc_compress_crypto(struct crypto_tfm *tfm, const u8 *src, in lz4hc_compress_crypto() argument
51 struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); in lz4hc_compress_crypto()
64 static int lz4hc_decompress_crypto(struct crypto_tfm *tfm, const u8 *src, in lz4hc_decompress_crypto() argument
Dlzo.c30 static int lzo_init(struct crypto_tfm *tfm) in lzo_init() argument
32 struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); in lzo_init()
44 static void lzo_exit(struct crypto_tfm *tfm) in lzo_exit() argument
46 struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); in lzo_exit()
51 static int lzo_compress(struct crypto_tfm *tfm, const u8 *src, in lzo_compress() argument
54 struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); in lzo_compress()
67 static int lzo_decompress(struct crypto_tfm *tfm, const u8 *src, in lzo_decompress() argument
Dxcbc.c84 unsigned long alignmask = crypto_shash_alignmask(pdesc->tfm); in crypto_xcbc_digest_init()
86 int bs = crypto_shash_blocksize(pdesc->tfm); in crypto_xcbc_digest_init()
98 struct crypto_shash *parent = pdesc->tfm; in crypto_xcbc_digest_update()
102 struct crypto_cipher *tfm = tctx->child; in crypto_xcbc_digest_update() local
120 crypto_cipher_encrypt_one(tfm, prev, prev); in crypto_xcbc_digest_update()
128 crypto_cipher_encrypt_one(tfm, prev, prev); in crypto_xcbc_digest_update()
144 struct crypto_shash *parent = pdesc->tfm; in crypto_xcbc_digest_final()
148 struct crypto_cipher *tfm = tctx->child; in crypto_xcbc_digest_final() local
172 crypto_cipher_encrypt_one(tfm, out, prev); in crypto_xcbc_digest_final()
177 static int xcbc_init_tfm(struct crypto_tfm *tfm) in xcbc_init_tfm() argument
[all …]
Dtea.c47 static int tea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in tea_setkey() argument
50 struct tea_ctx *ctx = crypto_tfm_ctx(tfm); in tea_setkey()
62 static void tea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in tea_encrypt() argument
66 struct tea_ctx *ctx = crypto_tfm_ctx(tfm); in tea_encrypt()
90 static void tea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in tea_decrypt() argument
94 struct tea_ctx *ctx = crypto_tfm_ctx(tfm); in tea_decrypt()
120 static int xtea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in xtea_setkey() argument
123 struct xtea_ctx *ctx = crypto_tfm_ctx(tfm); in xtea_setkey()
135 static void xtea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in xtea_encrypt() argument
139 struct xtea_ctx *ctx = crypto_tfm_ctx(tfm); in xtea_encrypt()
[all …]
Dcmac.c110 unsigned long alignmask = crypto_shash_alignmask(pdesc->tfm); in crypto_cmac_digest_init()
112 int bs = crypto_shash_blocksize(pdesc->tfm); in crypto_cmac_digest_init()
124 struct crypto_shash *parent = pdesc->tfm; in crypto_cmac_digest_update()
128 struct crypto_cipher *tfm = tctx->child; in crypto_cmac_digest_update() local
146 crypto_cipher_encrypt_one(tfm, prev, prev); in crypto_cmac_digest_update()
154 crypto_cipher_encrypt_one(tfm, prev, prev); in crypto_cmac_digest_update()
170 struct crypto_shash *parent = pdesc->tfm; in crypto_cmac_digest_final()
174 struct crypto_cipher *tfm = tctx->child; in crypto_cmac_digest_final() local
198 crypto_cipher_encrypt_one(tfm, out, prev); in crypto_cmac_digest_final()
203 static int cmac_init_tfm(struct crypto_tfm *tfm) in cmac_init_tfm() argument
[all …]
Dhmac.c37 static inline struct hmac_ctx *hmac_ctx(struct crypto_shash *tfm) in hmac_ctx() argument
39 return align_ptr(crypto_shash_ctx_aligned(tfm) + in hmac_ctx()
40 crypto_shash_statesize(tfm) * 2, in hmac_ctx()
58 shash->tfm = hash; in hmac_setkey()
101 struct hmac_ctx *ctx = hmac_ctx(pdesc->tfm); in hmac_import()
103 desc->tfm = ctx->hash; in hmac_import()
111 return hmac_import(pdesc, crypto_shash_ctx_aligned(pdesc->tfm)); in hmac_init()
126 struct crypto_shash *parent = pdesc->tfm; in hmac_final()
143 struct crypto_shash *parent = pdesc->tfm; in hmac_finup()
156 static int hmac_init_tfm(struct crypto_tfm *tfm) in hmac_init_tfm() argument
[all …]
Dahash.c181 walk->alignmask = crypto_hash_alignmask(hdesc->tfm); in crypto_hash_walk_first_compat()
188 static int ahash_setkey_unaligned(struct crypto_ahash *tfm, const u8 *key, in ahash_setkey_unaligned() argument
191 unsigned long alignmask = crypto_ahash_alignmask(tfm); in ahash_setkey_unaligned()
203 ret = tfm->setkey(tfm, alignbuffer, keylen); in ahash_setkey_unaligned()
208 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, in crypto_ahash_setkey() argument
211 unsigned long alignmask = crypto_ahash_alignmask(tfm); in crypto_ahash_setkey()
214 return ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey()
216 return tfm->setkey(tfm, key, keylen); in crypto_ahash_setkey()
220 static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key, in ahash_nosetkey() argument
234 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ahash_save_req() local
[all …]
D842.c50 static int nx842_init(struct crypto_tfm *tfm) in nx842_init() argument
52 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm); in nx842_init()
63 static void nx842_exit(struct crypto_tfm *tfm) in nx842_exit() argument
65 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm); in nx842_exit()
77 static int nx842_crypto_compress(struct crypto_tfm *tfm, const u8 *src, in nx842_crypto_compress() argument
80 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm); in nx842_crypto_compress()
119 static int nx842_crypto_decompress(struct crypto_tfm *tfm, const u8 *src, in nx842_crypto_decompress() argument
122 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm); in nx842_crypto_decompress()
Dcts.c80 int bsize = crypto_blkcipher_blocksize(desc->tfm); in cts_cbc_encrypt()
100 lcldesc.tfm = ctx->child; in cts_cbc_encrypt()
129 struct crypto_cts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in crypto_cts_encrypt()
130 int bsize = crypto_blkcipher_blocksize(desc->tfm); in crypto_cts_encrypt()
136 lcldesc.tfm = ctx->child; in crypto_cts_encrypt()
166 int bsize = crypto_blkcipher_blocksize(desc->tfm); in cts_cbc_decrypt()
183 lcldesc.tfm = ctx->child; in cts_cbc_decrypt()
224 struct crypto_cts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in crypto_cts_decrypt()
225 int bsize = crypto_blkcipher_blocksize(desc->tfm); in crypto_cts_decrypt()
231 lcldesc.tfm = ctx->child; in crypto_cts_decrypt()
[all …]
Dcrc32c_generic.c63 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_init()
76 static int chksum_setkey(struct crypto_shash *tfm, const u8 *key, in chksum_setkey() argument
79 struct chksum_ctx *mctx = crypto_shash_ctx(tfm); in chksum_setkey()
82 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in chksum_setkey()
123 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_digest()
128 static int crc32c_cra_init(struct crypto_tfm *tfm) in crc32c_cra_init() argument
130 struct chksum_ctx *mctx = crypto_tfm_ctx(tfm); in crc32c_cra_init()
Dtcrypt.c53 #define get_driver_name(tfm_type, tfm) crypto_tfm_alg_driver_name(tfm_type ## _tfm(tfm)) argument
274 struct crypto_aead *tfm; in test_aead_speed() local
317 tfm = crypto_alloc_aead(algo, 0, 0); in test_aead_speed()
319 if (IS_ERR(tfm)) { in test_aead_speed()
321 PTR_ERR(tfm)); in test_aead_speed()
326 get_driver_name(crypto_aead, tfm), e); in test_aead_speed()
328 req = aead_request_alloc(tfm, GFP_KERNEL); in test_aead_speed()
357 ret = crypto_aead_setkey(tfm, key, *keysize); in test_aead_speed()
358 ret = crypto_aead_setauthsize(tfm, authsize); in test_aead_speed()
360 iv_len = crypto_aead_ivsize(tfm); in test_aead_speed()
[all …]
Ddeflate.c104 static int deflate_init(struct crypto_tfm *tfm) in deflate_init() argument
106 struct deflate_ctx *ctx = crypto_tfm_ctx(tfm); in deflate_init()
119 static void deflate_exit(struct crypto_tfm *tfm) in deflate_exit() argument
121 struct deflate_ctx *ctx = crypto_tfm_ctx(tfm); in deflate_exit()
127 static int deflate_compress(struct crypto_tfm *tfm, const u8 *src, in deflate_compress() argument
131 struct deflate_ctx *dctx = crypto_tfm_ctx(tfm); in deflate_compress()
156 static int deflate_decompress(struct crypto_tfm *tfm, const u8 *src, in deflate_decompress() argument
161 struct deflate_ctx *dctx = crypto_tfm_ctx(tfm); in deflate_decompress()
Dchainiv.c107 static int chainiv_init_common(struct crypto_tfm *tfm) in chainiv_init_common() argument
109 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request); in chainiv_init_common()
111 return skcipher_geniv_init(tfm); in chainiv_init_common()
114 static int chainiv_init(struct crypto_tfm *tfm) in chainiv_init() argument
116 struct chainiv_ctx *ctx = crypto_tfm_ctx(tfm); in chainiv_init()
120 return chainiv_init_common(tfm); in chainiv_init()
264 static int async_chainiv_init(struct crypto_tfm *tfm) in async_chainiv_init() argument
266 struct async_chainiv_ctx *ctx = crypto_tfm_ctx(tfm); in async_chainiv_init()
273 return chainiv_init_common(tfm); in async_chainiv_init()
276 static void async_chainiv_exit(struct crypto_tfm *tfm) in async_chainiv_exit() argument
[all …]
Dghash-generic.c44 static int ghash_setkey(struct crypto_shash *tfm, in ghash_setkey() argument
47 struct ghash_ctx *ctx = crypto_shash_ctx(tfm); in ghash_setkey()
50 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ghash_setkey()
67 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update()
122 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
134 static void ghash_exit_tfm(struct crypto_tfm *tfm) in ghash_exit_tfm() argument
136 struct ghash_ctx *ctx = crypto_tfm_ctx(tfm); in ghash_exit_tfm()
Drng.c32 static int rngapi_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen) in rngapi_reset() argument
46 err = crypto_rng_alg(tfm)->rng_reset(tfm, seed, slen); in rngapi_reset()
52 static int crypto_init_rng_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_rng_ops() argument
54 struct rng_alg *alg = &tfm->__crt_alg->cra_rng; in crypto_init_rng_ops()
55 struct rng_tfm *ops = &tfm->crt_rng; in crypto_init_rng_ops()
Dccm.c81 struct crypto_cipher *tfm = ctx->cipher; in crypto_ccm_setkey() local
93 crypto_cipher_clear_flags(tfm, CRYPTO_TFM_REQ_MASK); in crypto_ccm_setkey()
94 crypto_cipher_set_flags(tfm, crypto_aead_get_flags(aead) & in crypto_ccm_setkey()
96 err = crypto_cipher_setkey(tfm, key, keylen); in crypto_ccm_setkey()
97 crypto_aead_set_flags(aead, crypto_cipher_get_flags(tfm) & in crypto_ccm_setkey()
104 static int crypto_ccm_setauthsize(struct crypto_aead *tfm, in crypto_ccm_setauthsize() argument
164 static void compute_mac(struct crypto_cipher *tfm, u8 *data, int n, in compute_mac() argument
179 crypto_cipher_encrypt_one(tfm, odata, odata); in compute_mac()
188 crypto_cipher_encrypt_one(tfm, odata, odata); in compute_mac()
203 static void get_data_to_compute(struct crypto_cipher *tfm, in get_data_to_compute() argument
[all …]
Dxts.c82 struct crypto_tfm *tfm; member
89 s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */ in xts_round()
102 .tfm = crypto_cipher_tfm(ctx->child), in crypt()
150 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in encrypt()
161 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in decrypt()
241 static int init_tfm(struct crypto_tfm *tfm) in init_tfm() argument
244 struct crypto_instance *inst = (void *)tfm->__crt_alg; in init_tfm()
246 struct priv *ctx = crypto_tfm_ctx(tfm); in init_tfm()
247 u32 *flags = &tfm->crt_flags; in init_tfm()
280 static void exit_tfm(struct crypto_tfm *tfm) in exit_tfm() argument
[all …]
Ddrbg.c1583 struct crypto_shash *tfm; in drbg_init_hash_kernel() local
1585 tfm = crypto_alloc_shash(drbg->core->backend_cra_name, 0, 0); in drbg_init_hash_kernel()
1586 if (IS_ERR(tfm)) { in drbg_init_hash_kernel()
1588 return PTR_ERR(tfm); in drbg_init_hash_kernel()
1590 BUG_ON(drbg_blocklen(drbg) != crypto_shash_digestsize(tfm)); in drbg_init_hash_kernel()
1591 sdesc = kzalloc(sizeof(struct shash_desc) + crypto_shash_descsize(tfm), in drbg_init_hash_kernel()
1594 crypto_free_shash(tfm); in drbg_init_hash_kernel()
1598 sdesc->shash.tfm = tfm; in drbg_init_hash_kernel()
1608 crypto_free_shash(sdesc->shash.tfm); in drbg_fini_hash_kernel()
1622 crypto_shash_setkey(sdesc->shash.tfm, key, drbg_statelen(drbg)); in drbg_kcapi_hash()
[all …]
Dlrw.c101 struct crypto_tfm *tfm; member
115 s->fn(s->tfm, dst, dst); /* CC <- E(Key2,PP) */ in lrw_round()
146 .tfm = crypto_cipher_tfm(ctx->child), in crypt()
198 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in encrypt()
209 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in decrypt()
296 static int init_tfm(struct crypto_tfm *tfm) in init_tfm() argument
299 struct crypto_instance *inst = (void *)tfm->__crt_alg; in init_tfm()
301 struct priv *ctx = crypto_tfm_ctx(tfm); in init_tfm()
302 u32 *flags = &tfm->crt_flags; in init_tfm()
318 static void exit_tfm(struct crypto_tfm *tfm) in exit_tfm() argument
[all …]
Dalgif_skcipher.c310 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req); in skcipher_sendmsg() local
311 unsigned ivsize = crypto_ablkcipher_ivsize(tfm); in skcipher_sendmsg()
763 struct skcipher_tfm *tfm; in skcipher_check_key() local
773 tfm = pask->private; in skcipher_check_key()
777 if (!tfm->has_key) in skcipher_check_key()
856 struct skcipher_tfm *tfm; in skcipher_bind() local
859 tfm = kzalloc(sizeof(*tfm), GFP_KERNEL); in skcipher_bind()
860 if (!tfm) in skcipher_bind()
865 kfree(tfm); in skcipher_bind()
869 tfm->skcipher = skcipher; in skcipher_bind()
[all …]
Dkhazad.c756 static int khazad_setkey(struct crypto_tfm *tfm, const u8 *in_key, in khazad_setkey() argument
759 struct khazad_ctx *ctx = crypto_tfm_ctx(tfm); in khazad_setkey()
837 static void khazad_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in khazad_encrypt() argument
839 struct khazad_ctx *ctx = crypto_tfm_ctx(tfm); in khazad_encrypt()
843 static void khazad_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in khazad_decrypt() argument
845 struct khazad_ctx *ctx = crypto_tfm_ctx(tfm); in khazad_decrypt()
Darc4.c29 static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key, in arc4_set_key() argument
32 struct arc4_ctx *ctx = crypto_tfm_ctx(tfm); in arc4_set_key()
90 static void arc4_crypt_one(struct crypto_tfm *tfm, u8 *out, const u8 *in) in arc4_crypt_one() argument
92 arc4_crypt(crypto_tfm_ctx(tfm), out, in, 1); in arc4_crypt_one()
98 struct arc4_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_arc4_crypt()
Dcrc32.c48 static int crc32_cra_init(struct crypto_tfm *tfm) in crc32_cra_init() argument
50 u32 *key = crypto_tfm_ctx(tfm); in crc32_cra_init()
78 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_init()
120 return __crc32_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32_digest()
Danubis.c462 static int anubis_setkey(struct crypto_tfm *tfm, const u8 *in_key, in anubis_setkey() argument
465 struct anubis_ctx *ctx = crypto_tfm_ctx(tfm); in anubis_setkey()
467 u32 *flags = &tfm->crt_flags; in anubis_setkey()
662 static void anubis_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in anubis_encrypt() argument
664 struct anubis_ctx *ctx = crypto_tfm_ctx(tfm); in anubis_encrypt()
668 static void anubis_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in anubis_decrypt() argument
670 struct anubis_ctx *ctx = crypto_tfm_ctx(tfm); in anubis_decrypt()
Dinternal.h77 int crypto_init_cipher_ops(struct crypto_tfm *tfm);
78 int crypto_init_compress_ops(struct crypto_tfm *tfm);
80 void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
81 void crypto_exit_compress_ops(struct crypto_tfm *tfm);
Dseqiv.c235 static int seqiv_init(struct crypto_tfm *tfm) in seqiv_init() argument
237 struct crypto_ablkcipher *geniv = __crypto_ablkcipher_cast(tfm); in seqiv_init()
242 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request); in seqiv_init()
244 return skcipher_geniv_init(tfm); in seqiv_init()
247 static int seqiv_aead_init(struct crypto_tfm *tfm) in seqiv_aead_init() argument
249 struct crypto_aead *geniv = __crypto_aead_cast(tfm); in seqiv_aead_init()
254 tfm->crt_aead.reqsize = sizeof(struct aead_request); in seqiv_aead_init()
256 return aead_geniv_init(tfm); in seqiv_aead_init()
Dcrypto_null.c28 static int null_compress(struct crypto_tfm *tfm, const u8 *src, in null_compress() argument
60 static int null_hash_setkey(struct crypto_shash *tfm, const u8 *key, in null_hash_setkey() argument
64 static int null_setkey(struct crypto_tfm *tfm, const u8 *key, in null_setkey() argument
68 static void null_crypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in null_crypt() argument
Dmichael_mic.c53 struct michael_mic_ctx *ctx = crypto_shash_ctx(desc->tfm); in michael_init()
136 static int michael_setkey(struct crypto_shash *tfm, const u8 *key, in michael_setkey() argument
139 struct michael_mic_ctx *mctx = crypto_shash_ctx(tfm); in michael_setkey()
144 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in michael_setkey()
Dseed.c331 static int seed_set_key(struct crypto_tfm *tfm, const u8 *in_key, in seed_set_key() argument
334 struct seed_ctx *ctx = crypto_tfm_ctx(tfm); in seed_set_key()
368 static void seed_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in seed_encrypt() argument
370 const struct seed_ctx *ctx = crypto_tfm_ctx(tfm); in seed_encrypt()
406 static void seed_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in seed_decrypt() argument
408 const struct seed_ctx *ctx = crypto_tfm_ctx(tfm); in seed_decrypt()
Dblowfish_generic.c41 static void bf_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in bf_encrypt() argument
43 struct bf_ctx *ctx = crypto_tfm_ctx(tfm); in bf_encrypt()
75 static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in bf_decrypt() argument
77 struct bf_ctx *ctx = crypto_tfm_ctx(tfm); in bf_decrypt()
Dalgapi.c653 struct crypto_tfm *tfm; in crypto_spawn_tfm() local
659 tfm = ERR_PTR(-EINVAL); in crypto_spawn_tfm()
663 tfm = __crypto_alloc_tfm(alg, type, mask); in crypto_spawn_tfm()
664 if (IS_ERR(tfm)) in crypto_spawn_tfm()
667 return tfm; in crypto_spawn_tfm()
671 return tfm; in crypto_spawn_tfm()
678 struct crypto_tfm *tfm; in crypto_spawn_tfm2() local
684 tfm = crypto_create_tfm(alg, spawn->frontend); in crypto_spawn_tfm2()
685 if (IS_ERR(tfm)) in crypto_spawn_tfm2()
688 return tfm; in crypto_spawn_tfm2()
[all …]
Dtwofish_generic.c109 static void twofish_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in twofish_encrypt() argument
111 struct twofish_ctx *ctx = crypto_tfm_ctx(tfm); in twofish_encrypt()
146 static void twofish_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in twofish_decrypt() argument
148 struct twofish_ctx *ctx = crypto_tfm_ctx(tfm); in twofish_decrypt()
Dcast6_generic.c157 int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in cast6_setkey() argument
159 return __cast6_setkey(crypto_tfm_ctx(tfm), key, keylen, in cast6_setkey()
160 &tfm->crt_flags); in cast6_setkey()
217 static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) in cast6_encrypt() argument
219 __cast6_encrypt(crypto_tfm_ctx(tfm), outbuf, inbuf); in cast6_encrypt()
255 static void cast6_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) in cast6_decrypt() argument
257 __cast6_decrypt(crypto_tfm_ctx(tfm), outbuf, inbuf); in cast6_decrypt()
Dkrng.c19 static int krng_get_random(struct crypto_rng *tfm, u8 *rdata, unsigned int dlen) in krng_get_random() argument
25 static int krng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen) in krng_reset() argument
Dgcm.c170 static int crypto_gcm_setauthsize(struct crypto_aead *tfm, in crypto_gcm_setauthsize() argument
463 struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in gcm_hash()
651 static int crypto_gcm_init_tfm(struct crypto_tfm *tfm) in crypto_gcm_init_tfm() argument
653 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_gcm_init_tfm()
655 struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(tfm); in crypto_gcm_init_tfm()
673 align = crypto_tfm_alg_alignmask(tfm); in crypto_gcm_init_tfm()
675 tfm->crt_aead.reqsize = align + in crypto_gcm_init_tfm()
689 static void crypto_gcm_exit_tfm(struct crypto_tfm *tfm) in crypto_gcm_exit_tfm() argument
691 struct crypto_gcm_ctx *ctx = crypto_tfm_ctx(tfm); in crypto_gcm_exit_tfm()
933 static int crypto_rfc4106_init_tfm(struct crypto_tfm *tfm) in crypto_rfc4106_init_tfm() argument
[all …]
Dsalsa20_generic.c169 static int setkey(struct crypto_tfm *tfm, const u8 *key, in setkey() argument
172 struct salsa20_ctx *ctx = crypto_tfm_ctx(tfm); in setkey()
182 struct crypto_blkcipher *tfm = desc->tfm; in encrypt() local
183 struct salsa20_ctx *ctx = crypto_blkcipher_ctx(tfm); in encrypt()
Ddes_generic.c781 static int des_setkey(struct crypto_tfm *tfm, const u8 *key, in des_setkey() argument
784 struct des_ctx *dctx = crypto_tfm_ctx(tfm); in des_setkey()
785 u32 *flags = &tfm->crt_flags; in des_setkey()
803 static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des_encrypt() argument
805 struct des_ctx *ctx = crypto_tfm_ctx(tfm); in des_encrypt()
826 static void des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des_decrypt() argument
828 struct des_ctx *ctx = crypto_tfm_ctx(tfm); in des_decrypt()
882 static int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, in des3_ede_setkey() argument
885 struct des3_ede_ctx *dctx = crypto_tfm_ctx(tfm); in des3_ede_setkey()
886 u32 *flags = &tfm->crt_flags; in des3_ede_setkey()
[all …]
Daes_generic.c1282 int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in crypto_aes_set_key() argument
1285 struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in crypto_aes_set_key()
1286 u32 *flags = &tfm->crt_flags; in crypto_aes_set_key()
1329 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_encrypt() argument
1331 const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_encrypt()
1401 static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_decrypt() argument
1403 const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_decrypt()
Dpcompress.c36 static int crypto_pcomp_init(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_pcomp_init() argument
46 static int crypto_pcomp_init_tfm(struct crypto_tfm *tfm) in crypto_pcomp_init_tfm() argument
Deseqiv.c172 static int eseqiv_init(struct crypto_tfm *tfm) in eseqiv_init() argument
174 struct crypto_ablkcipher *geniv = __crypto_ablkcipher_cast(tfm); in eseqiv_init()
198 tfm->crt_ablkcipher.reqsize = reqsize + in eseqiv_init()
201 return skcipher_geniv_init(tfm); in eseqiv_init()
/linux-4.1.27/security/integrity/ima/
Dima_crypto.c86 struct crypto_shash *tfm = ima_shash_tfm; in ima_alloc_tfm() local
93 tfm = crypto_alloc_shash(hash_algo_name[algo], 0, 0); in ima_alloc_tfm()
94 if (IS_ERR(tfm)) { in ima_alloc_tfm()
95 rc = PTR_ERR(tfm); in ima_alloc_tfm()
100 return tfm; in ima_alloc_tfm()
103 static void ima_free_tfm(struct crypto_shash *tfm) in ima_free_tfm() argument
105 if (tfm != ima_shash_tfm) in ima_free_tfm()
106 crypto_free_shash(tfm); in ima_free_tfm()
173 struct crypto_ahash *tfm = ima_ahash_tfm; in ima_alloc_atfm() local
179 if (algo != ima_hash_algo || !tfm) { in ima_alloc_atfm()
[all …]
/linux-4.1.27/arch/s390/crypto/
Daes_s390.c94 static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key, in setkey_fallback_cip() argument
97 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in setkey_fallback_cip()
101 sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_cip()
106 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey_fallback_cip()
107 tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags & in setkey_fallback_cip()
113 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
116 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_set_key()
117 u32 *flags = &tfm->crt_flags; in aes_set_key()
132 return setkey_fallback_cip(tfm, in_key, key_len); in aes_set_key()
135 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_encrypt() argument
[all …]
Ddes_s390.c35 static int des_setkey(struct crypto_tfm *tfm, const u8 *key, in des_setkey() argument
38 struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm); in des_setkey()
39 u32 *flags = &tfm->crt_flags; in des_setkey()
52 static void des_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in des_encrypt() argument
54 struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm); in des_encrypt()
59 static void des_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in des_decrypt() argument
61 struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm); in des_decrypt()
111 struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_desall_crypt()
147 struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_des_encrypt()
158 struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_des_decrypt()
[all …]
Dghash_s390.c32 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_init()
40 static int ghash_setkey(struct crypto_shash *tfm, in ghash_setkey() argument
43 struct ghash_ctx *ctx = crypto_shash_ctx(tfm); in ghash_setkey()
46 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ghash_setkey()
Dsha_common.c24 unsigned int bsize = crypto_shash_blocksize(desc->tfm); in s390_sha_update()
66 unsigned int bsize = crypto_shash_blocksize(desc->tfm); in s390_sha_final()
97 memcpy(out, ctx->state, crypto_shash_digestsize(desc->tfm)); in s390_sha_final()
/linux-4.1.27/net/mac80211/
Daes_gcm.c19 void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, in ieee80211_aes_gcm_encrypt() argument
25 crypto_aead_reqsize(tfm)] in ieee80211_aes_gcm_encrypt()
37 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_gcm_encrypt()
44 int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, in ieee80211_aes_gcm_decrypt() argument
49 crypto_aead_reqsize(tfm)] in ieee80211_aes_gcm_decrypt()
64 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_gcm_decrypt()
75 struct crypto_aead *tfm; in ieee80211_aes_gcm_key_setup_encrypt() local
78 tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_gcm_key_setup_encrypt()
79 if (IS_ERR(tfm)) in ieee80211_aes_gcm_key_setup_encrypt()
80 return tfm; in ieee80211_aes_gcm_key_setup_encrypt()
[all …]
Daes_ccm.c22 void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, in ieee80211_aes_ccm_encrypt() argument
29 crypto_aead_reqsize(tfm)] in ieee80211_aes_ccm_encrypt()
41 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_ccm_encrypt()
48 int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, in ieee80211_aes_ccm_decrypt() argument
54 crypto_aead_reqsize(tfm)] in ieee80211_aes_ccm_decrypt()
69 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_ccm_decrypt()
80 struct crypto_aead *tfm; in ieee80211_aes_key_setup_encrypt() local
83 tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_key_setup_encrypt()
84 if (IS_ERR(tfm)) in ieee80211_aes_key_setup_encrypt()
85 return tfm; in ieee80211_aes_key_setup_encrypt()
[all …]
Daes_gmac.c24 int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, in ieee80211_aes_gmac() argument
29 crypto_aead_reqsize(tfm)] in ieee80211_aes_gmac()
52 aead_request_set_tfm(aead_req, tfm); in ieee80211_aes_gmac()
64 struct crypto_aead *tfm; in ieee80211_aes_gmac_key_setup() local
67 tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_gmac_key_setup()
68 if (IS_ERR(tfm)) in ieee80211_aes_gmac_key_setup()
69 return tfm; in ieee80211_aes_gmac_key_setup()
71 err = crypto_aead_setkey(tfm, key, key_len); in ieee80211_aes_gmac_key_setup()
73 err = crypto_aead_setauthsize(tfm, GMAC_MIC_LEN); in ieee80211_aes_gmac_key_setup()
75 return tfm; in ieee80211_aes_gmac_key_setup()
[all …]
Daes_cmac.c38 static void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, in aes_cmac_vector() argument
67 crypto_cipher_encrypt_one(tfm, cbc, cbc); in aes_cmac_vector()
72 crypto_cipher_encrypt_one(tfm, pad, pad); in aes_cmac_vector()
90 crypto_cipher_encrypt_one(tfm, pad, pad); in aes_cmac_vector()
95 void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, in ieee80211_aes_cmac() argument
110 aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); in ieee80211_aes_cmac()
113 void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, in ieee80211_aes_cmac_256() argument
128 aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); in ieee80211_aes_cmac_256()
134 struct crypto_cipher *tfm; in ieee80211_aes_cmac_key_setup() local
136 tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); in ieee80211_aes_cmac_key_setup()
[all …]
Daes_cmac.h16 void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad,
18 void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad,
20 void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm);
Daes_gcm.h14 void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
16 int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
20 void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm);
Daes_ccm.h18 void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
21 int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
24 void ieee80211_aes_key_free(struct crypto_aead *tfm);
Dkey.h89 struct crypto_aead *tfm; member
95 struct crypto_cipher *tfm; member
102 struct crypto_aead *tfm; member
114 struct crypto_aead *tfm; member
Dwep.c134 int ieee80211_wep_encrypt_data(struct crypto_cipher *tfm, u8 *rc4key, in ieee80211_wep_encrypt_data() argument
140 if (IS_ERR(tfm)) in ieee80211_wep_encrypt_data()
146 crypto_cipher_setkey(tfm, rc4key, klen); in ieee80211_wep_encrypt_data()
148 crypto_cipher_encrypt_one(tfm, data + i, data + i); in ieee80211_wep_encrypt_data()
195 int ieee80211_wep_decrypt_data(struct crypto_cipher *tfm, u8 *rc4key, in ieee80211_wep_decrypt_data() argument
201 if (IS_ERR(tfm)) in ieee80211_wep_decrypt_data()
204 crypto_cipher_setkey(tfm, rc4key, klen); in ieee80211_wep_decrypt_data()
206 crypto_cipher_decrypt_one(tfm, data + i, data + i); in ieee80211_wep_decrypt_data()
Daes_gmac.h16 int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce,
18 void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm);
Dkey.c431 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
433 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
434 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
449 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
451 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
452 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
472 key->u.aes_cmac.tfm = in ieee80211_key_alloc()
474 if (IS_ERR(key->u.aes_cmac.tfm)) { in ieee80211_key_alloc()
475 err = PTR_ERR(key->u.aes_cmac.tfm); in ieee80211_key_alloc()
491 key->u.aes_gmac.tfm = in ieee80211_key_alloc()
[all …]
Dtkip.h18 int ieee80211_tkip_encrypt_data(struct crypto_cipher *tfm,
29 int ieee80211_tkip_decrypt_data(struct crypto_cipher *tfm,
Dwep.h21 int ieee80211_wep_encrypt_data(struct crypto_cipher *tfm, u8 *rc4key,
26 int ieee80211_wep_decrypt_data(struct crypto_cipher *tfm, u8 *rc4key,
/linux-4.1.27/drivers/staging/lustre/lustre/obdclass/
Dcapa.c80 unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm) in ll_crypto_tfm_alg_min_keysize() argument
82 return crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher.min_keysize; in ll_crypto_tfm_alg_min_keysize()
242 static inline int ll_crypto_hmac(struct crypto_hash *tfm, in ll_crypto_hmac() argument
249 desc.tfm = tfm; in ll_crypto_hmac()
251 rv = crypto_hash_setkey(desc.tfm, key, *keylen); in ll_crypto_hmac()
261 struct crypto_hash *tfm; in capa_hmac() local
273 tfm = crypto_alloc_hash(alg->ha_name, 0, 0); in capa_hmac()
274 if (IS_ERR(tfm)) { in capa_hmac()
276 return PTR_ERR(tfm); in capa_hmac()
285 ll_crypto_hmac(tfm, key, &keylen, &sl, sl.length, hmac); in capa_hmac()
[all …]
/linux-4.1.27/drivers/crypto/
Dgeode-aes.c116 static int geode_setkey_cip(struct crypto_tfm *tfm, const u8 *key, in geode_setkey_cip() argument
119 struct geode_aes_op *op = crypto_tfm_ctx(tfm); in geode_setkey_cip()
131 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in geode_setkey_cip()
139 op->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); in geode_setkey_cip()
143 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in geode_setkey_cip()
144 tfm->crt_flags |= (op->fallback.cip->base.crt_flags & CRYPTO_TFM_RES_MASK); in geode_setkey_cip()
149 static int geode_setkey_blk(struct crypto_tfm *tfm, const u8 *key, in geode_setkey_blk() argument
152 struct geode_aes_op *op = crypto_tfm_ctx(tfm); in geode_setkey_blk()
164 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in geode_setkey_blk()
172 op->fallback.blk->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); in geode_setkey_blk()
[all …]
Dixp4xx_crypto.c147 struct crypto_tfm *tfm; member
235 static inline u32 cipher_cfg_enc(struct crypto_tfm *tfm) in cipher_cfg_enc() argument
237 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_enc; in cipher_cfg_enc()
240 static inline u32 cipher_cfg_dec(struct crypto_tfm *tfm) in cipher_cfg_dec() argument
242 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_dec; in cipher_cfg_dec()
245 static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) in ix_hash() argument
247 return container_of(tfm->__crt_alg, struct ixp_alg, crypto)->hash; in ix_hash()
340 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in finish_scattered_hmac() local
341 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac()
386 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
[all …]
Dpicoxcell_crypto.c408 struct spacc_alg *alg = to_spacc_alg(req->req->tfm->__crt_alg); in spacc_aead_free_ddts()
409 struct spacc_ablk_ctx *aead_ctx = crypto_tfm_ctx(req->req->tfm); in spacc_aead_free_ddts()
448 struct crypto_tfm *tfm = crypto_aead_tfm(aead); in spacc_aead_des_setkey() local
449 struct spacc_aead_ctx *ctx = crypto_tfm_ctx(tfm); in spacc_aead_des_setkey()
454 tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY; in spacc_aead_des_setkey()
468 struct crypto_tfm *tfm = crypto_aead_tfm(aead); in spacc_aead_aes_setkey() local
469 struct spacc_aead_ctx *ctx = crypto_tfm_ctx(tfm); in spacc_aead_aes_setkey()
483 tfm->crt_flags & CRYPTO_TFM_REQ_MASK; in spacc_aead_aes_setkey()
493 static int spacc_aead_setkey(struct crypto_aead *tfm, const u8 *key, in spacc_aead_setkey() argument
496 struct spacc_aead_ctx *ctx = crypto_aead_ctx(tfm); in spacc_aead_setkey()
[all …]
Dmxs-dcp.c254 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_block_crypt()
377 struct crypto_tfm *tfm = in mxs_dcp_block_fallback() local
390 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in mxs_dcp_block_fallback()
399 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_enqueue()
439 static int mxs_dcp_aes_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in mxs_dcp_aes_setkey() argument
442 struct dcp_async_ctx *actx = crypto_ablkcipher_ctx(tfm); in mxs_dcp_aes_setkey()
458 tfm->base.crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in mxs_dcp_aes_setkey()
469 tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK; in mxs_dcp_aes_setkey()
475 tfm->base.crt_flags &= ~CRYPTO_TFM_RES_MASK; in mxs_dcp_aes_setkey()
476 tfm->base.crt_flags |= in mxs_dcp_aes_setkey()
[all …]
Dn2_core.c253 static inline struct n2_ahash_alg *n2_ahash_alg(struct crypto_tfm *tfm) in n2_ahash_alg() argument
255 struct crypto_alg *alg = tfm->__crt_alg; in n2_ahash_alg()
268 static inline struct n2_hmac_alg *n2_hmac_alg(struct crypto_tfm *tfm) in n2_hmac_alg() argument
270 struct crypto_alg *alg = tfm->__crt_alg; in n2_hmac_alg()
306 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in n2_hash_async_init() local
307 struct n2_hash_ctx *ctx = crypto_ahash_ctx(tfm); in n2_hash_async_init()
318 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in n2_hash_async_update() local
319 struct n2_hash_ctx *ctx = crypto_ahash_ctx(tfm); in n2_hash_async_update()
332 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in n2_hash_async_final() local
333 struct n2_hash_ctx *ctx = crypto_ahash_ctx(tfm); in n2_hash_async_final()
[all …]
Dpadlock-aes.c94 static inline struct aes_ctx *aes_ctx(struct crypto_tfm *tfm) in aes_ctx() argument
96 return aes_ctx_common(crypto_tfm_ctx(tfm)); in aes_ctx()
99 static inline struct aes_ctx *blk_aes_ctx(struct crypto_blkcipher *tfm) in blk_aes_ctx() argument
101 return aes_ctx_common(crypto_blkcipher_ctx(tfm)); in blk_aes_ctx()
104 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
107 struct aes_ctx *ctx = aes_ctx(tfm); in aes_set_key()
109 u32 *flags = &tfm->crt_flags; in aes_set_key()
298 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_encrypt() argument
300 struct aes_ctx *ctx = aes_ctx(tfm); in aes_encrypt()
310 static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_decrypt() argument
[all …]
Dmv_cesa.c197 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); in mv_setkey_aes() local
198 struct mv_ctx *ctx = crypto_tfm_ctx(tfm); in mv_setkey_aes()
256 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_current_q()
325 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_process_hash_current()
403 const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); in mv_hash_final_fallback()
408 shash->tfm = tfm_ctx->fallback; in mv_hash_final_fallback()
622 if (crypto_tfm_alg_type(async_req->tfm) != in queue_manag()
665 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_ecb()
687 struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in mv_dec_aes_cbc()
697 static int mv_cra_init(struct crypto_tfm *tfm) in mv_cra_init() argument
[all …]
Dpadlock-sha.c39 struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm); in padlock_sha_init()
41 dctx->fallback.tfm = ctx->fallback; in padlock_sha_init()
65 struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm); in padlock_sha_import()
67 dctx->fallback.tfm = ctx->fallback; in padlock_sha_import()
211 static int padlock_cra_init(struct crypto_tfm *tfm) in padlock_cra_init() argument
213 struct crypto_shash *hash = __crypto_shash_cast(tfm); in padlock_cra_init()
214 const char *fallback_driver_name = crypto_tfm_alg_name(tfm); in padlock_cra_init()
215 struct padlock_sha_ctx *ctx = crypto_tfm_ctx(tfm); in padlock_cra_init()
237 static void padlock_cra_exit(struct crypto_tfm *tfm) in padlock_cra_exit() argument
239 struct padlock_sha_ctx *ctx = crypto_tfm_ctx(tfm); in padlock_cra_exit()
[all …]
Domap-sham.c301 struct crypto_ahash *tfm = crypto_ahash_reqtfm(dd->req); in omap_sham_copy_hash_omap4() local
302 struct omap_sham_ctx *tctx = crypto_ahash_ctx(tfm); in omap_sham_copy_hash_omap4()
457 struct crypto_ahash *tfm = crypto_ahash_reqtfm(dd->req); in omap_sham_write_ctrl_omap4() local
458 struct omap_sham_ctx *tctx = crypto_ahash_ctx(tfm); in omap_sham_write_ctrl_omap4()
831 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in omap_sham_init() local
832 struct omap_sham_ctx *tctx = crypto_ahash_ctx(tfm); in omap_sham_init()
854 crypto_ahash_digestsize(tfm)); in omap_sham_init()
856 switch (crypto_ahash_digestsize(tfm)) { in omap_sham_init()
949 struct omap_sham_ctx *tctx = crypto_tfm_ctx(req->base.tfm); in omap_sham_finish_hmac()
955 shash->tfm = bctx->shash; in omap_sham_finish_hmac()
[all …]
Dsahara.c627 static int sahara_aes_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in sahara_aes_setkey() argument
630 struct sahara_ctx *ctx = crypto_ablkcipher_ctx(tfm); in sahara_aes_setkey()
651 (tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in sahara_aes_setkey()
655 struct crypto_tfm *tfm_aux = crypto_ablkcipher_tfm(tfm); in sahara_aes_setkey()
692 struct crypto_tfm *tfm = in sahara_aes_ecb_encrypt() local
701 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in sahara_aes_ecb_encrypt()
710 struct crypto_tfm *tfm = in sahara_aes_ecb_decrypt() local
719 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in sahara_aes_ecb_decrypt()
728 struct crypto_tfm *tfm = in sahara_aes_cbc_encrypt() local
737 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in sahara_aes_cbc_encrypt()
[all …]
Dbfin_crc.c150 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in bfin_crypto_crc_init() local
151 struct bfin_crypto_crc_ctx *crc_ctx = crypto_ahash_ctx(tfm); in bfin_crypto_crc_init()
180 crypto_ahash_digestsize(tfm)); in bfin_crypto_crc_init()
437 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in bfin_crypto_crc_final() local
438 struct bfin_crypto_crc_ctx *crc_ctx = crypto_ahash_ctx(tfm); in bfin_crypto_crc_final()
450 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in bfin_crypto_crc_finup() local
451 struct bfin_crypto_crc_ctx *crc_ctx = crypto_ahash_ctx(tfm); in bfin_crypto_crc_finup()
473 static int bfin_crypto_crc_setkey(struct crypto_ahash *tfm, const u8 *key, in bfin_crypto_crc_setkey() argument
476 struct bfin_crypto_crc_ctx *crc_ctx = crypto_ahash_ctx(tfm); in bfin_crypto_crc_setkey()
480 crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in bfin_crypto_crc_setkey()
[all …]
Dimg-hash.c483 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_init() local
485 struct img_hash_ctx *ctx = crypto_ahash_ctx(tfm); in img_hash_init()
548 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_update() local
549 struct img_hash_ctx *ctx = crypto_ahash_ctx(tfm); in img_hash_update()
563 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_final() local
564 struct img_hash_ctx *ctx = crypto_ahash_ctx(tfm); in img_hash_final()
577 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_finup() local
578 struct img_hash_ctx *ctx = crypto_ahash_ctx(tfm); in img_hash_finup()
592 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in img_hash_digest() local
593 struct img_hash_ctx *tctx = crypto_ahash_ctx(tfm); in img_hash_digest()
[all …]
Datmel-tdes.c401 static int atmel_tdes_crypt_pdc(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, in atmel_tdes_crypt_pdc() argument
404 struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); in atmel_tdes_crypt_pdc()
437 static int atmel_tdes_crypt_dma(struct crypto_tfm *tfm, dma_addr_t dma_addr_in, in atmel_tdes_crypt_dma() argument
440 struct atmel_tdes_ctx *ctx = crypto_tfm_ctx(tfm); in atmel_tdes_crypt_dma()
508 struct crypto_tfm *tfm = crypto_ablkcipher_tfm( in atmel_tdes_crypt_start() local
565 err = atmel_tdes_crypt_dma(tfm, addr_in, addr_out, count); in atmel_tdes_crypt_start()
567 err = atmel_tdes_crypt_pdc(tfm, addr_in, addr_out, count); in atmel_tdes_crypt_start()
777 static int atmel_des_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in atmel_des_setkey() argument
782 struct crypto_tfm *ctfm = crypto_ablkcipher_tfm(tfm); in atmel_des_setkey()
784 struct atmel_tdes_ctx *ctx = crypto_ablkcipher_ctx(tfm); in atmel_des_setkey()
[all …]
Ds5p-sss.c503 dev->ctx = crypto_tfm_ctx(dev->req->base.tfm); in s5p_tasklet_cb()
533 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in s5p_aes_crypt() local
534 struct s5p_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); in s5p_aes_crypt()
551 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); in s5p_aes_setkey() local
552 struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm); in s5p_aes_setkey()
585 static int s5p_aes_cra_init(struct crypto_tfm *tfm) in s5p_aes_cra_init() argument
587 struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm); in s5p_aes_cra_init()
590 tfm->crt_ablkcipher.reqsize = sizeof(struct s5p_aes_reqctx); in s5p_aes_cra_init()
Dtalitos.c1558 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in common_nonsnoop_hash() local
1559 struct talitos_ctx *ctx = crypto_ahash_ctx(tfm); in common_nonsnoop_hash()
1623 crypto_ahash_digestsize(tfm), in common_nonsnoop_hash()
1644 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_edesc_alloc() local
1645 struct talitos_ctx *ctx = crypto_ahash_ctx(tfm); in ahash_edesc_alloc()
1654 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_init() local
1662 (crypto_ahash_digestsize(tfm) <= SHA256_DIGEST_SIZE) in ahash_init()
1698 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_process_req() local
1699 struct talitos_ctx *ctx = crypto_ahash_ctx(tfm); in ahash_process_req()
1703 crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in ahash_process_req()
[all …]
/linux-4.1.27/arch/arm/crypto/
Dghash-ce-glue.c63 struct ghash_key *key = crypto_shash_ctx(desc->tfm); in ghash_update()
95 struct ghash_key *key = crypto_shash_ctx(desc->tfm); in ghash_final()
109 static int ghash_setkey(struct crypto_shash *tfm, in ghash_setkey() argument
112 struct ghash_key *key = crypto_shash_ctx(tfm); in ghash_setkey()
116 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ghash_setkey()
153 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ghash_async_init() local
154 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); in ghash_async_init()
166 desc->tfm = child; in ghash_async_init()
177 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ghash_async_update() local
178 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); in ghash_async_update()
[all …]
Daes_glue.c16 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_encrypt() argument
18 struct AES_CTX *ctx = crypto_tfm_ctx(tfm); in aes_encrypt()
22 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_decrypt() argument
24 struct AES_CTX *ctx = crypto_tfm_ctx(tfm); in aes_decrypt()
28 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
31 struct AES_CTX *ctx = crypto_tfm_ctx(tfm); in aes_set_key()
44 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aes_set_key()
49 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aes_set_key()
55 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aes_set_key()
Daesbs-glue.c57 static int aesbs_cbc_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aesbs_cbc_set_key() argument
60 struct aesbs_cbc_ctx *ctx = crypto_tfm_ctx(tfm); in aesbs_cbc_set_key()
64 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aesbs_cbc_set_key()
73 static int aesbs_ctr_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aesbs_ctr_set_key() argument
76 struct aesbs_ctr_ctx *ctx = crypto_tfm_ctx(tfm); in aesbs_ctr_set_key()
80 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aesbs_ctr_set_key()
87 static int aesbs_xts_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aesbs_xts_set_key() argument
90 struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm); in aesbs_xts_set_key()
94 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in aesbs_xts_set_key()
108 struct aesbs_cbc_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in aesbs_cbc_encrypt()
[all …]
Daes-ce-glue.c130 static int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, in ce_aes_setkey() argument
133 struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in ce_aes_setkey()
140 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in ce_aes_setkey()
149 static int xts_set_key(struct crypto_tfm *tfm, const u8 *in_key, in xts_set_key() argument
152 struct crypto_aes_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_set_key()
162 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in xts_set_key()
169 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_encrypt()
192 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_decrypt()
215 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_encrypt()
239 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_decrypt()
[all …]
/linux-4.1.27/drivers/crypto/vmx/
Daes.c38 static int p8_aes_init(struct crypto_tfm *tfm) in p8_aes_init() argument
42 struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_init()
44 if (!(alg = crypto_tfm_alg_name(tfm))) { in p8_aes_init()
59 crypto_cipher_get_flags((struct crypto_cipher *) tfm)); in p8_aes_init()
65 static void p8_aes_exit(struct crypto_tfm *tfm) in p8_aes_exit() argument
67 struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_exit()
75 static int p8_aes_setkey(struct crypto_tfm *tfm, const u8 *key, in p8_aes_setkey() argument
79 struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_setkey()
92 static void p8_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in p8_aes_encrypt() argument
94 struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_encrypt()
[all …]
Daes_cbc.c39 static int p8_aes_cbc_init(struct crypto_tfm *tfm) in p8_aes_cbc_init() argument
43 struct p8_aes_cbc_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_cbc_init()
45 if (!(alg = crypto_tfm_alg_name(tfm))) { in p8_aes_cbc_init()
60 crypto_blkcipher_get_flags((struct crypto_blkcipher *) tfm)); in p8_aes_cbc_init()
66 static void p8_aes_cbc_exit(struct crypto_tfm *tfm) in p8_aes_cbc_exit() argument
68 struct p8_aes_cbc_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_cbc_exit()
76 static int p8_aes_cbc_setkey(struct crypto_tfm *tfm, const u8 *key, in p8_aes_cbc_setkey() argument
80 struct p8_aes_cbc_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_cbc_setkey()
100 crypto_blkcipher_tfm(desc->tfm)); in p8_aes_cbc_encrypt()
102 .tfm = ctx->fallback, in p8_aes_cbc_encrypt()
[all …]
Dghash.c56 static int p8_ghash_init_tfm(struct crypto_tfm *tfm) in p8_ghash_init_tfm() argument
60 struct crypto_shash *shash_tfm = __crypto_shash_cast(tfm); in p8_ghash_init_tfm()
61 struct p8_ghash_ctx *ctx = crypto_tfm_ctx(tfm); in p8_ghash_init_tfm()
63 if (!(alg = crypto_tfm_alg_name(tfm))) { in p8_ghash_init_tfm()
78 crypto_shash_get_flags((struct crypto_shash *) tfm)); in p8_ghash_init_tfm()
87 static void p8_ghash_exit_tfm(struct crypto_tfm *tfm) in p8_ghash_exit_tfm() argument
89 struct p8_ghash_ctx *ctx = crypto_tfm_ctx(tfm); in p8_ghash_exit_tfm()
99 struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm)); in p8_ghash_init()
104 dctx->fallback_desc.tfm = ctx->fallback; in p8_ghash_init()
109 static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key, in p8_ghash_setkey() argument
[all …]
Daes_ctr.c37 static int p8_aes_ctr_init(struct crypto_tfm *tfm) in p8_aes_ctr_init() argument
41 struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_ctr_init()
43 if (!(alg = crypto_tfm_alg_name(tfm))) { in p8_aes_ctr_init()
58 crypto_blkcipher_get_flags((struct crypto_blkcipher *) tfm)); in p8_aes_ctr_init()
64 static void p8_aes_ctr_exit(struct crypto_tfm *tfm) in p8_aes_ctr_exit() argument
66 struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_ctr_exit()
74 static int p8_aes_ctr_setkey(struct crypto_tfm *tfm, const u8 *key, in p8_aes_ctr_setkey() argument
78 struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm); in p8_aes_ctr_setkey()
117 crypto_blkcipher_tfm(desc->tfm)); in p8_aes_ctr_crypt()
119 .tfm = ctx->fallback, in p8_aes_ctr_crypt()
/linux-4.1.27/arch/x86/crypto/
Dghash-clmulni-intel_glue.c55 static int ghash_setkey(struct crypto_shash *tfm, in ghash_setkey() argument
58 struct ghash_ctx *ctx = crypto_shash_ctx(tfm); in ghash_setkey()
63 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ghash_setkey()
84 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update()
137 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
167 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ghash_async_init() local
168 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); in ghash_async_init()
180 desc->tfm = child; in ghash_async_init()
191 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ghash_async_update() local
192 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); in ghash_async_update()
[all …]
Dfpu.c48 struct crypto_fpu_ctx *ctx = crypto_blkcipher_ctx(desc_in->tfm); in crypto_fpu_encrypt()
51 .tfm = child, in crypto_fpu_encrypt()
57 err = crypto_blkcipher_crt(desc.tfm)->encrypt(&desc, dst, src, nbytes); in crypto_fpu_encrypt()
67 struct crypto_fpu_ctx *ctx = crypto_blkcipher_ctx(desc_in->tfm); in crypto_fpu_decrypt()
70 .tfm = child, in crypto_fpu_decrypt()
76 err = crypto_blkcipher_crt(desc.tfm)->decrypt(&desc, dst, src, nbytes); in crypto_fpu_decrypt()
81 static int crypto_fpu_init_tfm(struct crypto_tfm *tfm) in crypto_fpu_init_tfm() argument
83 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in crypto_fpu_init_tfm()
85 struct crypto_fpu_ctx *ctx = crypto_tfm_ctx(tfm); in crypto_fpu_init_tfm()
96 static void crypto_fpu_exit_tfm(struct crypto_tfm *tfm) in crypto_fpu_exit_tfm() argument
[all …]
Daesni-intel_glue.c284 aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm) in aesni_rfc4106_gcm_ctx_get() argument
289 crypto_tfm_ctx(crypto_aead_tfm(tfm)), AESNI_ALIGN); in aesni_rfc4106_gcm_ctx_get()
303 static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx, in aes_set_key_common() argument
307 u32 *flags = &tfm->crt_flags; in aes_set_key_common()
327 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
330 return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len); in aes_set_key()
333 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_encrypt() argument
335 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in aes_encrypt()
346 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_decrypt() argument
348 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in aes_decrypt()
[all …]
Dtwofish_glue.c54 static void twofish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in twofish_encrypt() argument
56 twofish_enc_blk(crypto_tfm_ctx(tfm), dst, src); in twofish_encrypt()
59 static void twofish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in twofish_decrypt() argument
61 twofish_dec_blk(crypto_tfm_ctx(tfm), dst, src); in twofish_decrypt()
Dtwofish_glue_3way.c216 int lrw_twofish_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_twofish_setkey() argument
219 struct twofish_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_twofish_setkey()
223 &tfm->crt_flags); in lrw_twofish_setkey()
234 struct twofish_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
251 struct twofish_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
265 void lrw_twofish_exit_tfm(struct crypto_tfm *tfm) in lrw_twofish_exit_tfm() argument
267 struct twofish_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_twofish_exit_tfm()
273 int xts_twofish_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_twofish_setkey() argument
276 struct twofish_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_twofish_setkey()
277 u32 *flags = &tfm->crt_flags; in xts_twofish_setkey()
[all …]
Dsalsa20_glue.c40 static int setkey(struct crypto_tfm *tfm, const u8 *key, in setkey() argument
43 struct salsa20_ctx *ctx = crypto_tfm_ctx(tfm); in setkey()
53 struct crypto_blkcipher *tfm = desc->tfm; in encrypt() local
54 struct salsa20_ctx *ctx = crypto_blkcipher_ctx(tfm); in encrypt()
Daes_glue.c25 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_encrypt() argument
27 aes_enc_blk(crypto_tfm_ctx(tfm), dst, src); in aes_encrypt()
30 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_decrypt() argument
32 aes_dec_blk(crypto_tfm_ctx(tfm), dst, src); in aes_decrypt()
Ddes3_ede_glue.c76 static void des3_ede_x86_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des3_ede_x86_encrypt() argument
78 des3_ede_enc_blk(crypto_tfm_ctx(tfm), dst, src); in des3_ede_x86_encrypt()
81 static void des3_ede_x86_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des3_ede_x86_decrypt() argument
83 des3_ede_dec_blk(crypto_tfm_ctx(tfm), dst, src); in des3_ede_x86_decrypt()
133 struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_encrypt()
143 struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_decrypt()
153 struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __cbc_encrypt()
194 struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __cbc_decrypt()
289 struct des3_ede_x86_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __ctr_crypt()
352 ctr_crypt_final(crypto_blkcipher_ctx(desc->tfm), &walk); in ctr_crypt()
[all …]
Dcamellia_glue.c54 static void camellia_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in camellia_encrypt() argument
56 camellia_enc_blk(crypto_tfm_ctx(tfm), dst, src); in camellia_encrypt()
59 static void camellia_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in camellia_decrypt() argument
61 camellia_dec_blk(crypto_tfm_ctx(tfm), dst, src); in camellia_decrypt()
1275 static int camellia_setkey(struct crypto_tfm *tfm, const u8 *in_key, in camellia_setkey() argument
1278 return __camellia_setkey(crypto_tfm_ctx(tfm), in_key, key_len, in camellia_setkey()
1279 &tfm->crt_flags); in camellia_setkey()
1440 int lrw_camellia_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_camellia_setkey() argument
1443 struct camellia_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_camellia_setkey()
1448 &tfm->crt_flags); in lrw_camellia_setkey()
[all …]
Dcast6_avx_glue.c248 static int lrw_cast6_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_cast6_setkey() argument
251 struct cast6_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_cast6_setkey()
255 &tfm->crt_flags); in lrw_cast6_setkey()
265 struct cast6_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
291 struct cast6_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
314 static void lrw_exit_tfm(struct crypto_tfm *tfm) in lrw_exit_tfm() argument
316 struct cast6_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_exit_tfm()
326 static int xts_cast6_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_cast6_setkey() argument
329 struct cast6_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_cast6_setkey()
330 u32 *flags = &tfm->crt_flags; in xts_cast6_setkey()
[all …]
Dserpent_avx_glue.c256 int lrw_serpent_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_serpent_setkey() argument
259 struct serpent_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_serpent_setkey()
275 struct serpent_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
301 struct serpent_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
324 void lrw_serpent_exit_tfm(struct crypto_tfm *tfm) in lrw_serpent_exit_tfm() argument
326 struct serpent_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_serpent_exit_tfm()
332 int xts_serpent_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_serpent_setkey() argument
335 struct serpent_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_serpent_setkey()
336 u32 *flags = &tfm->crt_flags; in xts_serpent_setkey()
360 struct serpent_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
[all …]
Dserpent_sse2_glue.c229 static int lrw_serpent_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_serpent_setkey() argument
232 struct serpent_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_serpent_setkey()
247 struct serpent_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
273 struct serpent_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
296 static void lrw_exit_tfm(struct crypto_tfm *tfm) in lrw_exit_tfm() argument
298 struct serpent_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_exit_tfm()
308 static int xts_serpent_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_serpent_setkey() argument
311 struct serpent_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_serpent_setkey()
312 u32 *flags = &tfm->crt_flags; in xts_serpent_setkey()
335 struct serpent_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
[all …]
Dcrc32c-intel_glue.c130 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32c_intel_init()
171 return __crc32c_intel_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32c_intel_digest()
175 static int crc32c_intel_cra_init(struct crypto_tfm *tfm) in crc32c_intel_cra_init() argument
177 u32 *key = crypto_tfm_ctx(tfm); in crc32c_intel_cra_init()
225 return __crc32c_pcl_intel_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32c_pcl_intel_digest()
Dblowfish_glue.c70 static void blowfish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in blowfish_encrypt() argument
72 blowfish_enc_blk(crypto_tfm_ctx(tfm), dst, src); in blowfish_encrypt()
75 static void blowfish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in blowfish_decrypt() argument
77 blowfish_dec_blk(crypto_tfm_ctx(tfm), dst, src); in blowfish_decrypt()
84 struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_crypt()
146 struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __cbc_encrypt()
187 struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __cbc_decrypt()
283 struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __ctr_crypt()
351 ctr_crypt_final(crypto_blkcipher_ctx(desc->tfm), &walk); in ctr_crypt()
Dcrc32-pclmul_glue.c82 static int crc32_pclmul_cra_init(struct crypto_tfm *tfm) in crc32_pclmul_cra_init() argument
84 u32 *key = crypto_tfm_ctx(tfm); in crc32_pclmul_cra_init()
106 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_pclmul_init()
148 return __crc32_pclmul_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32_pclmul_digest()
Dcamellia_aesni_avx2_glue.c198 static int camellia_setkey(struct crypto_tfm *tfm, const u8 *in_key, in camellia_setkey() argument
201 return __camellia_setkey(crypto_tfm_ctx(tfm), in_key, key_len, in camellia_setkey()
202 &tfm->crt_flags); in camellia_setkey()
273 struct camellia_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
299 struct camellia_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
325 struct camellia_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
335 struct camellia_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_decrypt()
Dcamellia_aesni_avx_glue.c202 static int camellia_setkey(struct crypto_tfm *tfm, const u8 *in_key, in camellia_setkey() argument
205 return __camellia_setkey(crypto_tfm_ctx(tfm), in_key, key_len, in camellia_setkey()
206 &tfm->crt_flags); in camellia_setkey()
265 struct camellia_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
291 struct camellia_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
317 struct camellia_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
327 struct camellia_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_decrypt()
/linux-4.1.27/drivers/block/
Dcryptoloop.c49 struct crypto_blkcipher *tfm; in cryptoloop_init() local
85 tfm = crypto_alloc_blkcipher(cms, 0, CRYPTO_ALG_ASYNC); in cryptoloop_init()
86 if (IS_ERR(tfm)) in cryptoloop_init()
87 return PTR_ERR(tfm); in cryptoloop_init()
89 err = crypto_blkcipher_setkey(tfm, info->lo_encrypt_key, in cryptoloop_init()
95 lo->key_data = tfm; in cryptoloop_init()
99 crypto_free_blkcipher(tfm); in cryptoloop_init()
117 struct crypto_blkcipher *tfm = lo->key_data; in cryptoloop_transfer() local
119 .tfm = tfm, in cryptoloop_transfer()
138 encdecfunc = crypto_blkcipher_crt(tfm)->decrypt; in cryptoloop_transfer()
[all …]
/linux-4.1.27/net/ceph/
Dcrypto.c169 struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher(); in ceph_aes_encrypt() local
170 struct blkcipher_desc desc = { .tfm = tfm, .flags = 0 }; in ceph_aes_encrypt()
177 if (IS_ERR(tfm)) in ceph_aes_encrypt()
178 return PTR_ERR(tfm); in ceph_aes_encrypt()
191 crypto_blkcipher_setkey((void *)tfm, key, key_len); in ceph_aes_encrypt()
192 iv = crypto_blkcipher_crt(tfm)->iv; in ceph_aes_encrypt()
193 ivsize = crypto_blkcipher_ivsize(tfm); in ceph_aes_encrypt()
218 crypto_free_blkcipher(tfm); in ceph_aes_encrypt()
229 struct crypto_blkcipher *tfm = ceph_crypto_alloc_cipher(); in ceph_aes_encrypt2() local
230 struct blkcipher_desc desc = { .tfm = tfm, .flags = 0 }; in ceph_aes_encrypt2()
[all …]
/linux-4.1.27/fs/btrfs/
Dhash.c18 static struct crypto_shash *tfm; variable
22 tfm = crypto_alloc_shash("crc32c", 0, 0); in btrfs_hash_init()
24 return PTR_ERR_OR_ZERO(tfm); in btrfs_hash_init()
29 crypto_free_shash(tfm); in btrfs_hash_exit()
34 SHASH_DESC_ON_STACK(shash, tfm); in btrfs_crc32c()
38 shash->tfm = tfm; in btrfs_crc32c()
/linux-4.1.27/drivers/staging/rtl8192e/
Drtllib_crypt_ccmp.c47 struct crypto_tfm *tfm; member
55 static void rtllib_ccmp_aes_encrypt(struct crypto_tfm *tfm, in rtllib_ccmp_aes_encrypt() argument
58 crypto_cipher_encrypt_one((void *)tfm, ct, pt); in rtllib_ccmp_aes_encrypt()
70 priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); in rtllib_ccmp_init()
71 if (IS_ERR(priv->tfm)) { in rtllib_ccmp_init()
73 priv->tfm = NULL; in rtllib_ccmp_init()
80 if (priv->tfm) in rtllib_ccmp_init()
81 crypto_free_cipher((void *)priv->tfm); in rtllib_ccmp_init()
93 if (_priv && _priv->tfm) in rtllib_ccmp_deinit()
94 crypto_free_cipher((void *)_priv->tfm); in rtllib_ccmp_deinit()
[all …]
/linux-4.1.27/lib/
Dlibcrc32c.c40 static struct crypto_shash *tfm; variable
44 SHASH_DESC_ON_STACK(shash, tfm); in crc32c()
48 shash->tfm = tfm; in crc32c()
62 tfm = crypto_alloc_shash("crc32c", 0, 0); in libcrc32c_mod_init()
63 return PTR_ERR_OR_ZERO(tfm); in libcrc32c_mod_init()
68 crypto_free_shash(tfm); in libcrc32c_mod_fini()
/linux-4.1.27/drivers/target/iscsi/
Discsi_target_auth.c188 struct crypto_hash *tfm; in chap_server_compute_md5() local
248 tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC); in chap_server_compute_md5()
249 if (IS_ERR(tfm)) { in chap_server_compute_md5()
253 desc.tfm = tfm; in chap_server_compute_md5()
259 crypto_free_hash(tfm); in chap_server_compute_md5()
267 crypto_free_hash(tfm); in chap_server_compute_md5()
275 crypto_free_hash(tfm); in chap_server_compute_md5()
283 crypto_free_hash(tfm); in chap_server_compute_md5()
290 crypto_free_hash(tfm); in chap_server_compute_md5()
293 crypto_free_hash(tfm); in chap_server_compute_md5()
[all …]
/linux-4.1.27/drivers/staging/rtl8192u/ieee80211/
Dieee80211_crypt_ccmp.c51 struct crypto_tfm *tfm; member
59 static void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm, in ieee80211_ccmp_aes_encrypt() argument
62 crypto_cipher_encrypt_one((void *)tfm, ct, pt); in ieee80211_ccmp_aes_encrypt()
74 priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); in ieee80211_ccmp_init()
75 if (IS_ERR(priv->tfm)) { in ieee80211_ccmp_init()
78 priv->tfm = NULL; in ieee80211_ccmp_init()
86 if (priv->tfm) in ieee80211_ccmp_init()
87 crypto_free_cipher((void *)priv->tfm); in ieee80211_ccmp_init()
99 if (_priv && _priv->tfm) in ieee80211_ccmp_deinit()
100 crypto_free_cipher((void *)_priv->tfm); in ieee80211_ccmp_deinit()
[all …]
/linux-4.1.27/security/integrity/evm/
Devm_crypto.c39 struct crypto_shash **tfm; in init_desc() local
43 tfm = &hmac_tfm; in init_desc()
46 tfm = &hash_tfm; in init_desc()
50 if (*tfm == NULL) { in init_desc()
52 if (*tfm) in init_desc()
54 *tfm = crypto_alloc_shash(algo, 0, CRYPTO_ALG_ASYNC); in init_desc()
55 if (IS_ERR(*tfm)) { in init_desc()
56 rc = PTR_ERR(*tfm); in init_desc()
58 *tfm = NULL; in init_desc()
63 rc = crypto_shash_setkey(*tfm, evmkey, evmkey_len); in init_desc()
[all …]
/linux-4.1.27/drivers/staging/lustre/lustre/libcfs/linux/
Dlinux-crypto.c55 desc->tfm = crypto_alloc_hash((*type)->cht_name, 0, 0); in cfs_crypto_hash_alloc()
57 if (desc->tfm == NULL) in cfs_crypto_hash_alloc()
60 if (IS_ERR(desc->tfm)) { in cfs_crypto_hash_alloc()
63 return PTR_ERR(desc->tfm); in cfs_crypto_hash_alloc()
75 err = crypto_hash_setkey(desc->tfm, key, key_len); in cfs_crypto_hash_alloc()
77 err = crypto_hash_setkey(desc->tfm, in cfs_crypto_hash_alloc()
83 crypto_free_hash(desc->tfm); in cfs_crypto_hash_alloc()
88 (crypto_hash_tfm(desc->tfm))->__crt_alg->cra_name, in cfs_crypto_hash_alloc()
89 (crypto_hash_tfm(desc->tfm))->__crt_alg->cra_driver_name, in cfs_crypto_hash_alloc()
114 crypto_free_hash(hdesc.tfm); in cfs_crypto_hash_digest()
[all …]
Dlinux-crypto-adler.c45 static int adler32_cra_init(struct crypto_tfm *tfm) in adler32_cra_init() argument
47 u32 *key = crypto_tfm_ctx(tfm); in adler32_cra_init()
69 u32 *mctx = crypto_shash_ctx(desc->tfm); in adler32_init()
109 return __adler32_finup(crypto_shash_ctx(desc->tfm), data, len, in adler32_digest()
/linux-4.1.27/include/crypto/internal/
Dhash.h129 int crypto_init_shash_ops_async(struct crypto_tfm *tfm);
131 static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm) in crypto_ahash_ctx() argument
133 return crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in crypto_ahash_ctx()
142 static inline void crypto_ahash_set_reqsize(struct crypto_ahash *tfm, in crypto_ahash_set_reqsize() argument
145 tfm->reqsize = reqsize; in crypto_ahash_set_reqsize()
195 struct crypto_ahash *tfm) in ahash_tfm_in_queue() argument
197 return crypto_tfm_in_queue(queue, crypto_ahash_tfm(tfm)); in ahash_tfm_in_queue()
200 static inline void *crypto_shash_ctx(struct crypto_shash *tfm) in crypto_shash_ctx() argument
202 return crypto_tfm_ctx(&tfm->base); in crypto_shash_ctx()
236 static inline void *crypto_shash_ctx_aligned(struct crypto_shash *tfm) in crypto_shash_ctx_aligned() argument
[all …]
Drng.h21 static inline void *crypto_rng_ctx(struct crypto_rng *tfm) in crypto_rng_ctx() argument
23 return crypto_tfm_ctx(&tfm->base); in crypto_rng_ctx()
Daead.h62 int aead_geniv_init(struct crypto_tfm *tfm);
63 void aead_geniv_exit(struct crypto_tfm *tfm);
Dskcipher.h66 int skcipher_geniv_init(struct crypto_tfm *tfm);
67 void skcipher_geniv_exit(struct crypto_tfm *tfm);
/linux-4.1.27/net/wireless/
Dlib80211_crypt_ccmp.c55 struct crypto_cipher *tfm; member
63 static inline void lib80211_ccmp_aes_encrypt(struct crypto_cipher *tfm, in lib80211_ccmp_aes_encrypt() argument
66 crypto_cipher_encrypt_one(tfm, ct, pt); in lib80211_ccmp_aes_encrypt()
78 priv->tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); in lib80211_ccmp_init()
79 if (IS_ERR(priv->tfm)) { in lib80211_ccmp_init()
80 priv->tfm = NULL; in lib80211_ccmp_init()
88 if (priv->tfm) in lib80211_ccmp_init()
89 crypto_free_cipher(priv->tfm); in lib80211_ccmp_init()
99 if (_priv && _priv->tfm) in lib80211_ccmp_deinit()
100 crypto_free_cipher(_priv->tfm); in lib80211_ccmp_deinit()
[all …]
/linux-4.1.27/drivers/crypto/ccp/
Dccp-crypto-aes.c28 struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in ccp_aes_complete()
40 static int ccp_aes_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ccp_aes_setkey() argument
43 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ablkcipher_tfm(tfm)); in ccp_aes_setkey()
45 ccp_crypto_ablkcipher_alg(crypto_ablkcipher_tfm(tfm)); in ccp_aes_setkey()
58 crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ccp_aes_setkey()
72 struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in ccp_aes_crypt()
127 static int ccp_aes_cra_init(struct crypto_tfm *tfm) in ccp_aes_cra_init() argument
129 struct ccp_ctx *ctx = crypto_tfm_ctx(tfm); in ccp_aes_cra_init()
134 tfm->crt_ablkcipher.reqsize = sizeof(struct ccp_aes_req_ctx); in ccp_aes_cra_init()
139 static void ccp_aes_cra_exit(struct crypto_tfm *tfm) in ccp_aes_cra_exit() argument
[all …]
Dccp-crypto-sha.c29 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ccp_sha_complete() local
31 unsigned int digest_size = crypto_ahash_digestsize(tfm); in ccp_sha_complete()
60 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ccp_do_sha_update() local
61 struct ccp_ctx *ctx = crypto_ahash_ctx(tfm); in ccp_do_sha_update()
65 crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in ccp_do_sha_update()
149 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ccp_sha_init() local
150 struct ccp_ctx *ctx = crypto_ahash_ctx(tfm); in ccp_sha_init()
153 ccp_crypto_ahash_alg(crypto_ahash_tfm(tfm)); in ccp_sha_init()
155 crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in ccp_sha_init()
237 static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key, in ccp_sha_setkey() argument
[all …]
Dccp-crypto-aes-xts.c97 static int ccp_aes_xts_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ccp_aes_xts_setkey() argument
100 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ablkcipher_tfm(tfm)); in ccp_aes_xts_setkey()
120 struct crypto_tfm *tfm = in ccp_aes_xts_crypt() local
122 struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in ccp_aes_xts_crypt()
155 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in ccp_aes_xts_crypt()
192 static int ccp_aes_xts_cra_init(struct crypto_tfm *tfm) in ccp_aes_xts_cra_init() argument
194 struct ccp_ctx *ctx = crypto_tfm_ctx(tfm); in ccp_aes_xts_cra_init()
200 fallback_tfm = crypto_alloc_ablkcipher(crypto_tfm_alg_name(tfm), 0, in ccp_aes_xts_cra_init()
205 crypto_tfm_alg_name(tfm)); in ccp_aes_xts_cra_init()
210 tfm->crt_ablkcipher.reqsize = sizeof(struct ccp_aes_req_ctx) + in ccp_aes_xts_cra_init()
[all …]
Dccp-crypto-main.c67 struct crypto_tfm *tfm; member
103 if (crypto_cmd->tfm != tmp->tfm) in ccp_crypto_cmd_complete()
141 struct ccp_ctx *ctx = crypto_tfm_ctx(req->tfm); in ccp_crypto_complete()
185 ctx = crypto_tfm_ctx(held->req->tfm); in ccp_crypto_complete()
224 if (crypto_cmd->tfm != tmp->tfm) in ccp_crypto_enqueue_cmd()
287 crypto_cmd->tfm = req->tfm; in ccp_crypto_enqueue_request()
Dccp-crypto-aes-cmac.c30 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ccp_aes_cmac_complete() local
32 unsigned int digest_size = crypto_ahash_digestsize(tfm); in ccp_aes_cmac_complete()
61 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ccp_do_cmac_update() local
62 struct ccp_ctx *ctx = crypto_ahash_ctx(tfm); in ccp_do_cmac_update()
66 crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in ccp_do_cmac_update()
241 static int ccp_aes_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, in ccp_aes_cmac_setkey() argument
244 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in ccp_aes_cmac_setkey()
246 ccp_crypto_ahash_alg(crypto_ahash_tfm(tfm)); in ccp_aes_cmac_setkey()
263 crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ccp_aes_cmac_setkey()
320 static int ccp_aes_cmac_cra_init(struct crypto_tfm *tfm) in ccp_aes_cmac_cra_init() argument
[all …]
Dccp-crypto.h51 ccp_crypto_ablkcipher_alg(struct crypto_tfm *tfm) in ccp_crypto_ablkcipher_alg() argument
53 struct crypto_alg *alg = tfm->__crt_alg; in ccp_crypto_ablkcipher_alg()
59 ccp_crypto_ahash_alg(struct crypto_tfm *tfm) in ccp_crypto_ahash_alg() argument
61 struct crypto_alg *alg = tfm->__crt_alg; in ccp_crypto_ahash_alg()
/linux-4.1.27/net/sunrpc/auth_gss/
Dgss_krb5_crypto.c54 struct crypto_blkcipher *tfm, in krb5_encrypt() argument
63 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; in krb5_encrypt()
65 if (length % crypto_blkcipher_blocksize(tfm) != 0) in krb5_encrypt()
68 if (crypto_blkcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) { in krb5_encrypt()
70 crypto_blkcipher_ivsize(tfm)); in krb5_encrypt()
75 memcpy(local_iv, iv, crypto_blkcipher_ivsize(tfm)); in krb5_encrypt()
88 struct crypto_blkcipher *tfm, in krb5_decrypt() argument
97 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv }; in krb5_decrypt()
99 if (length % crypto_blkcipher_blocksize(tfm) != 0) in krb5_decrypt()
102 if (crypto_blkcipher_ivsize(tfm) > GSS_KRB5_MAX_BLOCKSIZE) { in krb5_decrypt()
[all …]
/linux-4.1.27/kernel/
Dmodule_signing.c48 struct crypto_shash *tfm; in mod_make_digest() local
58 tfm = crypto_alloc_shash(hash_algo_name[hash], 0, 0); in mod_make_digest()
59 if (IS_ERR(tfm)) in mod_make_digest()
60 return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm); in mod_make_digest()
62 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in mod_make_digest()
63 digest_size = crypto_shash_digestsize(tfm); in mod_make_digest()
78 desc->tfm = tfm; in mod_make_digest()
89 crypto_free_shash(tfm); in mod_make_digest()
96 crypto_free_shash(tfm); in mod_make_digest()
/linux-4.1.27/security/apparmor/
Dcrypto.c49 desc.shash.tfm = apparmor_tfm; in aa_calc_profile_hash()
76 struct crypto_shash *tfm; in init_profile_hash() local
81 tfm = crypto_alloc_shash("sha1", 0, CRYPTO_ALG_ASYNC); in init_profile_hash()
82 if (IS_ERR(tfm)) { in init_profile_hash()
83 int error = PTR_ERR(tfm); in init_profile_hash()
87 apparmor_tfm = tfm; in init_profile_hash()
/linux-4.1.27/fs/ext4/
Dcrypto_key.c47 struct crypto_ablkcipher *tfm = crypto_alloc_ablkcipher("ecb(aes)", 0, in ext4_derive_key_aes() local
50 if (IS_ERR(tfm)) { in ext4_derive_key_aes()
51 res = PTR_ERR(tfm); in ext4_derive_key_aes()
52 tfm = NULL; in ext4_derive_key_aes()
55 crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_REQ_WEAK_KEY); in ext4_derive_key_aes()
56 req = ablkcipher_request_alloc(tfm, GFP_NOFS); in ext4_derive_key_aes()
64 res = crypto_ablkcipher_setkey(tfm, deriving_key, in ext4_derive_key_aes()
82 if (tfm) in ext4_derive_key_aes()
83 crypto_free_ablkcipher(tfm); in ext4_derive_key_aes()
Dcrypto.c80 if (ctx->tfm) in ext4_release_crypto_ctx()
81 crypto_free_tfm(ctx->tfm); in ext4_release_crypto_ctx()
156 if (ctx->tfm && (ctx->mode != key->mode)) { in ext4_get_crypto_ctx()
157 crypto_free_tfm(ctx->tfm); in ext4_get_crypto_ctx()
158 ctx->tfm = NULL; in ext4_get_crypto_ctx()
161 if (!ctx->tfm) { in ext4_get_crypto_ctx()
164 ctx->tfm = crypto_ablkcipher_tfm( in ext4_get_crypto_ctx()
170 ctx->tfm = ERR_PTR(-ENOTSUPP); in ext4_get_crypto_ctx()
175 if (IS_ERR_OR_NULL(ctx->tfm)) { in ext4_get_crypto_ctx()
176 res = PTR_ERR(ctx->tfm); in ext4_get_crypto_ctx()
[all …]
/linux-4.1.27/drivers/crypto/amcc/
Dcrypto4xx_alg.c75 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_encrypt()
89 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_decrypt()
110 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); in crypto4xx_setkey_aes() local
111 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); in crypto4xx_setkey_aes()
180 static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm, in crypto4xx_hash_alg_init() argument
185 struct crypto_alg *alg = tfm->__crt_alg; in crypto4xx_hash_alg_init()
187 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); in crypto4xx_hash_alg_init()
212 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in crypto4xx_hash_alg_init()
239 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_hash_init()
245 __crypto_ahash_cast(req->base.tfm)); in crypto4xx_hash_init()
[all …]
/linux-4.1.27/drivers/crypto/nx/
Dnx-aes-ccm.c35 static int ccm_aes_nx_set_key(struct crypto_aead *tfm, in ccm_aes_nx_set_key() argument
39 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm_aes_nx_set_key()
65 static int ccm4309_aes_nx_set_key(struct crypto_aead *tfm, in ccm4309_aes_nx_set_key() argument
69 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm4309_aes_nx_set_key()
78 return ccm_aes_nx_set_key(tfm, in_key, key_len); in ccm4309_aes_nx_set_key()
81 static int ccm_aes_nx_setauthsize(struct crypto_aead *tfm, in ccm_aes_nx_setauthsize() argument
97 crypto_aead_crt(tfm)->authsize = authsize; in ccm_aes_nx_setauthsize()
102 static int ccm4309_aes_nx_setauthsize(struct crypto_aead *tfm, in ccm4309_aes_nx_setauthsize() argument
114 crypto_aead_crt(tfm)->authsize = authsize; in ccm4309_aes_nx_setauthsize()
348 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(req->base.tfm); in ccm_nx_decrypt()
[all …]
Dnx.h153 int nx_crypto_ctx_aes_ccm_init(struct crypto_tfm *tfm);
154 int nx_crypto_ctx_aes_gcm_init(struct crypto_tfm *tfm);
155 int nx_crypto_ctx_aes_xcbc_init(struct crypto_tfm *tfm);
156 int nx_crypto_ctx_aes_ctr_init(struct crypto_tfm *tfm);
157 int nx_crypto_ctx_aes_cbc_init(struct crypto_tfm *tfm);
158 int nx_crypto_ctx_aes_ecb_init(struct crypto_tfm *tfm);
159 int nx_crypto_ctx_sha_init(struct crypto_tfm *tfm);
160 void nx_crypto_ctx_exit(struct crypto_tfm *tfm);
Dnx-aes-gcm.c35 static int gcm_aes_nx_set_key(struct crypto_aead *tfm, in gcm_aes_nx_set_key() argument
39 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in gcm_aes_nx_set_key()
74 static int gcm4106_aes_nx_set_key(struct crypto_aead *tfm, in gcm4106_aes_nx_set_key() argument
78 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in gcm4106_aes_nx_set_key()
87 rc = gcm_aes_nx_set_key(tfm, in_key, key_len); in gcm4106_aes_nx_set_key()
96 static int gcm_aes_nx_setauthsize(struct crypto_aead *tfm, in gcm_aes_nx_setauthsize() argument
99 if (authsize > crypto_aead_alg(tfm)->maxauthsize) in gcm_aes_nx_setauthsize()
102 crypto_aead_crt(tfm)->authsize = authsize; in gcm_aes_nx_setauthsize()
107 static int gcm4106_aes_nx_setauthsize(struct crypto_aead *tfm, in gcm4106_aes_nx_setauthsize() argument
119 crypto_aead_crt(tfm)->authsize = authsize; in gcm4106_aes_nx_setauthsize()
[all …]
Dnx-aes-ctr.c34 static int ctr_aes_nx_set_key(struct crypto_tfm *tfm, in ctr_aes_nx_set_key() argument
38 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ctr_aes_nx_set_key()
66 static int ctr3686_aes_nx_set_key(struct crypto_tfm *tfm, in ctr3686_aes_nx_set_key() argument
70 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ctr3686_aes_nx_set_key()
81 return ctr_aes_nx_set_key(tfm, in_key, key_len); in ctr3686_aes_nx_set_key()
89 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_nx_crypt()
133 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in ctr3686_aes_nx_crypt()
Dnx.c636 int nx_crypto_ctx_aes_ccm_init(struct crypto_tfm *tfm) in nx_crypto_ctx_aes_ccm_init() argument
638 tfm->crt_aead.reqsize = sizeof(struct nx_ccm_rctx); in nx_crypto_ctx_aes_ccm_init()
639 return nx_crypto_ctx_init(crypto_tfm_ctx(tfm), NX_FC_AES, in nx_crypto_ctx_aes_ccm_init()
643 int nx_crypto_ctx_aes_gcm_init(struct crypto_tfm *tfm) in nx_crypto_ctx_aes_gcm_init() argument
645 tfm->crt_aead.reqsize = sizeof(struct nx_gcm_rctx); in nx_crypto_ctx_aes_gcm_init()
646 return nx_crypto_ctx_init(crypto_tfm_ctx(tfm), NX_FC_AES, in nx_crypto_ctx_aes_gcm_init()
650 int nx_crypto_ctx_aes_ctr_init(struct crypto_tfm *tfm) in nx_crypto_ctx_aes_ctr_init() argument
652 return nx_crypto_ctx_init(crypto_tfm_ctx(tfm), NX_FC_AES, in nx_crypto_ctx_aes_ctr_init()
656 int nx_crypto_ctx_aes_cbc_init(struct crypto_tfm *tfm) in nx_crypto_ctx_aes_cbc_init() argument
658 return nx_crypto_ctx_init(crypto_tfm_ctx(tfm), NX_FC_AES, in nx_crypto_ctx_aes_cbc_init()
[all …]
Dnx-aes-cbc.c33 static int cbc_aes_nx_set_key(struct crypto_tfm *tfm, in cbc_aes_nx_set_key() argument
37 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in cbc_aes_nx_set_key()
71 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_nx_crypt()
Dnx-aes-ecb.c33 static int ecb_aes_nx_set_key(struct crypto_tfm *tfm, in ecb_aes_nx_set_key() argument
37 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ecb_aes_nx_set_key()
71 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_nx_crypt()
Dnx-aes-xcbc.c73 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_empty()
152 static int nx_crypto_ctx_aes_xcbc_init2(struct crypto_tfm *tfm) in nx_crypto_ctx_aes_xcbc_init2() argument
154 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_aes_xcbc_init2()
158 err = nx_crypto_ctx_aes_xcbc_init(tfm); in nx_crypto_ctx_aes_xcbc_init2()
184 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_update()
310 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_final()
Dnx-sha256.c32 static int nx_crypto_ctx_sha256_init(struct crypto_tfm *tfm) in nx_crypto_ctx_sha256_init() argument
34 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha256_init()
37 err = nx_crypto_ctx_sha_init(tfm); in nx_crypto_ctx_sha256_init()
72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha256_update()
192 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha256_final()
Dnx-sha512.c31 static int nx_crypto_ctx_sha512_init(struct crypto_tfm *tfm) in nx_crypto_ctx_sha512_init() argument
33 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha512_init()
36 err = nx_crypto_ctx_sha_init(tfm); in nx_crypto_ctx_sha512_init()
72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_update()
195 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_final()
/linux-4.1.27/net/xfrm/
Dxfrm_ipcomp.c50 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu); in ipcomp_decompress() local
51 int err = crypto_comp_decompress(tfm, start, plen, scratch, &dlen); in ipcomp_decompress()
144 struct crypto_comp *tfm; in ipcomp_compress() local
150 tfm = *this_cpu_ptr(ipcd->tfms); in ipcomp_compress()
151 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); in ipcomp_compress()
269 struct crypto_comp *tfm = *per_cpu_ptr(tfms, cpu); in ipcomp_free_tfms() local
270 crypto_free_comp(tfm); in ipcomp_free_tfms()
283 struct crypto_comp *tfm; in ipcomp_alloc_tfms() local
286 tfm = __this_cpu_read(*pos->tfms); in ipcomp_alloc_tfms()
288 if (!strcmp(crypto_comp_name(tfm), alg_name)) { in ipcomp_alloc_tfms()
[all …]
/linux-4.1.27/arch/sparc/crypto/
Ddes_glue.c43 static int des_set_key(struct crypto_tfm *tfm, const u8 *key, in des_set_key() argument
46 struct des_sparc64_ctx *dctx = crypto_tfm_ctx(tfm); in des_set_key()
47 u32 *flags = &tfm->crt_flags; in des_set_key()
70 static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des_encrypt() argument
72 struct des_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); in des_encrypt()
78 static void des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in des_decrypt() argument
80 struct des_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); in des_decrypt()
97 struct des_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __ecb_crypt()
145 struct des_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_encrypt()
176 struct des_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_decrypt()
[all …]
Dcamellia_glue.c35 static int camellia_set_key(struct crypto_tfm *tfm, const u8 *_in_key, in camellia_set_key() argument
38 struct camellia_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); in camellia_set_key()
40 u32 *flags = &tfm->crt_flags; in camellia_set_key()
57 static void camellia_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in camellia_encrypt() argument
59 struct camellia_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); in camellia_encrypt()
66 static void camellia_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in camellia_decrypt() argument
68 struct camellia_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); in camellia_decrypt()
89 struct camellia_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in __ecb_crypt()
152 struct camellia_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_encrypt()
191 struct camellia_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_decrypt()
Daes_glue.c166 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
169 struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_set_key()
170 u32 *flags = &tfm->crt_flags; in aes_set_key()
199 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_encrypt() argument
201 struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_encrypt()
206 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_decrypt() argument
208 struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_decrypt()
219 struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_encrypt()
248 struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_decrypt()
279 struct crypto_sparc64_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_encrypt()
[all …]
Dcrc32c_glue.c45 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32c_sparc64_init()
107 return __crc32c_sparc64_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32c_sparc64_digest()
111 static int crc32c_sparc64_cra_init(struct crypto_tfm *tfm) in crc32c_sparc64_cra_init() argument
113 u32 *key = crypto_tfm_ctx(tfm); in crc32c_sparc64_cra_init()
/linux-4.1.27/drivers/crypto/qce/
Dablkcipher.c30 struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); in qce_ablkcipher_done()
67 struct qce_alg_template *tmpl = to_cipher_tmpl(async_req->tfm); in qce_ablkcipher_async_req_handle()
165 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(ablk); in qce_ablkcipher_setkey() local
166 struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); in qce_ablkcipher_setkey()
167 unsigned long flags = to_cipher_tmpl(tfm)->alg_flags; in qce_ablkcipher_setkey()
205 struct crypto_tfm *tfm = in qce_ablkcipher_crypt() local
207 struct qce_cipher_ctx *ctx = crypto_tfm_ctx(tfm); in qce_ablkcipher_crypt()
209 struct qce_alg_template *tmpl = to_cipher_tmpl(tfm); in qce_ablkcipher_crypt()
220 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in qce_ablkcipher_crypt()
237 static int qce_ablkcipher_init(struct crypto_tfm *tfm) in qce_ablkcipher_init() argument
[all …]
Dsha.c43 struct qce_alg_template *tmpl = to_ahash_tmpl(async_req->tfm); in qce_ahash_done()
81 struct qce_sha_ctx *ctx = crypto_tfm_ctx(async_req->tfm); in qce_ahash_async_req_handle()
82 struct qce_alg_template *tmpl = to_ahash_tmpl(async_req->tfm); in qce_ahash_async_req_handle()
134 struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); in qce_ahash_init()
235 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in qce_ahash_update() local
237 struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); in qce_ahash_update()
245 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in qce_ahash_update()
312 struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); in qce_ahash_final()
335 struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); in qce_ahash_digest()
367 static int qce_ahash_hmac_setkey(struct crypto_ahash *tfm, const u8 *key, in qce_ahash_hmac_setkey() argument
[all …]
Dcipher.h60 static inline struct qce_alg_template *to_cipher_tmpl(struct crypto_tfm *tfm) in to_cipher_tmpl() argument
62 struct crypto_alg *alg = tfm->__crt_alg; in to_cipher_tmpl()
Dsha.h70 static inline struct qce_alg_template *to_ahash_tmpl(struct crypto_tfm *tfm) in to_ahash_tmpl() argument
72 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); in to_ahash_tmpl()
/linux-4.1.27/arch/arm64/crypto/
Dcrc32-arm64.c102 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_init()
115 static int chksum_setkey(struct crypto_shash *tfm, const u8 *key, in chksum_setkey() argument
118 struct chksum_ctx *mctx = crypto_shash_ctx(tfm); in chksum_setkey()
121 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in chksum_setkey()
193 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_digest()
201 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksumc_digest()
206 static int crc32_cra_init(struct crypto_tfm *tfm) in crc32_cra_init() argument
208 struct chksum_ctx *mctx = crypto_tfm_ctx(tfm); in crc32_cra_init()
214 static int crc32c_cra_init(struct crypto_tfm *tfm) in crc32c_cra_init() argument
216 struct chksum_ctx *mctx = crypto_tfm_ctx(tfm); in crc32c_cra_init()
Daes-ce-cipher.c39 static void aes_cipher_encrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[]) in aes_cipher_encrypt() argument
41 struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_cipher_encrypt()
84 static void aes_cipher_decrypt(struct crypto_tfm *tfm, u8 dst[], u8 const src[]) in aes_cipher_decrypt() argument
86 struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in aes_cipher_decrypt()
222 int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, in ce_aes_setkey() argument
225 struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); in ce_aes_setkey()
232 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in ce_aes_setkey()
Dghash-ce-glue.c56 struct ghash_key *key = crypto_shash_ctx(desc->tfm); in ghash_update()
88 struct ghash_key *key = crypto_shash_ctx(desc->tfm); in ghash_final()
103 static int ghash_setkey(struct crypto_shash *tfm, in ghash_setkey() argument
106 struct ghash_key *key = crypto_shash_ctx(tfm); in ghash_setkey()
110 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in ghash_setkey()
Daes-glue.c82 static int xts_set_key(struct crypto_tfm *tfm, const u8 *in_key, in xts_set_key() argument
85 struct crypto_aes_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_set_key()
95 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in xts_set_key()
102 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_encrypt()
124 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_decrypt()
146 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_encrypt()
169 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_decrypt()
192 struct crypto_aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in ctr_encrypt()
238 struct crypto_aes_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
262 struct crypto_aes_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_decrypt()
Daes-ce-ccm-glue.c47 static int ccm_setkey(struct crypto_aead *tfm, const u8 *in_key, in ccm_setkey() argument
50 struct crypto_aes_ctx *ctx = crypto_aead_ctx(tfm); in ccm_setkey()
57 tfm->base.crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in ccm_setkey()
61 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument
/linux-4.1.27/crypto/asymmetric_keys/
Dpkcs7_verify.c28 struct crypto_shash *tfm; in pkcs7_digest() local
43 tfm = crypto_alloc_shash(hash_algo_name[sinfo->sig.pkey_hash_algo], in pkcs7_digest()
45 if (IS_ERR(tfm)) in pkcs7_digest()
46 return (PTR_ERR(tfm) == -ENOENT) ? -ENOPKG : PTR_ERR(tfm); in pkcs7_digest()
48 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pkcs7_digest()
49 sinfo->sig.digest_size = digest_size = crypto_shash_digestsize(tfm); in pkcs7_digest()
57 desc->tfm = tfm; in pkcs7_digest()
117 crypto_free_shash(tfm); in pkcs7_digest()
Dx509_public_key.c130 struct crypto_shash *tfm; in x509_get_sig_params() local
151 tfm = crypto_alloc_shash(hash_algo_name[cert->sig.pkey_hash_algo], 0, 0); in x509_get_sig_params()
152 if (IS_ERR(tfm)) { in x509_get_sig_params()
153 if (PTR_ERR(tfm) == -ENOENT) { in x509_get_sig_params()
157 return PTR_ERR(tfm); in x509_get_sig_params()
160 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in x509_get_sig_params()
161 digest_size = crypto_shash_digestsize(tfm); in x509_get_sig_params()
175 desc->tfm = tfm; in x509_get_sig_params()
184 crypto_free_shash(tfm); in x509_get_sig_params()
Dverify_pefile.c325 struct crypto_shash *tfm; in pefile_digest_pe() local
336 tfm = crypto_alloc_shash(hash_algo_name[ctx->digest_algo], 0, 0); in pefile_digest_pe()
337 if (IS_ERR(tfm)) in pefile_digest_pe()
338 return (PTR_ERR(tfm) == -ENOENT) ? -ENOPKG : PTR_ERR(tfm); in pefile_digest_pe()
340 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pefile_digest_pe()
341 digest_size = crypto_shash_digestsize(tfm); in pefile_digest_pe()
356 desc->tfm = tfm; in pefile_digest_pe()
386 crypto_free_shash(tfm); in pefile_digest_pe()
/linux-4.1.27/arch/powerpc/crypto/
Daes-spe-glue.c92 static int ppc_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, in ppc_aes_setkey() argument
95 struct ppc_aes_ctx *ctx = crypto_tfm_ctx(tfm); in ppc_aes_setkey()
100 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in ppc_aes_setkey()
124 static int ppc_xts_setkey(struct crypto_tfm *tfm, const u8 *in_key, in ppc_xts_setkey() argument
127 struct ppc_xts_ctx *ctx = crypto_tfm_ctx(tfm); in ppc_xts_setkey()
134 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in ppc_xts_setkey()
161 static void ppc_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in ppc_aes_encrypt() argument
163 struct ppc_aes_ctx *ctx = crypto_tfm_ctx(tfm); in ppc_aes_encrypt()
170 static void ppc_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in ppc_aes_decrypt() argument
172 struct ppc_aes_ctx *ctx = crypto_tfm_ctx(tfm); in ppc_aes_decrypt()
[all …]
/linux-4.1.27/drivers/crypto/qat/qat_common/
Dqat_algs.c116 struct crypto_tfm *tfm; member
129 struct crypto_tfm *tfm; member
172 shash->tfm = ctx->hash_tfm; in qat_alg_do_precomputes()
285 struct crypto_aead *aead_tfm = __crypto_aead_cast(ctx->tfm); in qat_alg_aead_init_enc_session()
365 struct crypto_aead *aead_tfm = __crypto_aead_cast(ctx->tfm); in qat_alg_aead_init_dec_session()
541 crypto_tfm_set_flags(ctx->tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in qat_alg_aead_init_sessions()
560 crypto_tfm_set_flags(ctx->tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in qat_alg_ablkcipher_init_sessions()
564 static int qat_alg_aead_setkey(struct crypto_aead *tfm, const uint8_t *key, in qat_alg_aead_setkey() argument
567 struct qat_alg_aead_ctx *ctx = crypto_aead_ctx(tfm); in qat_alg_aead_setkey()
840 struct crypto_tfm *tfm = crypto_aead_tfm(aead_tfm); in qat_alg_aead_dec() local
[all …]
/linux-4.1.27/security/keys/encrypted-keys/
Dencrypted.c88 struct crypto_blkcipher *tfm; in aes_get_sizes() local
90 tfm = crypto_alloc_blkcipher(blkcipher_alg, 0, CRYPTO_ALG_ASYNC); in aes_get_sizes()
91 if (IS_ERR(tfm)) { in aes_get_sizes()
93 PTR_ERR(tfm)); in aes_get_sizes()
94 return PTR_ERR(tfm); in aes_get_sizes()
96 ivsize = crypto_blkcipher_ivsize(tfm); in aes_get_sizes()
97 blksize = crypto_blkcipher_blocksize(tfm); in aes_get_sizes()
98 crypto_free_blkcipher(tfm); in aes_get_sizes()
333 sdesc->shash.tfm = alg; in alloc_sdesc()
410 desc->tfm = crypto_alloc_blkcipher(blkcipher_alg, 0, CRYPTO_ALG_ASYNC); in init_blkcipher_desc()
[all …]
/linux-4.1.27/arch/x86/include/asm/crypto/
Dtwofish.h38 extern int lrw_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
41 extern void lrw_twofish_exit_tfm(struct crypto_tfm *tfm);
43 extern int xts_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
Dserpent-avx.h40 extern int lrw_serpent_setkey(struct crypto_tfm *tfm, const u8 *key,
43 extern void lrw_serpent_exit_tfm(struct crypto_tfm *tfm);
45 extern int xts_serpent_setkey(struct crypto_tfm *tfm, const u8 *key,
Dcamellia.h32 extern int lrw_camellia_setkey(struct crypto_tfm *tfm, const u8 *key,
34 extern void lrw_camellia_exit_tfm(struct crypto_tfm *tfm);
36 extern int xts_camellia_setkey(struct crypto_tfm *tfm, const u8 *key,
/linux-4.1.27/net/ipv4/
Dtcp_fastopen.c35 crypto_free_cipher(ctx->tfm); in tcp_fastopen_ctx_free()
47 ctx->tfm = crypto_alloc_cipher("aes", 0, 0); in tcp_fastopen_reset_cipher()
49 if (IS_ERR(ctx->tfm)) { in tcp_fastopen_reset_cipher()
50 err = PTR_ERR(ctx->tfm); in tcp_fastopen_reset_cipher()
55 err = crypto_cipher_setkey(ctx->tfm, key, len); in tcp_fastopen_reset_cipher()
58 crypto_free_cipher(ctx->tfm); in tcp_fastopen_reset_cipher()
84 crypto_cipher_encrypt_one(ctx->tfm, foc->val, path); in __tcp_fastopen_cookie_gen()
/linux-4.1.27/net/bluetooth/
Damp.c136 struct crypto_shash *tfm; in hmac_sha256() local
143 tfm = crypto_alloc_shash("hmac(sha256)", 0, 0); in hmac_sha256()
144 if (IS_ERR(tfm)) { in hmac_sha256()
145 BT_DBG("crypto_alloc_ahash failed: err %ld", PTR_ERR(tfm)); in hmac_sha256()
146 return PTR_ERR(tfm); in hmac_sha256()
149 ret = crypto_shash_setkey(tfm, key, ksize); in hmac_sha256()
155 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in hmac_sha256()
162 shash->tfm = tfm; in hmac_sha256()
170 crypto_free_shash(tfm); in hmac_sha256()
/linux-4.1.27/arch/x86/crypto/sha-mb/
Dsha1_mb.c707 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in sha1_mb_async_init() local
708 struct sha1_mb_ctx *ctx = crypto_ahash_ctx(tfm); in sha1_mb_async_init()
721 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in sha1_mb_async_update() local
722 struct sha1_mb_ctx *ctx = crypto_ahash_ctx(tfm); in sha1_mb_async_update()
734 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in sha1_mb_async_finup() local
735 struct sha1_mb_ctx *ctx = crypto_ahash_ctx(tfm); in sha1_mb_async_finup()
747 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in sha1_mb_async_final() local
748 struct sha1_mb_ctx *ctx = crypto_ahash_ctx(tfm); in sha1_mb_async_final()
758 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in sha1_mb_async_digest() local
759 struct sha1_mb_ctx *ctx = crypto_ahash_ctx(tfm); in sha1_mb_async_digest()
[all …]
/linux-4.1.27/mm/
Dzswap.c114 struct crypto_comp *tfm; in zswap_comp_op() local
117 tfm = *per_cpu_ptr(zswap_comp_pcpu_tfms, get_cpu()); in zswap_comp_op()
120 ret = crypto_comp_compress(tfm, src, slen, dst, dlen); in zswap_comp_op()
123 ret = crypto_comp_decompress(tfm, src, slen, dst, dlen); in zswap_comp_op()
343 struct crypto_comp *tfm; in __zswap_cpu_notifier() local
348 tfm = crypto_alloc_comp(zswap_compressor, 0, 0); in __zswap_cpu_notifier()
349 if (IS_ERR(tfm)) { in __zswap_cpu_notifier()
353 *per_cpu_ptr(zswap_comp_pcpu_tfms, cpu) = tfm; in __zswap_cpu_notifier()
357 crypto_free_comp(tfm); in __zswap_cpu_notifier()
365 tfm = *per_cpu_ptr(zswap_comp_pcpu_tfms, cpu); in __zswap_cpu_notifier()
[all …]
/linux-4.1.27/drivers/crypto/ux500/hash/
Dhash_core.c566 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in hash_init() local
567 struct hash_ctx *ctx = crypto_ahash_ctx(tfm); in hash_init()
871 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in hash_dma_final() local
872 struct hash_ctx *ctx = crypto_ahash_ctx(tfm); in hash_dma_final()
977 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in hash_hw_final() local
978 struct hash_ctx *ctx = crypto_ahash_ctx(tfm); in hash_hw_final()
1084 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in hash_hw_update() local
1085 struct hash_ctx *ctx = crypto_ahash_ctx(tfm); in hash_hw_update()
1346 static int hash_setkey(struct crypto_ahash *tfm, in hash_setkey() argument
1350 struct hash_ctx *ctx = crypto_ahash_ctx(tfm); in hash_setkey()
[all …]
/linux-4.1.27/net/mac802154/
Dllsec.c132 BUILD_BUG_ON(ARRAY_SIZE(authsizes) != ARRAY_SIZE(key->tfm)); in llsec_key_alloc()
134 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) { in llsec_key_alloc()
135 key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0, in llsec_key_alloc()
137 if (IS_ERR(key->tfm[i])) in llsec_key_alloc()
139 if (crypto_aead_setkey(key->tfm[i], template->key, in llsec_key_alloc()
142 if (crypto_aead_setauthsize(key->tfm[i], authsizes[i])) in llsec_key_alloc()
159 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) in llsec_key_alloc()
160 if (key->tfm[i]) in llsec_key_alloc()
161 crypto_free_aead(key->tfm[i]); in llsec_key_alloc()
174 for (i = 0; i < ARRAY_SIZE(key->tfm); i++) in llsec_key_release()
[all …]
/linux-4.1.27/fs/ecryptfs/
Dcrypto.c93 .tfm = crypt_stat->hash_tfm, in ecryptfs_calculate_md5()
100 if (!desc.tfm) { in ecryptfs_calculate_md5()
101 desc.tfm = crypto_alloc_hash(ECRYPTFS_DEFAULT_HASH, 0, in ecryptfs_calculate_md5()
103 if (IS_ERR(desc.tfm)) { in ecryptfs_calculate_md5()
104 rc = PTR_ERR(desc.tfm); in ecryptfs_calculate_md5()
110 crypt_stat->hash_tfm = desc.tfm; in ecryptfs_calculate_md5()
237 if (crypt_stat->tfm) in ecryptfs_destroy_crypt_stat()
238 crypto_free_ablkcipher(crypt_stat->tfm); in ecryptfs_destroy_crypt_stat()
350 BUG_ON(!crypt_stat || !crypt_stat->tfm in crypt_scatterlist()
362 req = ablkcipher_request_alloc(crypt_stat->tfm, GFP_NOFS); in crypt_scatterlist()
[all …]
/linux-4.1.27/drivers/crypto/caam/
Dcaamalg.c261 struct aead_tfm *tfm = &aead->base.crt_aead; in aead_null_set_sh_desc() local
386 ctx->authsize + tfm->ivsize); in aead_null_set_sh_desc()
452 struct aead_tfm *tfm = &aead->base.crt_aead; in aead_set_sh_desc() local
513 append_math_sub_imm_u32(desc, REG2, SEQINLEN, IMM, tfm->ivsize); in aead_set_sh_desc()
521 aead_append_ld_iv(desc, tfm->ivsize, ctx1_iv_off); in aead_set_sh_desc()
580 ctx->authsize + tfm->ivsize); in aead_set_sh_desc()
589 aead_append_ld_iv(desc, tfm->ivsize, ctx1_iv_off); in aead_set_sh_desc()
648 NFIFOENTRY_PTYPE_RND | (tfm->ivsize << NFIFOENTRY_DLEN_SHIFT); in aead_set_sh_desc()
655 (tfm->ivsize << MOVE_LEN_SHIFT)); in aead_set_sh_desc()
661 (tfm->ivsize << MOVE_LEN_SHIFT)); in aead_set_sh_desc()
[all …]
/linux-4.1.27/drivers/md/
Ddm-verity.c60 struct crypto_shash *tfm; member
289 desc->tfm = v->tfm; in verity_verify_level()
390 desc->tfm = v->tfm; in verity_verify_io()
703 if (v->tfm) in verity_dtr()
704 crypto_free_shash(v->tfm); in verity_dtr()
838 v->tfm = crypto_alloc_shash(v->alg_name, 0, 0); in verity_ctr()
839 if (IS_ERR(v->tfm)) { in verity_ctr()
841 r = PTR_ERR(v->tfm); in verity_ctr()
842 v->tfm = NULL; in verity_ctr()
845 v->digest_size = crypto_shash_digestsize(v->tfm); in verity_ctr()
[all …]
/linux-4.1.27/include/linux/sunrpc/
Dgss_krb5.h74 u32 (*encrypt) (struct crypto_blkcipher *tfm,
77 u32 (*decrypt) (struct crypto_blkcipher *tfm,
273 gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *outbuf,
277 gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
/linux-4.1.27/drivers/misc/sgi-gru/
Dgrufault.c159 struct gru_tlb_fault_map *tfm; in get_clear_fault_map() local
161 tfm = get_tfm_for_cpu(gru, gru_cpu_fault_map_id()); in get_clear_fault_map()
162 prefetchw(tfm); /* Helps on hardware, required for emulator */ in get_clear_fault_map()
164 k = tfm->fault_bits[i]; in get_clear_fault_map()
166 k = xchg(&tfm->fault_bits[i], 0UL); in get_clear_fault_map()
168 k = tfm->done_bits[i]; in get_clear_fault_map()
170 k = xchg(&tfm->done_bits[i], 0UL); in get_clear_fault_map()
178 gru_flush_cache(tfm); in get_clear_fault_map()

12