/linux-5.19.10/crypto/ |
D | api.c | 37 static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg); 39 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) in crypto_mod_get() argument 41 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get() 45 void crypto_mod_put(struct crypto_alg *alg) in crypto_mod_put() argument 47 struct module *module = alg->cra_module; in crypto_mod_put() 49 crypto_alg_put(alg); in crypto_mod_put() 57 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local 83 if (alg) in __crypto_alg_lookup() 84 crypto_mod_put(alg); in __crypto_alg_lookup() 85 alg = q; in __crypto_alg_lookup() [all …]
|
D | algapi.c | 37 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument 39 crypto_check_module_sig(alg->cra_module); in crypto_check_alg() 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() 48 if (alg->cra_alignmask > MAX_ALGAPI_ALIGNMASK) in crypto_check_alg() 51 if (alg->cra_blocksize > MAX_ALGAPI_BLOCKSIZE) in crypto_check_alg() 55 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 57 if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK) in crypto_check_alg() 60 if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE) in crypto_check_alg() 64 if (alg->cra_priority < 0) in crypto_check_alg() [all …]
|
D | crypto_user_stat.c | 31 static int crypto_report_aead(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_aead() argument 39 raead.stat_encrypt_cnt = atomic64_read(&alg->stats.aead.encrypt_cnt); in crypto_report_aead() 40 raead.stat_encrypt_tlen = atomic64_read(&alg->stats.aead.encrypt_tlen); in crypto_report_aead() 41 raead.stat_decrypt_cnt = atomic64_read(&alg->stats.aead.decrypt_cnt); in crypto_report_aead() 42 raead.stat_decrypt_tlen = atomic64_read(&alg->stats.aead.decrypt_tlen); in crypto_report_aead() 43 raead.stat_err_cnt = atomic64_read(&alg->stats.aead.err_cnt); in crypto_report_aead() 48 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument 56 rcipher.stat_encrypt_cnt = atomic64_read(&alg->stats.cipher.encrypt_cnt); in crypto_report_cipher() 57 rcipher.stat_encrypt_tlen = atomic64_read(&alg->stats.cipher.encrypt_tlen); in crypto_report_cipher() 58 rcipher.stat_decrypt_cnt = atomic64_read(&alg->stats.cipher.decrypt_cnt); in crypto_report_cipher() [all …]
|
D | internal.h | 27 struct crypto_alg alg; member 62 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument 64 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 67 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument 69 return alg->cra_ctxsize; in crypto_compress_ctxsize() 72 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 76 void crypto_larval_kill(struct crypto_alg *alg); 80 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, 83 void crypto_shoot_alg(struct crypto_alg *alg); 84 struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, [all …]
|
D | akcipher.c | 24 static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_akcipher_report() argument 36 static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_akcipher_report() argument 42 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg) 45 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_akcipher_show() argument 53 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_exit_tfm() local 55 alg->exit(akcipher); in crypto_akcipher_exit_tfm() 61 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_init_tfm() local 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() [all …]
|
D | crypto_user_base.c | 38 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local 63 alg = q; in crypto_alg_match() 69 return alg; in crypto_alg_match() 72 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument 80 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher() 81 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher() 82 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher() 88 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument 99 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument 104 strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one() [all …]
|
D | proc.c | 38 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); in c_show() local 40 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 41 seq_printf(m, "driver : %s\n", alg->cra_driver_name); in c_show() 42 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); in c_show() 43 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 44 seq_printf(m, "refcnt : %u\n", refcount_read(&alg->cra_refcnt)); in c_show() 46 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 49 (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? in c_show() 52 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 54 seq_printf(m, "flags : 0x%x\n", alg->cra_flags); in c_show() [all …]
|
D | simd.c | 43 struct skcipher_alg alg; member 116 struct skcipher_alg *alg; in simd_skcipher_init() local 119 alg = crypto_skcipher_alg(tfm); in simd_skcipher_init() 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() 166 if (snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", algname) >= in simd_skcipher_create_compat() 170 if (snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in simd_skcipher_create_compat() 174 alg->base.cra_flags = CRYPTO_ALG_ASYNC | in simd_skcipher_create_compat() 176 alg->base.cra_priority = ialg->base.cra_priority; in simd_skcipher_create_compat() [all …]
|
D | aead.c | 86 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_encrypt() local 90 crypto_stats_get(alg); in crypto_aead_encrypt() 95 crypto_stats_aead_encrypt(cryptlen, alg, ret); in crypto_aead_encrypt() 103 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_decrypt() local 107 crypto_stats_get(alg); in crypto_aead_decrypt() 114 crypto_stats_aead_decrypt(cryptlen, alg, ret); in crypto_aead_decrypt() 122 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local 124 alg->exit(aead); in crypto_aead_exit_tfm() 130 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local 134 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() [all …]
|
D | kpp.c | 24 static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 35 static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 41 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg) 44 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_kpp_show() argument 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() [all …]
|
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() 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() 261 struct skcipher_alg *alg; in crypto_rfc3686_create() local 281 alg = crypto_spawn_skcipher_alg(spawn); in crypto_rfc3686_create() [all …]
|
D | acompress.c | 27 static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument 38 static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument 44 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg) 47 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_acomp_show() argument 55 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_exit_tfm() local 57 alg->exit(acomp); in crypto_acomp_exit_tfm() 63 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_init_tfm() local 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() [all …]
|
D | ahash.c | 165 const struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in ahash_set_needkey() local 168 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey() 343 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final() local 347 crypto_stats_get(alg); in crypto_ahash_final() 349 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_final() 357 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup() local 361 crypto_stats_get(alg); in crypto_ahash_finup() 363 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_finup() 371 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest() local 375 crypto_stats_get(alg); in crypto_ahash_digest() [all …]
|
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() 77 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() 78 "%s(%s)", tmpl->name, alg->base.cra_name) >= in aead_geniv_alloc() 81 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() 82 "%s(%s)", tmpl->name, alg->base.cra_driver_name) >= 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() [all …]
|
D | shash.c | 36 bool crypto_shash_alg_has_setkey(struct shash_alg *alg) in crypto_shash_alg_has_setkey() argument 38 return alg->setkey != shash_no_setkey; in crypto_shash_alg_has_setkey() 63 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument 65 if (crypto_shash_alg_needs_key(alg)) in shash_set_needkey() 380 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local 402 if (crypto_shash_alg_has_setkey(alg)) in crypto_init_shash_ops_async() 419 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_exit_tfm() local 421 alg->exit_tfm(hash); in crypto_shash_exit_tfm() 427 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local 430 hash->descsize = alg->descsize; in crypto_shash_init_tfm() [all …]
|
D | hmac.c | 173 struct crypto_alg *alg; in hmac_create() local 194 alg = &salg->base; in hmac_create() 203 if (ds > alg->cra_blocksize || in hmac_create() 204 ss < alg->cra_blocksize) in hmac_create() 207 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); 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() 215 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create() 216 inst->alg.digestsize = ds; in hmac_create() [all …]
|
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 64 struct rng_alg *ralg = container_of(alg, struct rng_alg, base); in seedsize() 70 static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_rng_report() argument 78 rrng.seedsize = seedsize(alg); in crypto_rng_report() 83 static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_rng_report() argument 89 static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) 91 static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) in crypto_rng_show() argument [all …]
|
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() 217 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in xcbc_create() 221 alignmask = alg->cra_alignmask | 3; 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() 224 inst->alg.base.cra_blocksize = alg->cra_blocksize; in xcbc_create() 226 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create() 227 inst->alg.descsize = ALIGN(sizeof(struct xcbc_desc_ctx), in xcbc_create() [all …]
|
D | pcrypt.c | 217 struct crypto_alg *alg) in pcrypt_init_instance() argument 219 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance() 220 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_init_instance() 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 261 alg = crypto_spawn_aead_alg(&ctx->spawn); in pcrypt_create_aead() 262 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead() [all …]
|
D | cryptd.c | 210 struct crypto_alg *alg) in cryptd_init_instance() argument 212 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 214 alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_init_instance() 217 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance() 219 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance() 220 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance() 221 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance() 374 struct skcipher_alg *alg; in cryptd_create_skcipher() local 393 alg = crypto_spawn_skcipher_alg(&ctx->spawn); in cryptd_create_skcipher() 394 err = cryptd_init_instance(skcipher_crypto_instance(inst), &alg->base); in cryptd_create_skcipher() [all …]
|
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() 256 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in cmac_create() 260 alignmask = alg->cra_alignmask; 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() 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() [all …]
|
/linux-5.19.10/fs/verity/ |
D | hash_algs.c | 44 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local 53 alg = &fsverity_hash_algs[num]; in fsverity_get_hash_alg() 56 if (likely(smp_load_acquire(&alg->tfm) != NULL)) in fsverity_get_hash_alg() 57 return alg; in fsverity_get_hash_alg() 61 if (alg->tfm != NULL) in fsverity_get_hash_alg() 68 tfm = crypto_alloc_ahash(alg->name, 0, 0); in fsverity_get_hash_alg() 73 alg->name); in fsverity_get_hash_alg() 74 alg = ERR_PTR(-ENOPKG); in fsverity_get_hash_alg() 79 alg->name, PTR_ERR(tfm)); in fsverity_get_hash_alg() 80 alg = ERR_CAST(tfm); in fsverity_get_hash_alg() [all …]
|
/linux-5.19.10/include/linux/ |
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); 523 void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 524 void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 525 void crypto_stats_ahash_update(unsigned int nbytes, int ret, struct crypto_alg *alg); 526 void crypto_stats_ahash_final(unsigned int nbytes, int ret, struct crypto_alg *alg); 527 void crypto_stats_akcipher_encrypt(unsigned int src_len, int ret, struct crypto_alg *alg); 528 void crypto_stats_akcipher_decrypt(unsigned int src_len, int ret, struct crypto_alg *alg); 529 void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg); [all …]
|
/linux-5.19.10/drivers/crypto/bcm/ |
D | cipher.c | 325 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req() 415 0, ctx->auth.alg, ctx->auth.mode, in handle_skcipher_req() 502 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp() 704 hash_parms.alg = ctx->auth.alg; in handle_ahash_req() 773 if (hash_parms.alg == HASH_ALG_AES) in handle_ahash_req() 778 digestsize = spu->spu_digest_size(ctx->digestsize, ctx->auth.alg, in handle_ahash_req() 788 hash_parms.pad_len = spu->spu_hash_pad_len(hash_parms.alg, in handle_ahash_req() 798 (hash_parms.alg != HASH_ALG_AES)) { in handle_ahash_req() 845 hash_parms.pad_len, ctx->auth.alg, in handle_ahash_req() 905 switch (ctx->auth.alg) { in spu_hmac_outer_hash() [all …]
|
/linux-5.19.10/drivers/staging/rtl8192u/ieee80211/ |
D | ieee80211_crypt.c | 101 struct ieee80211_crypto_alg *alg; in ieee80211_register_crypto_ops() local 106 alg = kzalloc(sizeof(*alg), GFP_KERNEL); in ieee80211_register_crypto_ops() 107 if (!alg) in ieee80211_register_crypto_ops() 110 alg->ops = ops; in ieee80211_register_crypto_ops() 113 list_add(&alg->list, &hcrypt->algs); in ieee80211_register_crypto_ops() 133 struct ieee80211_crypto_alg *alg = in ieee80211_unregister_crypto_ops() local 135 if (alg->ops == ops) { in ieee80211_unregister_crypto_ops() 136 list_del(&alg->list); in ieee80211_unregister_crypto_ops() 137 del_alg = alg; in ieee80211_unregister_crypto_ops() 164 struct ieee80211_crypto_alg *alg = in ieee80211_get_crypto_ops() local [all …]
|