/Linux-v4.19/crypto/ |
D | api.c | 38 static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg); 40 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) in crypto_mod_get() argument 42 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get() 46 void crypto_mod_put(struct crypto_alg *alg) in crypto_mod_put() argument 48 struct module *module = alg->cra_module; in crypto_mod_put() 50 crypto_alg_put(alg); in crypto_mod_put() 57 return larval->alg.cra_driver_name[0]; in crypto_is_test_larval() 63 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local 89 if (alg) in __crypto_alg_lookup() 90 crypto_mod_put(alg); in __crypto_alg_lookup() [all …]
|
D | algapi.c | 29 static inline int crypto_set_driver_name(struct crypto_alg *alg) in crypto_set_driver_name() argument 32 char *driver_name = alg->cra_driver_name; in crypto_set_driver_name() 38 len = strlcpy(driver_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in crypto_set_driver_name() 53 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument 55 crypto_check_module_sig(alg->cra_module); in crypto_check_alg() 57 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 60 if (alg->cra_blocksize > PAGE_SIZE / 8) in crypto_check_alg() 63 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 65 if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK) in crypto_check_alg() 68 if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE) in crypto_check_alg() [all …]
|
D | internal.h | 39 struct crypto_alg alg; member 59 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument 61 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 64 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument 66 return alg->cra_ctxsize; in crypto_compress_ctxsize() 69 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 76 void crypto_larval_kill(struct crypto_alg *alg); 79 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, 82 void crypto_shoot_alg(struct crypto_alg *alg); 83 struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, [all …]
|
D | crypto_user.c | 51 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local 73 alg = q; in crypto_alg_match() 79 return alg; in crypto_alg_match() 82 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument 88 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher() 89 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher() 90 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher() 101 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument 115 static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_acomp() argument 130 static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_akcipher() argument [all …]
|
D | aead.c | 93 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local 95 alg->exit(aead); in crypto_aead_exit_tfm() 101 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local 105 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() 107 if (alg->exit) in crypto_aead_init_tfm() 110 if (alg->init) in crypto_aead_init_tfm() 111 return alg->init(aead); in crypto_aead_init_tfm() 117 static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_aead_report() argument 120 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_report() 125 raead.blocksize = alg->cra_blocksize; in crypto_aead_report() [all …]
|
D | ctr.c | 184 struct crypto_alg *alg; in crypto_ctr_alloc() local 200 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, mask); in crypto_ctr_alloc() 201 if (IS_ERR(alg)) in crypto_ctr_alloc() 202 return ERR_CAST(alg); in crypto_ctr_alloc() 206 if (alg->cra_blocksize < 4) in crypto_ctr_alloc() 210 if (alg->cra_blocksize % 4) in crypto_ctr_alloc() 213 inst = crypto_alloc_instance("ctr", alg); in crypto_ctr_alloc() 217 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ctr_alloc() 218 inst->alg.cra_priority = alg->cra_priority; in crypto_ctr_alloc() 219 inst->alg.cra_blocksize = 1; in crypto_ctr_alloc() [all …]
|
D | proc.c | 43 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); in c_show() local 45 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 46 seq_printf(m, "driver : %s\n", alg->cra_driver_name); in c_show() 47 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); in c_show() 48 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 49 seq_printf(m, "refcnt : %u\n", refcount_read(&alg->cra_refcnt)); in c_show() 51 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 54 (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? in c_show() 57 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 59 seq_printf(m, "flags : 0x%x\n", alg->cra_flags); in c_show() [all …]
|
D | cbc.c | 114 struct crypto_alg *alg; in crypto_cbc_create() local 135 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, mask); in crypto_cbc_create() 136 err = PTR_ERR(alg); in crypto_cbc_create() 137 if (IS_ERR(alg)) in crypto_cbc_create() 141 err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), in crypto_cbc_create() 143 crypto_mod_put(alg); in crypto_cbc_create() 147 err = crypto_inst_setname(skcipher_crypto_instance(inst), "cbc", alg); in crypto_cbc_create() 152 if (!is_power_of_2(alg->cra_blocksize)) in crypto_cbc_create() 155 inst->alg.base.cra_priority = alg->cra_priority; in crypto_cbc_create() 156 inst->alg.base.cra_blocksize = alg->cra_blocksize; in crypto_cbc_create() [all …]
|
D | kpp.c | 29 static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 44 static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 50 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg) 53 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_kpp_show() argument 61 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_exit_tfm() local 63 alg->exit(kpp); in crypto_kpp_exit_tfm() 69 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_init_tfm() local 71 if (alg->exit) in crypto_kpp_init_tfm() 74 if (alg->init) in crypto_kpp_init_tfm() 75 return alg->init(kpp); in crypto_kpp_init_tfm() [all …]
|
D | ecb.c | 121 struct crypto_alg *alg; in crypto_ecb_alloc() local 128 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_ecb_alloc() 130 if (IS_ERR(alg)) in crypto_ecb_alloc() 131 return ERR_CAST(alg); in crypto_ecb_alloc() 133 inst = crypto_alloc_instance("ecb", alg); in crypto_ecb_alloc() 137 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ecb_alloc() 138 inst->alg.cra_priority = alg->cra_priority; in crypto_ecb_alloc() 139 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_ecb_alloc() 140 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_ecb_alloc() 141 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_ecb_alloc() [all …]
|
D | akcipher.c | 29 static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_akcipher_report() argument 44 static int crypto_akcipher_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_akcipher_report() argument 50 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg) 53 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_akcipher_show() argument 61 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_exit_tfm() local 63 alg->exit(akcipher); in crypto_akcipher_exit_tfm() 69 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_init_tfm() local 71 if (alg->exit) in crypto_akcipher_init_tfm() 74 if (alg->init) in crypto_akcipher_init_tfm() 75 return alg->init(akcipher); in crypto_akcipher_init_tfm() [all …]
|
D | acompress.c | 32 static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument 47 static int crypto_acomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument 53 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg) 56 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_acomp_show() argument 64 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_exit_tfm() local 66 alg->exit(acomp); in crypto_acomp_exit_tfm() 72 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_init_tfm() local 77 acomp->compress = alg->compress; in crypto_acomp_init_tfm() 78 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm() 79 acomp->dst_free = alg->dst_free; in crypto_acomp_init_tfm() [all …]
|
D | simd.c | 36 struct skcipher_alg alg; member 113 struct skcipher_alg *alg; in simd_skcipher_init() local 116 alg = crypto_skcipher_alg(tfm); in simd_skcipher_init() 117 salg = container_of(alg, struct simd_skcipher_alg, alg); in simd_skcipher_init() 142 struct skcipher_alg *alg; in simd_skcipher_create_compat() local 159 alg = &salg->alg; in simd_skcipher_create_compat() 162 if (snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", algname) >= in simd_skcipher_create_compat() 166 if (snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in simd_skcipher_create_compat() 170 alg->base.cra_flags = CRYPTO_ALG_ASYNC; in simd_skcipher_create_compat() 171 alg->base.cra_priority = ialg->base.cra_priority; in simd_skcipher_create_compat() [all …]
|
D | xcbc.c | 201 struct crypto_alg *alg; in xcbc_create() local 209 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in xcbc_create() 211 if (IS_ERR(alg)) in xcbc_create() 212 return PTR_ERR(alg); in xcbc_create() 214 switch(alg->cra_blocksize) { in xcbc_create() 221 inst = shash_alloc_instance("xcbc", alg); in xcbc_create() 226 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create() 232 alignmask = alg->cra_alignmask | 3; in xcbc_create() 233 inst->alg.base.cra_alignmask = alignmask; in xcbc_create() 234 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() [all …]
|
D | ahash.c | 453 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local 460 hash->init = alg->init; in crypto_ahash_init_tfm() 461 hash->update = alg->update; in crypto_ahash_init_tfm() 462 hash->final = alg->final; in crypto_ahash_init_tfm() 463 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm() 464 hash->digest = alg->digest; in crypto_ahash_init_tfm() 465 hash->export = alg->export; in crypto_ahash_init_tfm() 466 hash->import = alg->import; in crypto_ahash_init_tfm() 468 if (alg->setkey) { in crypto_ahash_init_tfm() 469 hash->setkey = alg->setkey; in crypto_ahash_init_tfm() [all …]
|
D | keywrap.c | 314 struct crypto_alg *alg = NULL; in crypto_kw_alloc() local 321 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_kw_alloc() 323 if (IS_ERR(alg)) in crypto_kw_alloc() 324 return ERR_CAST(alg); in crypto_kw_alloc() 328 if (alg->cra_blocksize != sizeof(struct crypto_kw_block)) in crypto_kw_alloc() 331 inst = crypto_alloc_instance("kw", alg); in crypto_kw_alloc() 335 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_kw_alloc() 336 inst->alg.cra_priority = alg->cra_priority; in crypto_kw_alloc() 337 inst->alg.cra_blocksize = SEMIBSIZE; in crypto_kw_alloc() 338 inst->alg.cra_alignmask = 0; in crypto_kw_alloc() [all …]
|
D | hmac.c | 185 struct crypto_alg *alg; in hmac_create() local 198 alg = &salg->base; in hmac_create() 207 if (ds > alg->cra_blocksize || in hmac_create() 208 ss < alg->cra_blocksize) in hmac_create() 211 inst = shash_alloc_instance("hmac", alg); in hmac_create() 221 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 222 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 223 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 225 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create() 226 inst->alg.digestsize = ds; in hmac_create() [all …]
|
D | testmgr.c | 47 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument 124 const char *alg; member 1871 "unkeyed ones must come first\n", desc->alg); in alg_test_hash() 2050 const char *alg) in do_test_kpp() argument 2091 alg, err); in do_test_kpp() 2108 alg); in do_test_kpp() 2131 alg, err); in do_test_kpp() 2163 alg, err); in do_test_kpp() 2179 alg); in do_test_kpp() 2194 static int test_kpp(struct crypto_kpp *tfm, const char *alg, in test_kpp() argument [all …]
|
D | cmac.c | 230 struct crypto_alg *alg; in cmac_create() local 238 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in cmac_create() 240 if (IS_ERR(alg)) in cmac_create() 241 return PTR_ERR(alg); in cmac_create() 243 switch (alg->cra_blocksize) { in cmac_create() 252 inst = shash_alloc_instance("cmac", alg); in cmac_create() 257 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in cmac_create() 263 alignmask = alg->cra_alignmask; in cmac_create() 264 inst->alg.base.cra_alignmask = alignmask; in cmac_create() 265 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create() [all …]
|
D | cryptd.c | 343 struct crypto_alg *alg) in cryptd_init_instance() argument 345 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 347 alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_init_instance() 350 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance() 352 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance() 353 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance() 354 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance() 359 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, in cryptd_alloc_instance() argument 372 err = cryptd_init_instance(inst, alg); in cryptd_alloc_instance() 391 struct crypto_alg *alg; in cryptd_create_blkcipher() local [all …]
|
D | pcbc.c | 221 struct crypto_alg *alg; in crypto_pcbc_create() local 236 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER | in crypto_pcbc_create() 240 err = PTR_ERR(alg); in crypto_pcbc_create() 241 if (IS_ERR(alg)) in crypto_pcbc_create() 245 err = crypto_init_spawn(spawn, alg, skcipher_crypto_instance(inst), in crypto_pcbc_create() 247 crypto_mod_put(alg); in crypto_pcbc_create() 251 err = crypto_inst_setname(skcipher_crypto_instance(inst), "pcbc", alg); in crypto_pcbc_create() 255 inst->alg.base.cra_flags = alg->cra_flags & CRYPTO_ALG_INTERNAL; in crypto_pcbc_create() 256 inst->alg.base.cra_priority = alg->cra_priority; in crypto_pcbc_create() 257 inst->alg.base.cra_blocksize = alg->cra_blocksize; in crypto_pcbc_create() [all …]
|
D | shash.c | 349 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local 376 if (alg->export) in crypto_init_shash_ops_async() 378 if (alg->import) in crypto_init_shash_ops_async() 389 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local 391 hash->descsize = alg->descsize; in crypto_shash_init_tfm() 393 if (crypto_shash_alg_has_setkey(alg) && in crypto_shash_init_tfm() 394 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in crypto_shash_init_tfm() 401 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument 404 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_report() 408 rhash.blocksize = alg->cra_blocksize; in crypto_shash_report() [all …]
|
/Linux-v4.19/include/crypto/internal/ |
D | hash.h | 38 struct ahash_alg alg; member 42 struct shash_alg alg; member 77 int crypto_register_ahash(struct ahash_alg *alg); 78 int crypto_unregister_ahash(struct ahash_alg *alg); 88 static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg) in crypto_shash_alg_has_setkey() argument 90 return alg->setkey != shash_no_setkey; in crypto_shash_alg_has_setkey() 96 struct hash_alg_common *alg, 106 int crypto_register_shash(struct shash_alg *alg); 107 int crypto_unregister_shash(struct shash_alg *alg); 115 struct shash_alg *alg, [all …]
|
D | skcipher.h | 31 struct skcipher_alg alg; member 85 struct skcipher_instance, alg); in skcipher_alg_instance() 115 return container_of(spawn->base.alg, struct skcipher_alg, base); in crypto_skcipher_spawn_alg() 136 int crypto_register_skcipher(struct skcipher_alg *alg); 137 void crypto_unregister_skcipher(struct skcipher_alg *alg); 185 struct skcipher_alg *alg) in crypto_skcipher_alg_min_keysize() argument 187 if ((alg->base.cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_skcipher_alg_min_keysize() 189 return alg->base.cra_blkcipher.min_keysize; in crypto_skcipher_alg_min_keysize() 191 if (alg->base.cra_ablkcipher.encrypt) in crypto_skcipher_alg_min_keysize() 192 return alg->base.cra_ablkcipher.min_keysize; in crypto_skcipher_alg_min_keysize() [all …]
|
/Linux-v4.19/arch/x86/crypto/ |
D | fpu.c | 119 struct skcipher_alg *alg; in crypto_fpu_create() local 150 alg = crypto_skcipher_spawn_alg(spawn); in crypto_fpu_create() 153 &alg->base); in crypto_fpu_create() 157 inst->alg.base.cra_flags = CRYPTO_ALG_INTERNAL; in crypto_fpu_create() 158 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_fpu_create() 159 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in crypto_fpu_create() 160 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_fpu_create() 162 inst->alg.ivsize = crypto_skcipher_alg_ivsize(alg); in crypto_fpu_create() 163 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg); in crypto_fpu_create() 164 inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(alg); in crypto_fpu_create() [all …]
|