/crypto/ |
D | geniv.c | 35 static void aead_geniv_free(struct aead_instance *inst) in aead_geniv_free() argument 37 crypto_drop_aead(aead_instance_ctx(inst)); in aead_geniv_free() 38 kfree(inst); in aead_geniv_free() 45 struct aead_instance *inst; in aead_geniv_alloc() local 56 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in aead_geniv_alloc() 57 if (!inst) in aead_geniv_alloc() 60 spawn = aead_instance_ctx(inst); in aead_geniv_alloc() 62 err = crypto_grab_aead(spawn, aead_crypto_instance(inst), in aead_geniv_alloc() 77 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() 81 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() [all …]
|
D | ctr.c | 129 struct skcipher_instance *inst; in crypto_ctr_create() local 133 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_ctr_create() 134 if (IS_ERR(inst)) in crypto_ctr_create() 135 return PTR_ERR(inst); in crypto_ctr_create() 137 alg = skcipher_ialg_simple(inst); in crypto_ctr_create() 149 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create() 155 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 157 inst->alg.encrypt = crypto_ctr_crypt; in crypto_ctr_create() 158 inst->alg.decrypt = crypto_ctr_crypt; in crypto_ctr_create() 160 err = skcipher_register_instance(tmpl, inst); in crypto_ctr_create() [all …]
|
D | ccm.c | 395 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_ccm_init_tfm() local 396 struct ccm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_ccm_init_tfm() 437 static void crypto_ccm_free(struct aead_instance *inst) in crypto_ccm_free() argument 439 struct ccm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_ccm_free() 443 kfree(inst); in crypto_ccm_free() 452 struct aead_instance *inst; in crypto_ccm_create_common() local 462 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in crypto_ccm_create_common() 463 if (!inst) in crypto_ccm_create_common() 465 ictx = aead_instance_ctx(inst); in crypto_ccm_create_common() 467 err = crypto_grab_ahash(&ictx->mac, aead_crypto_instance(inst), in crypto_ccm_create_common() [all …]
|
D | hmac.c | 144 struct shash_instance *inst = shash_alg_instance(parent); in hmac_init_tfm() local 145 struct crypto_shash_spawn *spawn = shash_instance_ctx(inst); in hmac_init_tfm() 167 struct shash_instance *inst; in hmac_create() local 180 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in hmac_create() 181 if (!inst) in hmac_create() 183 spawn = shash_instance_ctx(inst); in hmac_create() 185 err = crypto_grab_shash(spawn, shash_crypto_instance(inst), in hmac_create() 203 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in hmac_create() 207 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 208 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() [all …]
|
D | cryptd.c | 189 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue() local 190 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in cryptd_get_queue() 210 static int cryptd_init_instance(struct crypto_instance *inst, in cryptd_init_instance() argument 213 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 218 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance() 220 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance() 221 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance() 222 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance() 337 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm() local 338 struct skcipherd_instance_ctx *ictx = skcipher_instance_ctx(inst); in cryptd_skcipher_init_tfm() [all …]
|
D | gcm.c | 523 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_gcm_init_tfm() local 524 struct gcm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_gcm_init_tfm() 567 static void crypto_gcm_free(struct aead_instance *inst) in crypto_gcm_free() argument 569 struct gcm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_gcm_free() 573 kfree(inst); in crypto_gcm_free() 582 struct aead_instance *inst; in crypto_gcm_create_common() local 592 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_gcm_create_common() 593 if (!inst) in crypto_gcm_create_common() 595 ctx = aead_instance_ctx(inst); in crypto_gcm_create_common() 597 err = crypto_grab_ahash(&ctx->ghash, aead_crypto_instance(inst), in crypto_gcm_create_common() [all …]
|
D | pcrypt.c | 178 struct aead_instance *inst = aead_alg_instance(tfm); in pcrypt_aead_init_tfm() local 179 struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); in pcrypt_aead_init_tfm() 210 static void pcrypt_free(struct aead_instance *inst) in pcrypt_free() argument 212 struct pcrypt_instance_ctx *ctx = aead_instance_ctx(inst); in pcrypt_free() 217 kfree(inst); in pcrypt_free() 220 static int pcrypt_init_instance(struct crypto_instance *inst, in pcrypt_init_instance() argument 223 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance() 227 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance() 229 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance() 230 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance() [all …]
|
D | lrw.c | 267 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in lrw_init_tfm() local 268 struct crypto_skcipher_spawn *spawn = skcipher_instance_ctx(inst); in lrw_init_tfm() 293 static void lrw_free_instance(struct skcipher_instance *inst) in lrw_free_instance() argument 295 crypto_drop_skcipher(skcipher_instance_ctx(inst)); in lrw_free_instance() 296 kfree(inst); in lrw_free_instance() 302 struct skcipher_instance *inst; in lrw_create() local 317 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in lrw_create() 318 if (!inst) in lrw_create() 321 spawn = skcipher_instance_ctx(inst); in lrw_create() 323 err = crypto_grab_skcipher(spawn, skcipher_crypto_instance(inst), in lrw_create() [all …]
|
D | xcbc.c | 170 struct crypto_instance *inst = (void *)tfm->__crt_alg; in xcbc_init_tfm() local 171 struct crypto_cipher_spawn *spawn = crypto_instance_ctx(inst); in xcbc_init_tfm() 191 struct shash_instance *inst; in xcbc_create() local 202 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in xcbc_create() 203 if (!inst) in xcbc_create() 205 spawn = shash_instance_ctx(inst); in xcbc_create() 207 err = crypto_grab_cipher(spawn, shash_crypto_instance(inst), in xcbc_create() 217 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in xcbc_create() 222 inst->alg.base.cra_alignmask = alignmask; in xcbc_create() 223 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() [all …]
|
D | authenc.c | 116 struct aead_instance *inst = aead_alg_instance(authenc); in authenc_geniv_ahash_done() local 117 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in authenc_geniv_ahash_done() 135 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_genicv() local 137 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_genicv() 195 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_encrypt() local 197 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_encrypt() 233 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_decrypt_tail() local 235 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt_tail() 282 struct aead_instance *inst = aead_alg_instance(authenc); in crypto_authenc_decrypt() local 284 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt() [all …]
|
D | cmac.c | 204 struct crypto_instance *inst = (void *)tfm->__crt_alg; in cmac_init_tfm() local 205 struct crypto_cipher_spawn *spawn = crypto_instance_ctx(inst); in cmac_init_tfm() 225 struct shash_instance *inst; in cmac_create() local 236 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in cmac_create() 237 if (!inst) in cmac_create() 239 spawn = shash_instance_ctx(inst); in cmac_create() 241 err = crypto_grab_cipher(spawn, shash_crypto_instance(inst), in cmac_create() 256 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); 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 …]
|
D | ofb.c | 55 struct skcipher_instance *inst; in crypto_ofb_create() local 59 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_ofb_create() 60 if (IS_ERR(inst)) in crypto_ofb_create() 61 return PTR_ERR(inst); in crypto_ofb_create() 63 alg = skcipher_ialg_simple(inst); in crypto_ofb_create() 66 inst->alg.base.cra_blocksize = 1; in crypto_ofb_create() 72 inst->alg.chunksize = alg->cra_blocksize; in crypto_ofb_create() 74 inst->alg.encrypt = crypto_ofb_crypt; in crypto_ofb_create() 75 inst->alg.decrypt = crypto_ofb_crypt; in crypto_ofb_create() 77 err = skcipher_register_instance(tmpl, inst); in crypto_ofb_create() [all …]
|
D | echainiv.c | 115 struct aead_instance *inst; in echainiv_aead_create() local 118 inst = aead_geniv_alloc(tmpl, tb); in echainiv_aead_create() 120 if (IS_ERR(inst)) in echainiv_aead_create() 121 return PTR_ERR(inst); in echainiv_aead_create() 124 if (inst->alg.ivsize & (sizeof(u64) - 1) || !inst->alg.ivsize) in echainiv_aead_create() 127 inst->alg.encrypt = echainiv_encrypt; in echainiv_aead_create() 128 inst->alg.decrypt = echainiv_decrypt; in echainiv_aead_create() 130 inst->alg.init = aead_init_geniv; in echainiv_aead_create() 131 inst->alg.exit = aead_exit_geniv; in echainiv_aead_create() 133 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); in echainiv_aead_create() [all …]
|
D | cts.c | 285 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 336 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_cts_create() 337 if (!inst) in crypto_cts_create() 340 spawn = skcipher_instance_ctx(inst); in crypto_cts_create() 342 err = crypto_grab_skcipher(spawn, skcipher_crypto_instance(inst), in crypto_cts_create() [all …]
|
D | xts.c | 297 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in xts_init_tfm() local 298 struct xts_instance_ctx *ictx = skcipher_instance_ctx(inst); in xts_init_tfm() 331 static void xts_free_instance(struct skcipher_instance *inst) in xts_free_instance() argument 333 struct xts_instance_ctx *ictx = skcipher_instance_ctx(inst); in xts_free_instance() 336 kfree(inst); in xts_free_instance() 341 struct skcipher_instance *inst; in xts_create() local 356 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in xts_create() 357 if (!inst) in xts_create() 360 ctx = skcipher_instance_ctx(inst); in xts_create() 362 err = crypto_grab_skcipher(&ctx->spawn, skcipher_crypto_instance(inst), in xts_create() [all …]
|
D | seqiv.c | 138 struct aead_instance *inst; in seqiv_aead_create() local 141 inst = aead_geniv_alloc(tmpl, tb); in seqiv_aead_create() 143 if (IS_ERR(inst)) in seqiv_aead_create() 144 return PTR_ERR(inst); in seqiv_aead_create() 147 if (inst->alg.ivsize != sizeof(u64)) in seqiv_aead_create() 150 inst->alg.encrypt = seqiv_aead_encrypt; in seqiv_aead_create() 151 inst->alg.decrypt = seqiv_aead_decrypt; in seqiv_aead_create() 153 inst->alg.init = aead_init_geniv; in seqiv_aead_create() 154 inst->alg.exit = aead_exit_geniv; in seqiv_aead_create() 156 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); in seqiv_aead_create() [all …]
|
D | ecb.c | 64 struct skcipher_instance *inst; in crypto_ecb_create() local 67 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_ecb_create() 68 if (IS_ERR(inst)) in crypto_ecb_create() 69 return PTR_ERR(inst); in crypto_ecb_create() 71 inst->alg.ivsize = 0; /* ECB mode doesn't take an IV */ in crypto_ecb_create() 73 inst->alg.encrypt = crypto_ecb_encrypt; in crypto_ecb_create() 74 inst->alg.decrypt = crypto_ecb_decrypt; in crypto_ecb_create() 76 err = skcipher_register_instance(tmpl, inst); in crypto_ecb_create() 78 inst->free(inst); in crypto_ecb_create()
|
D | authencesn.c | 324 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_authenc_esn_init_tfm() local 325 struct authenc_esn_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_esn_init_tfm() 381 static void crypto_authenc_esn_free(struct aead_instance *inst) in crypto_authenc_esn_free() argument 383 struct authenc_esn_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_authenc_esn_free() 387 kfree(inst); in crypto_authenc_esn_free() 394 struct aead_instance *inst; in crypto_authenc_esn_create() local 405 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_authenc_esn_create() 406 if (!inst) in crypto_authenc_esn_create() 408 ctx = aead_instance_ctx(inst); in crypto_authenc_esn_create() 410 err = crypto_grab_ahash(&ctx->auth, aead_crypto_instance(inst), in crypto_authenc_esn_create() [all …]
|
D | hctr2.c | 337 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in hctr2_init_tfm() local 338 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_init_tfm() 395 static void hctr2_free_instance(struct skcipher_instance *inst) in hctr2_free_instance() argument 397 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_free_instance() 402 kfree(inst); in hctr2_free_instance() 411 struct skcipher_instance *inst; in hctr2_create_common() local 424 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in hctr2_create_common() 425 if (!inst) in hctr2_create_common() 427 ictx = skcipher_instance_ctx(inst); in hctr2_create_common() 431 skcipher_crypto_instance(inst), in hctr2_create_common() [all …]
|
D | keywrap.c | 266 struct skcipher_instance *inst; in crypto_kw_create() local 270 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_kw_create() 271 if (IS_ERR(inst)) in crypto_kw_create() 272 return PTR_ERR(inst); in crypto_kw_create() 274 alg = skcipher_ialg_simple(inst); in crypto_kw_create() 281 inst->alg.base.cra_blocksize = SEMIBSIZE; in crypto_kw_create() 282 inst->alg.base.cra_alignmask = 0; in crypto_kw_create() 283 inst->alg.ivsize = SEMIBSIZE; in crypto_kw_create() 285 inst->alg.encrypt = crypto_kw_encrypt; in crypto_kw_create() 286 inst->alg.decrypt = crypto_kw_decrypt; in crypto_kw_create() [all …]
|
D | rsa-pkcs1pad.c | 381 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_sign() local 382 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_sign() 438 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_verify_complete() local 439 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_verify_complete() 567 struct akcipher_instance *inst = akcipher_alg_instance(tfm); in pkcs1pad_init_tfm() local 568 struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); in pkcs1pad_init_tfm() 591 static void pkcs1pad_free(struct akcipher_instance *inst) in pkcs1pad_free() argument 593 struct pkcs1pad_inst_ctx *ctx = akcipher_instance_ctx(inst); in pkcs1pad_free() 597 kfree(inst); in pkcs1pad_free() 603 struct akcipher_instance *inst; in pkcs1pad_create() local [all …]
|
D | adiantum.c | 399 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in adiantum_init_tfm() local 400 struct adiantum_instance_ctx *ictx = skcipher_instance_ctx(inst); in adiantum_init_tfm() 458 static void adiantum_free_instance(struct skcipher_instance *inst) in adiantum_free_instance() argument 460 struct adiantum_instance_ctx *ictx = skcipher_instance_ctx(inst); in adiantum_free_instance() 465 kfree(inst); in adiantum_free_instance() 496 struct skcipher_instance *inst; in adiantum_create() local 507 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in adiantum_create() 508 if (!inst) in adiantum_create() 510 ictx = skcipher_instance_ctx(inst); in adiantum_create() 514 skcipher_crypto_instance(inst), in adiantum_create() [all …]
|
D | xctr.c | 133 struct skcipher_instance *inst; in crypto_xctr_create() local 137 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_xctr_create() 138 if (IS_ERR(inst)) in crypto_xctr_create() 139 return PTR_ERR(inst); in crypto_xctr_create() 141 alg = skcipher_ialg_simple(inst); in crypto_xctr_create() 149 inst->alg.base.cra_blocksize = 1; in crypto_xctr_create() 155 inst->alg.chunksize = alg->cra_blocksize; in crypto_xctr_create() 157 inst->alg.encrypt = crypto_xctr_crypt; in crypto_xctr_create() 158 inst->alg.decrypt = crypto_xctr_crypt; in crypto_xctr_create() 160 err = skcipher_register_instance(tmpl, inst); in crypto_xctr_create() [all …]
|
D | algapi.c | 66 static void crypto_free_instance(struct crypto_instance *inst) in crypto_free_instance() argument 68 inst->alg.cra_type->free(inst); in crypto_free_instance() 73 struct crypto_instance *inst = (void *)alg; in crypto_destroy_instance() local 74 struct crypto_template *tmpl = inst->tmpl; in crypto_destroy_instance() 76 crypto_free_instance(inst); in crypto_destroy_instance() 110 return &n->inst->alg.cra_users; in crypto_more_spawns() 113 static void crypto_remove_instance(struct crypto_instance *inst, in crypto_remove_instance() argument 116 struct crypto_template *tmpl = inst->tmpl; in crypto_remove_instance() 118 if (crypto_is_dead(&inst->alg)) in crypto_remove_instance() 121 inst->alg.cra_flags |= CRYPTO_ALG_DEAD; in crypto_remove_instance() [all …]
|
D | chacha20poly1305.c | 502 struct aead_instance *inst = aead_alg_instance(tfm); in chachapoly_init() local 503 struct chachapoly_instance_ctx *ictx = aead_instance_ctx(inst); in chachapoly_init() 546 static void chachapoly_free(struct aead_instance *inst) in chachapoly_free() argument 548 struct chachapoly_instance_ctx *ctx = aead_instance_ctx(inst); in chachapoly_free() 552 kfree(inst); in chachapoly_free() 559 struct aead_instance *inst; in chachapoly_create() local 572 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in chachapoly_create() 573 if (!inst) in chachapoly_create() 575 ctx = aead_instance_ctx(inst); in chachapoly_create() 578 err = crypto_grab_skcipher(&ctx->chacha, aead_crypto_instance(inst), in chachapoly_create() [all …]
|