| /Linux-v5.4/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 | 28 struct crypto_alg alg; member 48 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument 50 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 53 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument 55 return alg->cra_ctxsize; in crypto_compress_ctxsize() 58 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 65 void crypto_larval_kill(struct crypto_alg *alg); 68 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, 71 void crypto_shoot_alg(struct crypto_alg *alg); 72 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 | aead.c | 91 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_encrypt() local 95 crypto_stats_get(alg); in crypto_aead_encrypt() 100 crypto_stats_aead_encrypt(cryptlen, alg, ret); in crypto_aead_encrypt() 108 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_decrypt() local 112 crypto_stats_get(alg); in crypto_aead_decrypt() 119 crypto_stats_aead_decrypt(cryptlen, alg, ret); in crypto_aead_decrypt() 127 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local 129 alg->exit(aead); in crypto_aead_exit_tfm() 135 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local 139 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() [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 120 struct skcipher_alg *alg; in simd_skcipher_init() local 123 alg = crypto_skcipher_alg(tfm); in simd_skcipher_init() 124 salg = container_of(alg, struct simd_skcipher_alg, alg); in simd_skcipher_init() 150 struct skcipher_alg *alg; in simd_skcipher_create_compat() local 167 alg = &salg->alg; in simd_skcipher_create_compat() 170 if (snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", algname) >= in simd_skcipher_create_compat() 174 if (snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in simd_skcipher_create_compat() 178 alg->base.cra_flags = CRYPTO_ALG_ASYNC; in simd_skcipher_create_compat() 179 alg->base.cra_priority = ialg->base.cra_priority; in simd_skcipher_create_compat() [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 | 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 | 196 const struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in ahash_set_needkey() local 199 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey() 374 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final() local 378 crypto_stats_get(alg); in crypto_ahash_final() 380 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_final() 388 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup() local 392 crypto_stats_get(alg); in crypto_ahash_finup() 394 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_finup() 402 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest() local 406 crypto_stats_get(alg); in crypto_ahash_digest() [all …]
|
| D | ctr.c | 129 struct crypto_alg *alg; in crypto_ctr_create() local 132 inst = skcipher_alloc_instance_simple(tmpl, tb, &alg); in crypto_ctr_create() 138 if (alg->cra_blocksize < 4) in crypto_ctr_create() 142 if (alg->cra_blocksize % 4) in crypto_ctr_create() 146 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create() 152 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 154 inst->alg.encrypt = crypto_ctr_crypt; in crypto_ctr_create() 155 inst->alg.decrypt = crypto_ctr_crypt; in crypto_ctr_create() 165 crypto_mod_put(alg); in crypto_ctr_create() 267 struct skcipher_alg *alg; in crypto_rfc3686_create() local [all …]
|
| D | shash.c | 51 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument 53 if (crypto_shash_alg_has_setkey(alg) && in shash_set_needkey() 54 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in shash_set_needkey() 353 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local 375 if (crypto_shash_alg_has_setkey(alg)) in crypto_init_shash_ops_async() 392 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local 394 hash->descsize = alg->descsize; in crypto_shash_init_tfm() 396 shash_set_needkey(hash, alg); in crypto_shash_init_tfm() 402 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument 405 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_report() [all …]
|
| D | xcbc.c | 191 struct crypto_alg *alg; in xcbc_create() local 199 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in xcbc_create() 201 if (IS_ERR(alg)) in xcbc_create() 202 return PTR_ERR(alg); in xcbc_create() 204 switch(alg->cra_blocksize) { in xcbc_create() 211 inst = shash_alloc_instance("xcbc", alg); in xcbc_create() 216 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create() 222 alignmask = alg->cra_alignmask | 3; in xcbc_create() 223 inst->alg.base.cra_alignmask = alignmask; in xcbc_create() 224 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() [all …]
|
| D | hmac.c | 173 struct crypto_alg *alg; in hmac_create() local 186 alg = &salg->base; in hmac_create() 195 if (ds > alg->cra_blocksize || in hmac_create() 196 ss < alg->cra_blocksize) in hmac_create() 199 inst = shash_alloc_instance("hmac", alg); in hmac_create() 209 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 210 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 211 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 213 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create() 214 inst->alg.digestsize = ds; in hmac_create() [all …]
|
| D | cmac.c | 225 struct crypto_alg *alg; in cmac_create() local 233 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in cmac_create() 235 if (IS_ERR(alg)) in cmac_create() 236 return PTR_ERR(alg); in cmac_create() 238 switch (alg->cra_blocksize) { in cmac_create() 247 inst = shash_alloc_instance("cmac", alg); in cmac_create() 252 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in cmac_create() 258 alignmask = alg->cra_alignmask; in cmac_create() 259 inst->alg.base.cra_alignmask = alignmask; in cmac_create() 260 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create() [all …]
|
| D | rng.c | 33 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_rng_reset() local 37 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 | pcrypt.c | 199 struct crypto_alg *alg) in pcrypt_init_instance() argument 201 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance() 202 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_init_instance() 205 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance() 207 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance() 208 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance() 209 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance() 220 struct aead_alg *alg; in pcrypt_create_aead() local 243 alg = crypto_spawn_aead_alg(&ctx->spawn); in pcrypt_create_aead() 244 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead() [all …]
|
| D | ccm.c | 519 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 523 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 528 inst->alg.base.cra_flags = ctr->base.cra_flags & CRYPTO_ALG_ASYNC; in crypto_ccm_create_common() 529 inst->alg.base.cra_priority = (mac->base.cra_priority + in crypto_ccm_create_common() 531 inst->alg.base.cra_blocksize = 1; in crypto_ccm_create_common() 532 inst->alg.base.cra_alignmask = mac->base.cra_alignmask | in crypto_ccm_create_common() 534 inst->alg.ivsize = 16; in crypto_ccm_create_common() 535 inst->alg.chunksize = crypto_skcipher_alg_chunksize(ctr); in crypto_ccm_create_common() 536 inst->alg.maxauthsize = 16; in crypto_ccm_create_common() 537 inst->alg.base.cra_ctxsize = sizeof(struct crypto_ccm_ctx); in crypto_ccm_create_common() [all …]
|
| D | cryptd.c | 208 struct crypto_alg *alg) in cryptd_init_instance() argument 210 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 212 alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_init_instance() 215 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance() 217 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance() 218 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance() 219 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance() 224 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, in cryptd_alloc_instance() argument 237 err = cryptd_init_instance(inst, alg); in cryptd_alloc_instance() 402 struct skcipher_alg *alg; in cryptd_create_skcipher() local [all …]
|
| /Linux-v5.4/include/crypto/internal/ |
| D | skcipher.h | 26 struct skcipher_alg alg; member 78 struct skcipher_instance, alg); in skcipher_alg_instance() 108 return container_of(spawn->base.alg, struct skcipher_alg, base); in crypto_skcipher_spawn_alg() 129 int crypto_register_skcipher(struct skcipher_alg *alg); 130 void crypto_unregister_skcipher(struct skcipher_alg *alg); 183 struct skcipher_alg *alg) in crypto_skcipher_alg_min_keysize() argument 185 if ((alg->base.cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_skcipher_alg_min_keysize() 187 return alg->base.cra_blkcipher.min_keysize; in crypto_skcipher_alg_min_keysize() 189 if (alg->base.cra_ablkcipher.encrypt) in crypto_skcipher_alg_min_keysize() 190 return alg->base.cra_ablkcipher.min_keysize; in crypto_skcipher_alg_min_keysize() [all …]
|
| D | hash.h | 33 struct ahash_alg alg; member 37 struct shash_alg alg; member 72 int crypto_register_ahash(struct ahash_alg *alg); 73 int crypto_unregister_ahash(struct ahash_alg *alg); 83 static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg) in crypto_shash_alg_has_setkey() argument 85 return alg->setkey != shash_no_setkey; in crypto_shash_alg_has_setkey() 91 struct hash_alg_common *alg, 101 int crypto_register_shash(struct shash_alg *alg); 102 int crypto_unregister_shash(struct shash_alg *alg); 110 struct shash_alg *alg, [all …]
|
| /Linux-v5.4/fs/verity/ |
| D | hash_algs.c | 42 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local 51 alg = &fsverity_hash_algs[num]; in fsverity_get_hash_alg() 54 tfm = READ_ONCE(alg->tfm); in fsverity_get_hash_alg() 56 return alg; in fsverity_get_hash_alg() 61 tfm = crypto_alloc_ahash(alg->name, 0, 0); in fsverity_get_hash_alg() 66 alg->name); in fsverity_get_hash_alg() 71 alg->name, PTR_ERR(tfm)); in fsverity_get_hash_alg() 76 if (WARN_ON(alg->digest_size != crypto_ahash_digestsize(tfm))) in fsverity_get_hash_alg() 78 if (WARN_ON(alg->block_size != crypto_ahash_blocksize(tfm))) in fsverity_get_hash_alg() 82 alg->name, crypto_ahash_driver_name(tfm)); in fsverity_get_hash_alg() [all …]
|
| /Linux-v5.4/drivers/crypto/bcm/ |
| D | cipher.c | 168 if (ctx->cipher.alg == CIPHER_ALG_RC4) in spu_ablkcipher_rx_sg_create() 329 cipher_parms.alg = ctx->cipher.alg; in handle_ablkcipher_req() 394 if (ctx->cipher.alg == CIPHER_ALG_RC4) { in handle_ablkcipher_req() 446 0, ctx->auth.alg, ctx->auth.mode, in handle_ablkcipher_req() 530 if (ctx->cipher.alg == CIPHER_ALG_RC4) in handle_ablkcipher_resp() 538 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_ablkcipher_resp() 740 hash_parms.alg = ctx->auth.alg; in handle_ahash_req() 809 if (hash_parms.alg == HASH_ALG_AES) in handle_ahash_req() 814 digestsize = spu->spu_digest_size(ctx->digestsize, ctx->auth.alg, in handle_ahash_req() 824 hash_parms.pad_len = spu->spu_hash_pad_len(hash_parms.alg, in handle_ahash_req() [all …]
|