/linux-6.3-rc2/crypto/ |
A D | algapi.c | 41 if (!alg->cra_name[0] || !alg->cra_driver_name[0]) in crypto_check_alg() 44 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 55 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 183 BUG_ON(&inst->alg == alg); in crypto_remove_spawns() 297 memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, in crypto_alloc_test_larval() 299 larval->alg.cra_priority = alg->cra_priority; in crypto_alloc_test_larval() 498 alg->cra_destroy(alg); in crypto_unregister_alg() 732 spawn->alg = alg; in crypto_grab_spawn() 770 alg = spawn->alg; in crypto_spawn_alg() 784 return alg; in crypto_spawn_alg() [all …]
|
A D | api.c | 85 if (alg) in __crypto_alg_lookup() 87 alg = q; in __crypto_alg_lookup() 93 return alg; in __crypto_alg_lookup() 140 if (!alg) { in crypto_larval_add() 141 alg = &larval->alg; in crypto_larval_add() 146 if (alg != &larval->alg) { in crypto_larval_add() 149 alg = crypto_larval_wait(alg); in crypto_larval_add() 247 if (alg) { in crypto_alg_lookup() 260 if (alg && !crypto_is_larval(alg)) { in crypto_alg_lookup() 293 if (!IS_ERR_OR_NULL(alg) && crypto_is_larval(alg)) in crypto_larval_lookup() [all …]
|
A D | crypto_user_stat.c | 192 ualg->cru_flags = alg->cra_flags; in crypto_reportstat_one() 209 if (crypto_report_aead(skb, alg)) in crypto_reportstat_one() 221 if (crypto_report_comp(skb, alg)) in crypto_reportstat_one() 225 if (crypto_report_acomp(skb, alg)) in crypto_reportstat_one() 229 if (crypto_report_acomp(skb, alg)) in crypto_reportstat_one() 237 if (crypto_report_kpp(skb, alg)) in crypto_reportstat_one() 249 if (crypto_report_rng(skb, alg)) in crypto_reportstat_one() 300 struct crypto_alg *alg; in crypto_reportstat() local 308 alg = crypto_alg_match(p, 0); in crypto_reportstat() 309 if (!alg) in crypto_reportstat() [all …]
|
A D | internal.h | 27 struct crypto_alg alg; member 82 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 87 return alg->cra_ctxsize; in crypto_compress_ctxsize() 101 void crypto_shoot_alg(struct crypto_alg *alg); 136 refcount_inc(&alg->cra_refcnt); in crypto_alg_get() 137 return alg; in crypto_alg_get() 142 if (refcount_dec_and_test(&alg->cra_refcnt) && alg->cra_destroy) in crypto_alg_put() 143 alg->cra_destroy(alg); in crypto_alg_put() 158 return alg->cra_flags & CRYPTO_ALG_LARVAL; in crypto_is_larval() 163 return alg->cra_flags & CRYPTO_ALG_DEAD; in crypto_is_dead() [all …]
|
A D | akcipher.c | 55 alg->exit(akcipher); in crypto_akcipher_exit_tfm() 63 if (alg->exit) in crypto_akcipher_init_tfm() 66 if (alg->init) in crypto_akcipher_init_tfm() 67 return alg->init(akcipher); in crypto_akcipher_init_tfm() 133 if (!alg->sign) in crypto_register_akcipher() 134 alg->sign = akcipher_default_op; in crypto_register_akcipher() 135 if (!alg->verify) in crypto_register_akcipher() 137 if (!alg->encrypt) in crypto_register_akcipher() 139 if (!alg->decrypt) in crypto_register_akcipher() 141 if (!alg->set_priv_key) in crypto_register_akcipher() [all …]
|
A D | crypto_user_base.c | 63 alg = q; in crypto_alg_match() 69 return alg; in crypto_alg_match() 127 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one() 128 if (alg->cra_type->report(skb, alg)) in crypto_report_one() 198 if (!alg) in crypto_report() 214 crypto_mod_put(alg); in crypto_report() 278 if (!alg) in crypto_update_alg() 290 crypto_mod_put(alg); in crypto_update_alg() 310 if (!alg) in crypto_del_alg() 356 if (alg) { in crypto_add_alg() [all …]
|
A D | proc.c | 41 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 44 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 47 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 50 (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? in c_show() 54 (alg->cra_flags & CRYPTO_ALG_FIPS_INTERNAL) ? in c_show() 58 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 64 if (alg->cra_type && alg->cra_type->show) { in c_show() 65 alg->cra_type->show(m, alg); in c_show() 69 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { in c_show() 74 alg->cra_cipher.cia_min_keysize); in c_show() [all …]
|
A D | simd.c | 43 struct skcipher_alg alg; member 116 struct skcipher_alg *alg; in simd_skcipher_init() local 120 salg = container_of(alg, struct simd_skcipher_alg, alg); in simd_skcipher_init() 146 struct skcipher_alg *alg; in simd_skcipher_create_compat() local 163 alg = &salg->alg; in simd_skcipher_create_compat() 182 alg->ivsize = ialg->ivsize; in simd_skcipher_create_compat() 283 struct aead_alg alg; member 364 struct aead_alg *alg; in simd_aead_init() local 368 salg = container_of(alg, struct simd_aead_alg, alg); in simd_aead_init() 393 struct aead_alg *alg; in simd_aead_create_compat() local [all …]
|
A D | aead.c | 90 crypto_stats_get(alg); in crypto_aead_encrypt() 107 crypto_stats_get(alg); in crypto_aead_decrypt() 124 alg->exit(aead); in crypto_aead_exit_tfm() 134 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() 136 if (alg->exit) in crypto_aead_init_tfm() 139 if (alg->init) in crypto_aead_init_tfm() 140 return alg->init(aead); in crypto_aead_init_tfm() 224 if (max3(alg->maxauthsize, alg->ivsize, alg->chunksize) > in aead_prepare_alg() 228 if (!alg->chunksize) in aead_prepare_alg() 243 err = aead_prepare_alg(alg); in crypto_register_aead() [all …]
|
A D | ctr.c | 130 struct crypto_alg *alg; in crypto_ctr_create() local 137 alg = skcipher_ialg_simple(inst); in crypto_ctr_create() 141 if (alg->cra_blocksize < 4) in crypto_ctr_create() 145 if (alg->cra_blocksize % 4) in crypto_ctr_create() 155 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 261 struct skcipher_alg *alg; in crypto_rfc3686_create() local 301 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc3686_create() 303 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc3686_create() 306 inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); in crypto_rfc3686_create() 307 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg) + in crypto_rfc3686_create() [all …]
|
A D | ahash.c | 313 crypto_stats_get(alg); in crypto_ahash_final() 327 crypto_stats_get(alg); in crypto_ahash_finup() 341 crypto_stats_get(alg); in crypto_ahash_digest() 421 alg->exit_tfm(hash); in crypto_ahash_exit_tfm() 434 hash->init = alg->init; in crypto_ahash_init_tfm() 435 hash->update = alg->update; in crypto_ahash_init_tfm() 436 hash->final = alg->final; in crypto_ahash_init_tfm() 438 hash->digest = alg->digest; in crypto_ahash_init_tfm() 442 if (alg->setkey) { in crypto_ahash_init_tfm() 447 if (alg->exit_tfm) in crypto_ahash_init_tfm() [all …]
|
A D | acompress.c | 57 alg->exit(acomp); in crypto_acomp_exit_tfm() 68 acomp->compress = alg->compress; in crypto_acomp_init_tfm() 69 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm() 70 acomp->dst_free = alg->dst_free; in crypto_acomp_init_tfm() 71 acomp->reqsize = alg->reqsize; in crypto_acomp_init_tfm() 73 if (alg->exit) in crypto_acomp_init_tfm() 76 if (alg->init) in crypto_acomp_init_tfm() 77 return alg->init(acomp); in crypto_acomp_init_tfm() 84 int extsize = crypto_alg_extsize(alg); in crypto_acomp_extsize() 152 struct crypto_alg *base = &alg->base; in crypto_register_acomp() [all …]
|
A D | kpp.c | 52 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_exit_tfm() local 54 alg->exit(kpp); in crypto_kpp_exit_tfm() 60 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_init_tfm() local 62 if (alg->exit) in crypto_kpp_init_tfm() 65 if (alg->init) in crypto_kpp_init_tfm() 66 return alg->init(kpp); in crypto_kpp_init_tfm() 115 struct crypto_alg *base = &alg->base; in kpp_prepare_alg() 124 struct crypto_alg *base = &alg->base; in crypto_register_kpp() 126 kpp_prepare_alg(alg); in crypto_register_kpp() 133 crypto_unregister_alg(&alg->base); in crypto_unregister_kpp() [all …]
|
A D | geniv.c | 46 struct aead_alg *alg; in aead_geniv_alloc() local 67 alg = crypto_spawn_aead_alg(spawn); in aead_geniv_alloc() 69 ivsize = crypto_aead_alg_ivsize(alg); in aead_geniv_alloc() 70 maxauthsize = crypto_aead_alg_maxauthsize(alg); in aead_geniv_alloc() 86 inst->alg.base.cra_priority = alg->base.cra_priority; in aead_geniv_alloc() 87 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in aead_geniv_alloc() 88 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in aead_geniv_alloc() 91 inst->alg.setkey = aead_geniv_setkey; in aead_geniv_alloc() 92 inst->alg.setauthsize = aead_geniv_setauthsize; in aead_geniv_alloc() 94 inst->alg.ivsize = ivsize; in aead_geniv_alloc() [all …]
|
A D | shash.c | 411 alg->exit_tfm(hash); in crypto_shash_exit_tfm() 424 if (alg->exit_tfm) in crypto_shash_init_tfm() 427 if (!alg->init_tfm) in crypto_shash_init_tfm() 436 if (alg->exit_tfm) in crypto_shash_init_tfm() 437 alg->exit_tfm(hash); in crypto_shash_init_tfm() 532 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg() 539 if (!alg->finup) in shash_prepare_alg() 541 if (!alg->digest) in shash_prepare_alg() 543 if (!alg->export) { in shash_prepare_alg() 546 alg->statesize = alg->descsize; in shash_prepare_alg() [all …]
|
A D | hmac.c | 173 struct crypto_alg *alg; in hmac_create() local 194 alg = &salg->base; in hmac_create() 204 ss < alg->cra_blocksize) in hmac_create() 211 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 212 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 213 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 216 inst->alg.digestsize = ds; in hmac_create() 217 inst->alg.statesize = ss; in hmac_create() 222 inst->alg.init = hmac_init; in hmac_create() 224 inst->alg.final = hmac_final; in hmac_create() [all …]
|
A D | rng.c | 33 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_rng_reset() local 48 crypto_stats_get(alg); in crypto_rng_reset() 50 crypto_stats_rng_seed(alg, err); in crypto_rng_reset() 62 static unsigned int seedsize(struct crypto_alg *alg) in seedsize() argument 78 rrng.seedsize = seedsize(alg); in crypto_rng_report() 94 seq_printf(m, "seedsize : %u\n", seedsize(alg)); in crypto_rng_show() 177 int crypto_register_rng(struct rng_alg *alg) in crypto_register_rng() argument 179 struct crypto_alg *base = &alg->base; in crypto_register_rng() 181 if (alg->seedsize > PAGE_SIZE / 8) in crypto_register_rng() 192 void crypto_unregister_rng(struct rng_alg *alg) in crypto_unregister_rng() argument [all …]
|
A D | xcbc.c | 193 struct crypto_alg *alg; in xcbc_create() local 211 alg = crypto_spawn_cipher_alg(spawn); in xcbc_create() 214 if (alg->cra_blocksize != XCBC_BLOCKSIZE) in xcbc_create() 221 alignmask = alg->cra_alignmask | 3; in xcbc_create() 223 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() 224 inst->alg.base.cra_blocksize = alg->cra_blocksize; in xcbc_create() 226 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create() 231 alg->cra_blocksize * 2; in xcbc_create() 235 alg->cra_blocksize * 2; in xcbc_create() 236 inst->alg.base.cra_init = xcbc_init_tfm; in xcbc_create() [all …]
|
A D | pcrypt.c | 217 struct crypto_alg *alg) in pcrypt_init_instance() argument 223 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance() 225 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance() 226 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance() 227 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance() 237 struct aead_alg *alg; in pcrypt_create_aead() local 268 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in pcrypt_create_aead() 269 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in pcrypt_create_aead() 273 inst->alg.init = pcrypt_aead_init_tfm; in pcrypt_create_aead() 274 inst->alg.exit = pcrypt_aead_exit_tfm; in pcrypt_create_aead() [all …]
|
A D | testmgr.c | 140 const char *alg; member 3877 alg); in do_test_kpp() 3946 alg); in do_test_kpp() 4745 .alg = "dh", 5285 .alg = "lz4", 5305 .alg = "lzo", 5325 .alg = "md4", 5331 .alg = "md5", 5476 .alg = "rsa", 5546 .alg = "sm2", [all …]
|
A D | cryptd.c | 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() 406 inst->alg.ivsize = crypto_skcipher_alg_ivsize(alg); in cryptd_create_skcipher() 407 inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); in cryptd_create_skcipher() 408 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg); in cryptd_create_skcipher() 676 inst->alg.halg.digestsize = alg->digestsize; in cryptd_create_hash() 677 inst->alg.halg.statesize = alg->statesize; in cryptd_create_hash() 885 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in cryptd_create_aead() [all …]
|
A D | cmac.c | 227 struct crypto_alg *alg; in cmac_create() local 245 alg = crypto_spawn_cipher_alg(spawn); in cmac_create() 247 switch (alg->cra_blocksize) { in cmac_create() 260 alignmask = alg->cra_alignmask; in cmac_create() 262 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create() 263 inst->alg.base.cra_blocksize = alg->cra_blocksize; in cmac_create() 265 inst->alg.digestsize = alg->cra_blocksize; in cmac_create() 266 inst->alg.descsize = in cmac_create() 269 + alg->cra_blocksize * 2; in cmac_create() 271 inst->alg.base.cra_ctxsize = in cmac_create() [all …]
|
/linux-6.3-rc2/fs/verity/ |
A D | hash_algs.c | 46 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local 59 return alg; in fsverity_get_hash_alg() 63 if (alg->tfm != NULL) in fsverity_get_hash_alg() 75 alg->name); in fsverity_get_hash_alg() 76 alg = ERR_PTR(-ENOPKG); in fsverity_get_hash_alg() 82 alg = ERR_CAST(tfm); in fsverity_get_hash_alg() 107 alg = ERR_PTR(err); in fsverity_get_hash_alg() 110 return alg; in fsverity_get_hash_alg() 315 if (!alg->name) in fsverity_check_hash_algs() 329 BUG_ON(alg->algo_id == 0); in fsverity_check_hash_algs() [all …]
|
/linux-6.3-rc2/include/linux/ |
A D | crypto.h | 502 void (*cra_destroy)(struct crypto_alg *alg); 521 void crypto_stats_init(struct crypto_alg *alg); 522 void crypto_stats_get(struct crypto_alg *alg); 529 void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg); 530 void crypto_stats_akcipher_verify(int ret, struct crypto_alg *alg); 533 void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret); 536 void crypto_stats_rng_seed(struct crypto_alg *alg, int ret); 541 static inline void crypto_stats_init(struct crypto_alg *alg) in crypto_stats_init() argument 543 static inline void crypto_stats_get(struct crypto_alg *alg) in crypto_stats_get() argument 622 int crypto_register_alg(struct crypto_alg *alg); [all …]
|
/linux-6.3-rc2/drivers/crypto/bcm/ |
A D | cipher.c | 325 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req() 704 hash_parms.alg = ctx->auth.alg; in handle_ahash_req() 1301 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req() 1309 hash_parms.alg = ctx->auth.alg; in handle_aead_req() 1869 cipher_parms.alg = ctx->cipher.alg; in skcipher_setkey() 2748 switch (ctx->alg->cipher_info.alg) { in aead_authenc_setkey() 3027 .alg.aead = { 3050 .alg.aead = { 3073 .alg.aead = { 3096 .alg.aead = { [all …]
|