/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 | aead.c | 82 static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type, in crypto_aead_ctxsize() argument 85 return alg->cra_ctxsize; in crypto_aead_ctxsize() 95 struct aead_alg *alg = &tfm->__crt_alg->cra_aead; in crypto_init_aead_ops() local 98 if (max(alg->maxauthsize, alg->ivsize) > PAGE_SIZE / 8) in crypto_init_aead_ops() 102 alg->setkey : setkey; in crypto_init_aead_ops() 103 crt->encrypt = alg->encrypt; in crypto_init_aead_ops() 104 crt->decrypt = alg->decrypt; in crypto_init_aead_ops() 105 crt->givencrypt = alg->givencrypt ?: no_givcrypt; in crypto_init_aead_ops() 106 crt->givdecrypt = alg->givdecrypt ?: no_givcrypt; in crypto_init_aead_ops() 108 crt->ivsize = alg->ivsize; in crypto_init_aead_ops() [all …]
|
D | algapi.c | 27 static inline int crypto_set_driver_name(struct crypto_alg *alg) in crypto_set_driver_name() argument 30 char *driver_name = alg->cra_driver_name; in crypto_set_driver_name() 36 len = strlcpy(driver_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in crypto_set_driver_name() 54 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument 56 crypto_check_module_sig(alg->cra_module); in crypto_check_alg() 58 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 61 if (alg->cra_blocksize > PAGE_SIZE / 8) in crypto_check_alg() 64 if (alg->cra_priority < 0) in crypto_check_alg() 67 return crypto_set_driver_name(alg); in crypto_check_alg() 70 static void crypto_destroy_instance(struct crypto_alg *alg) in crypto_destroy_instance() argument [all …]
|
D | crypto_user.c | 49 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local 66 alg = q; in crypto_alg_match() 73 return alg; in crypto_alg_match() 76 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument 82 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher() 83 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher() 84 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher() 95 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument 109 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument 112 strncpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one() [all …]
|
D | ablkcipher.c | 344 static unsigned int crypto_ablkcipher_ctxsize(struct crypto_alg *alg, u32 type, in crypto_ablkcipher_ctxsize() argument 347 return alg->cra_ctxsize; in crypto_ablkcipher_ctxsize() 363 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in crypto_init_ablkcipher_ops() local 366 if (alg->ivsize > PAGE_SIZE / 8) in crypto_init_ablkcipher_ops() 370 crt->encrypt = alg->encrypt; in crypto_init_ablkcipher_ops() 371 crt->decrypt = alg->decrypt; in crypto_init_ablkcipher_ops() 372 if (!alg->ivsize) { in crypto_init_ablkcipher_ops() 377 crt->ivsize = alg->ivsize; in crypto_init_ablkcipher_ops() 383 static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ablkcipher_report() argument 388 strncpy(rblkcipher.geniv, alg->cra_ablkcipher.geniv ?: "<default>", in crypto_ablkcipher_report() [all …]
|
D | internal.h | 43 struct crypto_alg alg; member 63 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument 65 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 68 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument 70 return alg->cra_ctxsize; in crypto_compress_ctxsize() 73 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 84 void crypto_larval_kill(struct crypto_alg *alg); 88 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, 91 void crypto_shoot_alg(struct crypto_alg *alg); 92 struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, [all …]
|
D | ctr.c | 184 struct crypto_alg *alg; in crypto_ctr_alloc() local 191 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, in crypto_ctr_alloc() 193 if (IS_ERR(alg)) in crypto_ctr_alloc() 194 return ERR_CAST(alg); in crypto_ctr_alloc() 198 if (alg->cra_blocksize < 4) in crypto_ctr_alloc() 202 if (alg->cra_blocksize % 4) in crypto_ctr_alloc() 205 inst = crypto_alloc_instance("ctr", alg); in crypto_ctr_alloc() 209 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ctr_alloc() 210 inst->alg.cra_priority = alg->cra_priority; in crypto_ctr_alloc() 211 inst->alg.cra_blocksize = 1; in crypto_ctr_alloc() [all …]
|
D | blkcipher.c | 422 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_encrypt() local 430 return alg->encrypt(&desc, req->dst, req->src, req->nbytes); in async_encrypt() 436 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_decrypt() local 443 return alg->decrypt(&desc, req->dst, req->src, req->nbytes); in async_decrypt() 446 static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg, u32 type, in crypto_blkcipher_ctxsize() argument 449 struct blkcipher_alg *cipher = &alg->cra_blkcipher; in crypto_blkcipher_ctxsize() 450 unsigned int len = alg->cra_ctxsize; in crypto_blkcipher_ctxsize() 454 len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1); in crypto_blkcipher_ctxsize() 464 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_async() local 469 if (!alg->ivsize) { in crypto_init_blkcipher_ops_async() [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 | cryptd.c | 284 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, in cryptd_alloc_instance() argument 298 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_alloc_instance() 299 "cryptd(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_alloc_instance() 302 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_alloc_instance() 304 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_alloc_instance() 305 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_alloc_instance() 306 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_alloc_instance() 323 struct crypto_alg *alg; in cryptd_create_blkcipher() local 326 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER, in cryptd_create_blkcipher() 328 if (IS_ERR(alg)) in cryptd_create_blkcipher() [all …]
|
D | proc.c | 82 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); in c_show() local 84 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 85 seq_printf(m, "driver : %s\n", alg->cra_driver_name); in c_show() 86 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); in c_show() 87 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 88 seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); in c_show() 90 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 93 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 95 seq_printf(m, "flags : 0x%x\n", alg->cra_flags); in c_show() 99 if (alg->cra_type && alg->cra_type->show) { in c_show() [all …]
|
D | xcbc.c | 202 struct crypto_alg *alg; in xcbc_create() local 210 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in xcbc_create() 212 if (IS_ERR(alg)) in xcbc_create() 213 return PTR_ERR(alg); in xcbc_create() 215 switch(alg->cra_blocksize) { in xcbc_create() 222 inst = shash_alloc_instance("xcbc", alg); in xcbc_create() 227 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create() 233 alignmask = alg->cra_alignmask | 3; in xcbc_create() 234 inst->alg.base.cra_alignmask = alignmask; in xcbc_create() 235 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() [all …]
|
D | cmac.c | 228 struct crypto_alg *alg; in cmac_create() local 236 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in cmac_create() 238 if (IS_ERR(alg)) in cmac_create() 239 return PTR_ERR(alg); in cmac_create() 241 switch (alg->cra_blocksize) { in cmac_create() 249 inst = shash_alloc_instance("cmac", alg); in cmac_create() 254 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in cmac_create() 260 alignmask = alg->cra_alignmask | (sizeof(long) - 1); 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() [all …]
|
D | testmgr.c | 37 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument 118 const char *alg; member 1831 .alg = "__cbc-cast5-avx", 1834 .alg = "__cbc-cast6-avx", 1837 .alg = "__cbc-serpent-avx", 1840 .alg = "__cbc-serpent-avx2", 1843 .alg = "__cbc-serpent-sse2", 1846 .alg = "__cbc-twofish-avx", 1849 .alg = "__driver-cbc-aes-aesni", 1853 .alg = "__driver-cbc-camellia-aesni", [all …]
|
D | cbc.c | 217 struct crypto_alg *alg; in crypto_cbc_alloc() local 224 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_cbc_alloc() 226 if (IS_ERR(alg)) in crypto_cbc_alloc() 227 return ERR_CAST(alg); in crypto_cbc_alloc() 230 if (!is_power_of_2(alg->cra_blocksize)) in crypto_cbc_alloc() 233 inst = crypto_alloc_instance("cbc", alg); in crypto_cbc_alloc() 237 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_cbc_alloc() 238 inst->alg.cra_priority = alg->cra_priority; in crypto_cbc_alloc() 239 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_cbc_alloc() 240 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_cbc_alloc() [all …]
|
D | lrw.c | 329 struct crypto_alg *alg; in alloc() local 336 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in alloc() 338 if (IS_ERR(alg)) in alloc() 339 return ERR_CAST(alg); in alloc() 341 inst = crypto_alloc_instance("lrw", alg); in alloc() 345 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc() 346 inst->alg.cra_priority = alg->cra_priority; in alloc() 347 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc() 349 if (alg->cra_alignmask < 7) inst->alg.cra_alignmask = 7; in alloc() 350 else inst->alg.cra_alignmask = alg->cra_alignmask; in alloc() [all …]
|
D | algboss.c | 41 } alg; member 58 char alg[CRYPTO_MAX_ALG_NAME]; member 90 crypto_alg_put(¶m->larval->alg); in cryptomgr_probe() 99 const char *name = larval->alg.cra_name; in cryptomgr_schedule_probe() 151 param->attrs[i].alg.attr.rta_len = in cryptomgr_schedule_probe() 152 sizeof(param->attrs[i].alg); in cryptomgr_schedule_probe() 153 param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; in cryptomgr_schedule_probe() 154 memcpy(param->attrs[i].alg.data.name, name, len); in cryptomgr_schedule_probe() 183 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; in cryptomgr_schedule_probe() 187 param->otype = larval->alg.cra_flags; in cryptomgr_schedule_probe() [all …]
|
D | hmac.c | 184 struct crypto_alg *alg; in hmac_create() local 197 alg = &salg->base; in hmac_create() 206 if (ds > alg->cra_blocksize || in hmac_create() 207 ss < alg->cra_blocksize) in hmac_create() 210 inst = shash_alloc_instance("hmac", alg); in hmac_create() 220 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 221 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 222 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 224 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create() 225 inst->alg.digestsize = ds; in hmac_create() [all …]
|
D | pcbc.c | 227 struct crypto_alg *alg; in crypto_pcbc_alloc() local 234 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_pcbc_alloc() 236 if (IS_ERR(alg)) in crypto_pcbc_alloc() 237 return ERR_CAST(alg); in crypto_pcbc_alloc() 239 inst = crypto_alloc_instance("pcbc", alg); in crypto_pcbc_alloc() 243 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_pcbc_alloc() 244 inst->alg.cra_priority = alg->cra_priority; in crypto_pcbc_alloc() 245 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_pcbc_alloc() 246 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_pcbc_alloc() 247 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_pcbc_alloc() [all …]
|
D | cts.c | 277 struct crypto_alg *alg; in crypto_cts_alloc() local 284 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, in crypto_cts_alloc() 286 if (IS_ERR(alg)) in crypto_cts_alloc() 287 return ERR_CAST(alg); in crypto_cts_alloc() 290 if (!is_power_of_2(alg->cra_blocksize)) in crypto_cts_alloc() 293 inst = crypto_alloc_instance("cts", alg); in crypto_cts_alloc() 297 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_cts_alloc() 298 inst->alg.cra_priority = alg->cra_priority; in crypto_cts_alloc() 299 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_cts_alloc() 300 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_cts_alloc() [all …]
|
D | ahash.c | 472 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local 482 hash->init = alg->init; in crypto_ahash_init_tfm() 483 hash->update = alg->update; in crypto_ahash_init_tfm() 484 hash->final = alg->final; in crypto_ahash_init_tfm() 485 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm() 486 hash->digest = alg->digest; in crypto_ahash_init_tfm() 488 if (alg->setkey) { in crypto_ahash_init_tfm() 489 hash->setkey = alg->setkey; in crypto_ahash_init_tfm() 492 if (alg->export) in crypto_ahash_init_tfm() 493 hash->export = alg->export; in crypto_ahash_init_tfm() [all …]
|
D | xts.c | 290 struct crypto_alg *alg; in alloc() local 297 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in alloc() 299 if (IS_ERR(alg)) in alloc() 300 return ERR_CAST(alg); in alloc() 302 inst = crypto_alloc_instance("xts", alg); in alloc() 306 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc() 307 inst->alg.cra_priority = alg->cra_priority; in alloc() 308 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc() 310 if (alg->cra_alignmask < 7) in alloc() 311 inst->alg.cra_alignmask = 7; in alloc() [all …]
|
D | shash.c | 338 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local 362 crt->has_setkey = alg->setkey != shash_no_setkey; in crypto_init_shash_ops_async() 364 if (alg->export) in crypto_init_shash_ops_async() 366 if (alg->import) in crypto_init_shash_ops_async() 462 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_compat() local 493 crt->digestsize = alg->digestsize; in crypto_init_shash_ops_compat() 508 static unsigned int crypto_shash_ctxsize(struct crypto_alg *alg, u32 type, in crypto_shash_ctxsize() argument 527 static unsigned int crypto_shash_extsize(struct crypto_alg *alg) in crypto_shash_extsize() argument 529 return alg->cra_ctxsize; in crypto_shash_extsize() 533 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument [all …]
|
D | pcrypt.c | 309 static struct crypto_instance *pcrypt_alloc_instance(struct crypto_alg *alg) in pcrypt_alloc_instance() argument 322 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_alloc_instance() 323 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_alloc_instance() 326 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_alloc_instance() 329 err = crypto_init_spawn(&ctx->spawn, alg, inst, in pcrypt_alloc_instance() 334 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_alloc_instance() 335 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_alloc_instance() 336 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_alloc_instance() 351 struct crypto_alg *alg; in pcrypt_alloc_aead() local 353 alg = crypto_get_attr_alg(tb, type, (mask & CRYPTO_ALG_TYPE_MASK)); in pcrypt_alloc_aead() [all …]
|
D | pcompress.c | 41 static unsigned int crypto_pcomp_extsize(struct crypto_alg *alg) in crypto_pcomp_extsize() argument 43 return alg->cra_ctxsize; in crypto_pcomp_extsize() 52 static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_pcomp_report() argument 66 static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_pcomp_report() argument 72 static void crypto_pcomp_show(struct seq_file *m, struct crypto_alg *alg) 74 static void crypto_pcomp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_pcomp_show() argument 100 int crypto_register_pcomp(struct pcomp_alg *alg) in crypto_register_pcomp() argument 102 struct crypto_alg *base = &alg->base; in crypto_register_pcomp() 112 int crypto_unregister_pcomp(struct pcomp_alg *alg) in crypto_unregister_pcomp() argument 114 return crypto_unregister_alg(&alg->base); in crypto_unregister_pcomp()
|