/kernel/linux/linux-5.10/crypto/ |
D | api.c | 33 static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg); 35 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) in crypto_mod_get() argument 37 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get() 41 void crypto_mod_put(struct crypto_alg *alg) in crypto_mod_put() argument 43 struct module *module = alg->cra_module; in crypto_mod_put() 45 crypto_alg_put(alg); in crypto_mod_put() 52 return larval->alg.cra_driver_name[0]; in crypto_is_test_larval() 58 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local 84 if (alg) in __crypto_alg_lookup() 85 crypto_mod_put(alg); in __crypto_alg_lookup() [all …]
|
D | algapi.c | 31 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument 33 crypto_check_module_sig(alg->cra_module); in crypto_check_alg() 35 if (!alg->cra_name[0] || !alg->cra_driver_name[0]) in crypto_check_alg() 38 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 42 if (alg->cra_alignmask > MAX_ALGAPI_ALIGNMASK) in crypto_check_alg() 45 if (alg->cra_blocksize > MAX_ALGAPI_BLOCKSIZE) in crypto_check_alg() 49 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 51 if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK) in crypto_check_alg() 54 if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE) in crypto_check_alg() 58 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 | 26 struct crypto_alg alg; member 46 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument 48 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 51 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument 53 return alg->cra_ctxsize; in crypto_compress_ctxsize() 56 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 60 void crypto_larval_kill(struct crypto_alg *alg); 63 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, 66 void crypto_shoot_alg(struct crypto_alg *alg); 67 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 | 129 struct crypto_alg *alg; in crypto_ctr_create() local 136 alg = skcipher_ialg_simple(inst); in crypto_ctr_create() 140 if (alg->cra_blocksize < 4) in crypto_ctr_create() 144 if (alg->cra_blocksize % 4) in crypto_ctr_create() 148 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create() 154 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 156 inst->alg.encrypt = crypto_ctr_crypt; in crypto_ctr_create() 157 inst->alg.decrypt = crypto_ctr_crypt; in crypto_ctr_create() 260 struct skcipher_alg *alg; in crypto_rfc3686_create() local 280 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 | 169 struct crypto_alg *alg; in hmac_create() local 190 alg = &salg->base; in hmac_create() 199 if (ds > alg->cra_blocksize || in hmac_create() 200 ss < alg->cra_blocksize) 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() 209 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 211 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create() 212 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 | algboss.c | 36 } alg; member 53 char alg[CRYPTO_MAX_ALG_NAME]; member 75 crypto_alg_put(¶m->larval->alg); in cryptomgr_probe() 84 const char *name = larval->alg.cra_name; in cryptomgr_schedule_probe() 135 param->attrs[i].alg.attr.rta_len = in cryptomgr_schedule_probe() 136 sizeof(param->attrs[i].alg); in cryptomgr_schedule_probe() 137 param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; in cryptomgr_schedule_probe() 138 memcpy(param->attrs[i].alg.data.name, name, len); in cryptomgr_schedule_probe() 167 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; in cryptomgr_schedule_probe() 171 param->otype = larval->alg.cra_flags; in cryptomgr_schedule_probe() [all …]
|
D | xcbc.c | 192 struct crypto_alg *alg; in xcbc_create() local 210 alg = crypto_spawn_cipher_alg(spawn); in xcbc_create() 213 if (alg->cra_blocksize != XCBC_BLOCKSIZE) in xcbc_create() 216 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in xcbc_create() 220 alignmask = alg->cra_alignmask | 3; in xcbc_create() 221 inst->alg.base.cra_alignmask = alignmask; in xcbc_create() 222 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() 223 inst->alg.base.cra_blocksize = alg->cra_blocksize; in xcbc_create() 225 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create() 226 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 | 211 struct crypto_alg *alg) in cryptd_init_instance() argument 213 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 215 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() 375 struct skcipher_alg *alg; in cryptd_create_skcipher() local 394 alg = crypto_spawn_skcipher_alg(&ctx->spawn); in cryptd_create_skcipher() 395 err = cryptd_init_instance(skcipher_crypto_instance(inst), &alg->base); in cryptd_create_skcipher() [all …]
|
D | cmac.c | 226 struct crypto_alg *alg; in cmac_create() local 244 alg = crypto_spawn_cipher_alg(spawn); in cmac_create() 246 switch (alg->cra_blocksize) { in cmac_create() 255 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); in cmac_create() 259 alignmask = alg->cra_alignmask; in cmac_create() 260 inst->alg.base.cra_alignmask = alignmask; in cmac_create() 261 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create() 262 inst->alg.base.cra_blocksize = alg->cra_blocksize; in cmac_create() 264 inst->alg.digestsize = alg->cra_blocksize; in cmac_create() 265 inst->alg.descsize = in cmac_create() [all …]
|
/kernel/linux/linux-5.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 …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | crypto.h | 493 void (*cra_destroy)(struct crypto_alg *alg); 512 void crypto_stats_init(struct crypto_alg *alg); 513 void crypto_stats_get(struct crypto_alg *alg); 514 void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 515 void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 516 void crypto_stats_ahash_update(unsigned int nbytes, int ret, struct crypto_alg *alg); 517 void crypto_stats_ahash_final(unsigned int nbytes, int ret, struct crypto_alg *alg); 518 void crypto_stats_akcipher_encrypt(unsigned int src_len, int ret, struct crypto_alg *alg); 519 void crypto_stats_akcipher_decrypt(unsigned int src_len, int ret, struct crypto_alg *alg); 520 void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg); [all …]
|
/kernel/linux/linux-5.10/include/crypto/ |
D | akcipher.h | 139 static inline struct akcipher_alg *__crypto_akcipher_alg(struct crypto_alg *alg) in __crypto_akcipher_alg() argument 141 return container_of(alg, struct akcipher_alg, base); in __crypto_akcipher_alg() 272 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_maxsize() local 274 return alg->max_size(tfm); in crypto_akcipher_maxsize() 290 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_encrypt() local 296 ret = alg->encrypt(req); in crypto_akcipher_encrypt() 314 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_decrypt() local 320 ret = alg->decrypt(req); in crypto_akcipher_decrypt() 338 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_sign() local 343 ret = alg->sign(req); in crypto_akcipher_sign() [all …]
|