Home
last modified time | relevance | path

Searched refs:inst (Results 1 – 25 of 30) sorted by relevance

12

/crypto/
Dctr.c160 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_ctr_init_tfm() local
161 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in crypto_ctr_init_tfm()
183 struct crypto_instance *inst; in crypto_ctr_alloc() local
205 inst = crypto_alloc_instance("ctr", alg); in crypto_ctr_alloc()
206 if (IS_ERR(inst)) in crypto_ctr_alloc()
209 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ctr_alloc()
210 inst->alg.cra_priority = alg->cra_priority; in crypto_ctr_alloc()
211 inst->alg.cra_blocksize = 1; in crypto_ctr_alloc()
212 inst->alg.cra_alignmask = alg->cra_alignmask | (__alignof__(u32) - 1); in crypto_ctr_alloc()
213 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_ctr_alloc()
[all …]
Decb.c99 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_ecb_init_tfm() local
100 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in crypto_ecb_init_tfm()
120 struct crypto_instance *inst; in crypto_ecb_alloc() local
133 inst = crypto_alloc_instance("ecb", alg); in crypto_ecb_alloc()
134 if (IS_ERR(inst)) in crypto_ecb_alloc()
137 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ecb_alloc()
138 inst->alg.cra_priority = alg->cra_priority; in crypto_ecb_alloc()
139 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_ecb_alloc()
140 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_ecb_alloc()
141 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_ecb_alloc()
[all …]
Dcryptd.c188 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue() local
189 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in cryptd_get_queue()
306 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_blkcipher_init_tfm() local
307 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in cryptd_blkcipher_init_tfm()
329 static int cryptd_init_instance(struct crypto_instance *inst, in cryptd_init_instance() argument
332 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance()
337 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance()
339 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance()
340 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance()
341 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance()
[all …]
Dalgapi.c70 static void crypto_free_instance(struct crypto_instance *inst) in crypto_free_instance() argument
72 if (!inst->alg.cra_type->free) { in crypto_free_instance()
73 inst->tmpl->free(inst); in crypto_free_instance()
77 inst->alg.cra_type->free(inst); in crypto_free_instance()
82 struct crypto_instance *inst = (void *)alg; in crypto_destroy_instance() local
83 struct crypto_template *tmpl = inst->tmpl; in crypto_destroy_instance()
85 crypto_free_instance(inst); in crypto_destroy_instance()
104 &list_next_entry(n, list)->inst->alg; in crypto_more_spawns()
108 return &n->list == stack ? top : &n->inst->alg.cra_users; in crypto_more_spawns()
111 static void crypto_remove_instance(struct crypto_instance *inst, in crypto_remove_instance() argument
[all …]
Dechainiv.c120 struct aead_instance *inst; in echainiv_aead_create() local
125 inst = aead_geniv_alloc(tmpl, tb, 0, 0); in echainiv_aead_create()
127 if (IS_ERR(inst)) in echainiv_aead_create()
128 return PTR_ERR(inst); in echainiv_aead_create()
130 spawn = aead_instance_ctx(inst); in echainiv_aead_create()
134 if (inst->alg.ivsize & (sizeof(u64) - 1) || !inst->alg.ivsize) in echainiv_aead_create()
137 inst->alg.encrypt = echainiv_encrypt; in echainiv_aead_create()
138 inst->alg.decrypt = echainiv_decrypt; in echainiv_aead_create()
140 inst->alg.init = aead_init_geniv; in echainiv_aead_create()
141 inst->alg.exit = aead_exit_geniv; in echainiv_aead_create()
[all …]
Dgcm.c564 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_gcm_init_tfm() local
565 struct gcm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_gcm_init_tfm()
608 static void crypto_gcm_free(struct aead_instance *inst) in crypto_gcm_free() argument
610 struct gcm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_gcm_free()
614 kfree(inst); in crypto_gcm_free()
624 struct aead_instance *inst; in crypto_gcm_create_common() local
649 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_gcm_create_common()
650 if (!inst) in crypto_gcm_create_common()
653 ctx = aead_instance_ctx(inst); in crypto_gcm_create_common()
655 aead_crypto_instance(inst)); in crypto_gcm_create_common()
[all …]
Daead.c149 static void crypto_aead_free_instance(struct crypto_instance *inst) in crypto_aead_free_instance() argument
151 struct aead_instance *aead = aead_instance(inst); in crypto_aead_free_instance()
154 inst->tmpl->free(inst); in crypto_aead_free_instance()
197 struct aead_instance *inst; in aead_geniv_alloc() local
214 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in aead_geniv_alloc()
215 if (!inst) in aead_geniv_alloc()
218 spawn = aead_instance_ctx(inst); in aead_geniv_alloc()
223 crypto_set_aead_spawn(spawn, aead_crypto_instance(inst)); in aead_geniv_alloc()
238 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
242 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
[all …]
Dhmac.c160 struct crypto_instance *inst = (void *)tfm->__crt_alg; in hmac_init_tfm() local
161 struct crypto_shash_spawn *spawn = crypto_instance_ctx(inst); in hmac_init_tfm()
183 struct shash_instance *inst; in hmac_create() local
210 inst = shash_alloc_instance("hmac", alg); in hmac_create()
211 err = PTR_ERR(inst); in hmac_create()
212 if (IS_ERR(inst)) in hmac_create()
215 err = crypto_init_shash_spawn(shash_instance_ctx(inst), salg, in hmac_create()
216 shash_crypto_instance(inst)); in hmac_create()
220 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create()
221 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create()
[all …]
Dccm.c455 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_ccm_init_tfm() local
456 struct ccm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_ccm_init_tfm()
497 static void crypto_ccm_free(struct aead_instance *inst) in crypto_ccm_free() argument
499 struct ccm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_ccm_free()
503 kfree(inst); in crypto_ccm_free()
513 struct aead_instance *inst; in crypto_ccm_create_common() local
535 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in crypto_ccm_create_common()
537 if (!inst) in crypto_ccm_create_common()
540 ictx = aead_instance_ctx(inst); in crypto_ccm_create_common()
543 aead_crypto_instance(inst), in crypto_ccm_create_common()
[all …]
Dauthenc.c122 struct aead_instance *inst = aead_alg_instance(authenc); in authenc_geniv_ahash_done() local
123 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in authenc_geniv_ahash_done()
141 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_genicv() local
143 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_genicv()
201 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_encrypt() local
203 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_encrypt()
239 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_decrypt_tail() local
241 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt_tail()
288 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_decrypt() local
290 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt()
[all …]
Dxcbc.c180 struct crypto_instance *inst = (void *)tfm->__crt_alg; in xcbc_init_tfm() local
181 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in xcbc_init_tfm()
201 struct shash_instance *inst; in xcbc_create() local
222 inst = shash_alloc_instance("xcbc", alg); in xcbc_create()
223 err = PTR_ERR(inst); in xcbc_create()
224 if (IS_ERR(inst)) in xcbc_create()
227 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create()
228 shash_crypto_instance(inst), in xcbc_create()
234 inst->alg.base.cra_alignmask = alignmask; in xcbc_create()
235 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create()
[all …]
Dkeywrap.c323 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in crypto_kw_init_tfm() local
324 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in crypto_kw_init_tfm()
345 struct crypto_instance *inst = NULL; in crypto_kw_alloc() local
358 inst = ERR_PTR(-EINVAL); in crypto_kw_alloc()
363 inst = crypto_alloc_instance("kw", alg); in crypto_kw_alloc()
364 if (IS_ERR(inst)) in crypto_kw_alloc()
367 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_kw_alloc()
368 inst->alg.cra_priority = alg->cra_priority; in crypto_kw_alloc()
369 inst->alg.cra_blocksize = SEMIBSIZE; in crypto_kw_alloc()
370 inst->alg.cra_alignmask = 0; in crypto_kw_alloc()
[all …]
Dcbc.c195 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_cbc_init_tfm() local
196 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in crypto_cbc_init_tfm()
216 struct crypto_instance *inst; in crypto_cbc_alloc() local
229 inst = ERR_PTR(-EINVAL); in crypto_cbc_alloc()
233 inst = crypto_alloc_instance("cbc", alg); in crypto_cbc_alloc()
234 if (IS_ERR(inst)) in crypto_cbc_alloc()
237 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_cbc_alloc()
238 inst->alg.cra_priority = alg->cra_priority; in crypto_cbc_alloc()
239 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_cbc_alloc()
240 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_cbc_alloc()
[all …]
Dmcryptd.c215 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in mcryptd_get_queue() local
216 struct mcryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in mcryptd_get_queue()
225 struct crypto_instance *inst; in mcryptd_alloc_instance() local
228 p = kzalloc(head + sizeof(*inst) + tail, GFP_KERNEL); in mcryptd_alloc_instance()
232 inst = (void *)(p + head); in mcryptd_alloc_instance()
235 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in mcryptd_alloc_instance()
239 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in mcryptd_alloc_instance()
241 inst->alg.cra_priority = alg->cra_priority + 50; in mcryptd_alloc_instance()
242 inst->alg.cra_blocksize = alg->cra_blocksize; in mcryptd_alloc_instance()
243 inst->alg.cra_alignmask = alg->cra_alignmask; in mcryptd_alloc_instance()
[all …]
Dcts.c285 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in crypto_cts_init_tfm() local
286 struct crypto_skcipher_spawn *spawn = skcipher_instance_ctx(inst); in crypto_cts_init_tfm()
318 static void crypto_cts_free(struct skcipher_instance *inst) in crypto_cts_free() argument
320 crypto_drop_skcipher(skcipher_instance_ctx(inst)); in crypto_cts_free()
321 kfree(inst); in crypto_cts_free()
327 struct skcipher_instance *inst; in crypto_cts_create() local
344 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_cts_create()
345 if (!inst) in crypto_cts_create()
348 spawn = skcipher_instance_ctx(inst); in crypto_cts_create()
350 crypto_set_skcipher_spawn(spawn, skcipher_crypto_instance(inst)); in crypto_cts_create()
[all …]
Dpcbc.c205 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_pcbc_init_tfm() local
206 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in crypto_pcbc_init_tfm()
226 struct crypto_instance *inst; in crypto_pcbc_alloc() local
239 inst = crypto_alloc_instance("pcbc", alg); in crypto_pcbc_alloc()
240 if (IS_ERR(inst)) in crypto_pcbc_alloc()
243 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_pcbc_alloc()
244 inst->alg.cra_priority = alg->cra_priority; in crypto_pcbc_alloc()
245 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_pcbc_alloc()
246 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_pcbc_alloc()
247 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_pcbc_alloc()
[all …]
Dcmac.c206 struct crypto_instance *inst = (void *)tfm->__crt_alg; in cmac_init_tfm() local
207 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in cmac_init_tfm()
227 struct shash_instance *inst; in cmac_create() local
249 inst = shash_alloc_instance("cmac", alg); in cmac_create()
250 err = PTR_ERR(inst); in cmac_create()
251 if (IS_ERR(inst)) in cmac_create()
254 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in cmac_create()
255 shash_crypto_instance(inst), in cmac_create()
261 inst->alg.base.cra_alignmask = alignmask; in cmac_create()
262 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create()
[all …]
Dseqiv.c26 static void seqiv_free(struct crypto_instance *inst);
146 struct aead_instance *inst; in seqiv_aead_create() local
151 inst = aead_geniv_alloc(tmpl, tb, 0, 0); in seqiv_aead_create()
153 if (IS_ERR(inst)) in seqiv_aead_create()
154 return PTR_ERR(inst); in seqiv_aead_create()
156 inst->alg.base.cra_alignmask |= __alignof__(u32) - 1; in seqiv_aead_create()
158 spawn = aead_instance_ctx(inst); in seqiv_aead_create()
162 if (inst->alg.ivsize != sizeof(u64)) in seqiv_aead_create()
165 inst->alg.encrypt = seqiv_aead_encrypt; in seqiv_aead_create()
166 inst->alg.decrypt = seqiv_aead_decrypt; in seqiv_aead_create()
[all …]
Dpcrypt.c225 struct aead_instance *inst = aead_alg_instance(tfm); in pcrypt_aead_init_tfm() local
226 struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); in pcrypt_aead_init_tfm()
257 static void pcrypt_free(struct aead_instance *inst) in pcrypt_free() argument
259 struct pcrypt_instance_ctx *ctx = aead_instance_ctx(inst); in pcrypt_free()
262 kfree(inst); in pcrypt_free()
265 static int pcrypt_init_instance(struct crypto_instance *inst, in pcrypt_init_instance() argument
268 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance()
272 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance()
274 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance()
275 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance()
[all …]
Dxts.c239 struct crypto_instance *inst = (void *)tfm->__crt_alg; in init_tfm() local
240 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in init_tfm()
284 struct crypto_instance *inst; in alloc() local
297 inst = crypto_alloc_instance("xts", alg); in alloc()
298 if (IS_ERR(inst)) in alloc()
301 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc()
302 inst->alg.cra_priority = alg->cra_priority; in alloc()
303 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc()
306 inst->alg.cra_alignmask = 7; in alloc()
308 inst->alg.cra_alignmask = alg->cra_alignmask; in alloc()
[all …]
Dlrw.c299 struct crypto_instance *inst = (void *)tfm->__crt_alg; in init_tfm() local
300 struct crypto_spawn *spawn = crypto_instance_ctx(inst); in init_tfm()
328 struct crypto_instance *inst; in alloc() local
341 inst = crypto_alloc_instance("lrw", alg); in alloc()
342 if (IS_ERR(inst)) in alloc()
345 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc()
346 inst->alg.cra_priority = alg->cra_priority; in alloc()
347 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc()
349 if (alg->cra_alignmask < 7) inst->alg.cra_alignmask = 7; in alloc()
350 else inst->alg.cra_alignmask = alg->cra_alignmask; in alloc()
[all …]
Dauthencesn.c338 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_authenc_esn_init_tfm() local
339 struct authenc_esn_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_esn_init_tfm()
395 static void crypto_authenc_esn_free(struct aead_instance *inst) in crypto_authenc_esn_free() argument
397 struct authenc_esn_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_authenc_esn_free()
401 kfree(inst); in crypto_authenc_esn_free()
408 struct aead_instance *inst; in crypto_authenc_esn_create() local
436 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_authenc_esn_create()
438 if (!inst) in crypto_authenc_esn_create()
441 ctx = aead_instance_ctx(inst); in crypto_authenc_esn_create()
444 aead_crypto_instance(inst)); in crypto_authenc_esn_create()
[all …]
Drsa-pkcs1pad.c405 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_sign() local
406 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_sign()
462 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_verify_complete() local
463 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_verify_complete()
580 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_init_tfm() local
581 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_init_tfm()
600 static void pkcs1pad_free(struct akcipher_instance *inst) in pkcs1pad_free() argument
602 struct pkcs1pad_inst_ctx *ctx = akcipher_instance_ctx(inst); in pkcs1pad_free()
606 kfree(inst); in pkcs1pad_free()
613 struct akcipher_instance *inst; in pkcs1pad_create() local
[all …]
Dchacha20poly1305.c524 struct aead_instance *inst = aead_alg_instance(tfm); in chachapoly_init() local
525 struct chachapoly_instance_ctx *ictx = aead_instance_ctx(inst); in chachapoly_init()
568 static void chachapoly_free(struct aead_instance *inst) in chachapoly_free() argument
570 struct chachapoly_instance_ctx *ctx = aead_instance_ctx(inst); in chachapoly_free()
574 kfree(inst); in chachapoly_free()
581 struct aead_instance *inst; in chachapoly_create() local
620 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in chachapoly_create()
621 if (!inst) in chachapoly_create()
624 ctx = aead_instance_ctx(inst); in chachapoly_create()
627 aead_crypto_instance(inst)); in chachapoly_create()
[all …]
Dakcipher.c79 static void crypto_akcipher_free_instance(struct crypto_instance *inst) in crypto_akcipher_free_instance() argument
81 struct akcipher_instance *akcipher = akcipher_instance(inst); in crypto_akcipher_free_instance()
140 struct akcipher_instance *inst) in akcipher_register_instance() argument
142 akcipher_prepare_alg(&inst->alg); in akcipher_register_instance()
143 return crypto_register_instance(tmpl, akcipher_crypto_instance(inst)); in akcipher_register_instance()

12