/crypto/ |
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 | 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 | 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 struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, 73 void *crypto_create_tfm(struct crypto_alg *alg, [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 | 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 | 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 | 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 | 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 | 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 | 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 | 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_has_setkey(alg) && in shash_set_needkey() 66 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in shash_set_needkey() 365 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local 387 if (crypto_shash_alg_has_setkey(alg)) in crypto_init_shash_ops_async() 404 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local 406 hash->descsize = alg->descsize; in crypto_shash_init_tfm() 408 shash_set_needkey(hash, alg); in crypto_shash_init_tfm() [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 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 | 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 | 207 struct crypto_alg *alg) in cryptd_init_instance() argument 209 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance() 211 alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_init_instance() 214 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance() 216 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance() 217 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance() 218 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance() 223 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, in cryptd_alloc_instance() argument 236 err = cryptd_init_instance(inst, alg); in cryptd_alloc_instance() 401 struct skcipher_alg *alg; in cryptd_create_skcipher() local [all …]
|
D | lrw.c | 303 struct skcipher_alg *alg; in create() local 343 alg = crypto_skcipher_spawn_alg(spawn); in create() 346 if (alg->base.cra_blocksize != LRW_BLOCK_SIZE) in create() 349 if (crypto_skcipher_alg_ivsize(alg)) in create() 353 &alg->base); in create() 358 cipher_name = alg->base.cra_name; in create() 375 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in create() 383 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in create() 384 inst->alg.base.cra_priority = alg->base.cra_priority; in create() 385 inst->alg.base.cra_blocksize = LRW_BLOCK_SIZE; in create() [all …]
|
D | algboss.c | 36 } alg; member 53 char alg[CRYPTO_MAX_ALG_NAME]; member 85 crypto_alg_put(¶m->larval->alg); in cryptomgr_probe() 94 const char *name = larval->alg.cra_name; in cryptomgr_schedule_probe() 145 param->attrs[i].alg.attr.rta_len = in cryptomgr_schedule_probe() 146 sizeof(param->attrs[i].alg); in cryptomgr_schedule_probe() 147 param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; in cryptomgr_schedule_probe() 148 memcpy(param->attrs[i].alg.data.name, name, len); in cryptomgr_schedule_probe() 177 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; in cryptomgr_schedule_probe() 181 param->otype = larval->alg.cra_flags; in cryptomgr_schedule_probe() [all …]
|
D | testmgr.c | 62 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument 125 const char *alg; member 1816 "unkeyed ones must come first\n", desc->alg); in alg_test_hash() 3474 const char *alg) in do_test_kpp() argument 3515 alg, err); in do_test_kpp() 3531 alg); in do_test_kpp() 3553 alg, err); in do_test_kpp() 3584 alg, err); in do_test_kpp() 3600 alg); in do_test_kpp() 3615 static int test_kpp(struct crypto_kpp *tfm, const char *alg, in test_kpp() argument [all …]
|
D | cts.c | 333 struct skcipher_alg *alg; in crypto_cts_create() local 361 alg = crypto_spawn_skcipher_alg(spawn); in crypto_cts_create() 364 if (crypto_skcipher_alg_ivsize(alg) != alg->base.cra_blocksize) in crypto_cts_create() 367 if (strncmp(alg->base.cra_name, "cbc(", 4)) in crypto_cts_create() 371 &alg->base); in crypto_cts_create() 375 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in crypto_cts_create() 376 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_cts_create() 377 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in crypto_cts_create() 378 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_cts_create() 380 inst->alg.ivsize = alg->base.cra_blocksize; in crypto_cts_create() [all …]
|
D | pcrypt.c | 222 struct crypto_alg *alg) in pcrypt_init_instance() argument 224 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance() 225 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_init_instance() 228 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance() 230 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance() 231 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance() 232 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance() 243 struct aead_alg *alg; in pcrypt_create_aead() local 276 alg = crypto_spawn_aead_alg(&ctx->spawn); in pcrypt_create_aead() 277 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead() [all …]
|