/crypto/ |
H A D | api.c | 37 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) argument 39 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; 43 void crypto_mod_put(struct crypto_alg *alg) argument 45 struct module *module = alg->cra_module; 47 crypto_alg_put(alg); 54 return larval->alg.cra_driver_name[0]; 60 struct crypto_alg *q, *alg = NULL; local 86 if (alg) 87 crypto_mod_put(alg); 97 crypto_larval_destroy(struct crypto_alg *alg) argument 130 struct crypto_alg *alg; local 153 crypto_larval_kill(struct crypto_alg *alg) argument 165 crypto_larval_wait(struct crypto_alg *alg) argument 192 struct crypto_alg *alg; local 204 struct crypto_alg *alg; local 246 struct crypto_alg *alg; local 318 crypto_ctxsize(struct crypto_alg *alg, u32 type, u32 mask) argument 343 crypto_shoot_alg(struct crypto_alg *alg) argument 351 __crypto_alloc_tfm(struct crypto_alg *alg, u32 type, u32 mask) argument 415 struct crypto_alg *alg; local 443 crypto_create_tfm(struct crypto_alg *alg, const struct crypto_type *frontend) argument 532 struct crypto_alg *alg; local 570 struct crypto_alg *alg; local 588 struct crypto_alg *alg = crypto_alg_mod_lookup(name, type, mask); local [all...] |
H A D | aead.c | 82 static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type, argument 85 return alg->cra_ctxsize; 95 struct aead_alg *alg = &tfm->__crt_alg->cra_aead; local 98 if (max(alg->maxauthsize, alg->ivsize) > PAGE_SIZE / 8) 102 alg->setkey : setkey; 103 crt->encrypt = alg->encrypt; 104 crt->decrypt = alg->decrypt; 105 crt->givencrypt = alg->givencrypt ?: no_givcrypt; 106 crt->givdecrypt = alg 115 crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) argument 136 crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) argument 144 crypto_aead_show(struct seq_file *m, struct crypto_alg *alg) argument 179 struct aead_alg *alg = &tfm->__crt_alg->cra_aead; local 200 crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg) argument 221 crypto_nivaead_report(struct sk_buff *skb, struct crypto_alg *alg) argument 230 crypto_nivaead_show(struct seq_file *m, struct crypto_alg *alg) argument 256 struct crypto_alg *alg; local 280 struct crypto_alg *alg; local 396 crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask) argument 472 struct crypto_alg *alg; local 507 struct crypto_alg *alg; local 536 struct crypto_alg *alg; local [all...] |
H A D | internal.h | 43 struct crypto_alg alg; member in struct:crypto_larval 63 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) argument 65 return alg->cra_ctxsize; 68 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) argument 70 return alg->cra_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, u3 106 crypto_alg_get(struct crypto_alg *alg) argument 112 crypto_alg_put(struct crypto_alg *alg) argument 128 crypto_is_larval(struct crypto_alg *alg) argument 133 crypto_is_dead(struct crypto_alg *alg) argument 138 crypto_is_moribund(struct crypto_alg *alg) argument [all...] |
H A D | proc.c | 82 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); local 84 seq_printf(m, "name : %s\n", alg->cra_name); 85 seq_printf(m, "driver : %s\n", alg->cra_driver_name); 86 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); 87 seq_printf(m, "priority : %d\n", alg->cra_priority); 88 seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); 90 (alg->cra_flags & CRYPTO_ALG_TESTED) ? 93 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { 95 seq_printf(m, "flags : 0x%x\n", alg->cra_flags); 99 if (alg [all...] |
H A D | crypto_user.c | 49 struct crypto_alg *q, *alg = NULL; local 66 alg = q; 73 return alg; 76 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) argument 82 rcipher.blocksize = alg->cra_blocksize; 83 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; 84 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; 95 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) argument 109 static int crypto_report_one(struct crypto_alg *alg, argument 112 strncpy(ualg->cru_name, alg 162 crypto_report_alg(struct crypto_alg *alg, struct crypto_dump_info *info) argument 196 struct crypto_alg *alg; local 229 struct crypto_alg *alg; local 263 struct crypto_alg *alg; local 295 struct crypto_alg *alg; local 323 struct crypto_alg *alg; local 349 struct crypto_alg *alg; local 378 struct crypto_alg *alg; local 474 struct crypto_alg *alg; local [all...] |
H A D | algapi.c | 27 static inline int crypto_set_driver_name(struct crypto_alg *alg) argument 30 char *driver_name = alg->cra_driver_name; 36 len = strlcpy(driver_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); 44 static int crypto_check_alg(struct crypto_alg *alg) argument 46 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) 49 if (alg->cra_blocksize > PAGE_SIZE / 8) 52 if (alg->cra_priority < 0) 55 return crypto_set_driver_name(alg); 58 static void crypto_destroy_instance(struct crypto_alg *alg) argument 67 crypto_more_spawns(struct crypto_alg *alg, struct list_head *stack, struct list_head *top, struct list_head *secondary_spawns) argument 114 crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list, struct crypto_alg *nalg) argument 163 __crypto_register_alg(struct crypto_alg *alg) argument 229 struct crypto_alg *alg; local 307 struct crypto_alg *alg; local 335 crypto_register_alg(struct crypto_alg *alg) argument 356 crypto_remove_alg(struct crypto_alg *alg, struct list_head *list) argument 370 crypto_unregister_alg(struct crypto_alg *alg) argument 539 crypto_unregister_instance(struct crypto_alg *alg) argument 568 crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, struct crypto_instance *inst, u32 mask) argument 588 crypto_init_spawn2(struct crypto_spawn *spawn, struct crypto_alg *alg, struct crypto_instance *inst, const struct crypto_type *frontend) argument 618 struct crypto_alg *alg; local 640 struct crypto_alg *alg; local 665 struct crypto_alg *alg; local 779 crypto_alloc_instance2(const char *name, struct crypto_alg *alg, unsigned int head) argument 810 crypto_alloc_instance(const char *name, struct crypto_alg *alg) argument [all...] |
H A D | ctr.c | 184 struct crypto_alg *alg; local 191 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, 193 if (IS_ERR(alg)) 194 return ERR_CAST(alg); 198 if (alg->cra_blocksize < 4) 202 if (alg->cra_blocksize % 4) 205 inst = crypto_alloc_instance("ctr", alg); 209 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 210 inst->alg.cra_priority = alg 340 struct crypto_alg *alg; local [all...] |
H A D | pcompress.c | 41 static unsigned int crypto_pcomp_extsize(struct crypto_alg *alg) argument 43 return alg->cra_ctxsize; 52 static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg) argument 66 static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg) 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) argument 100 int crypto_register_pcomp(struct pcomp_alg *alg) argument 102 struct crypto_alg *base = &alg->base; 112 int crypto_unregister_pcomp(struct pcomp_alg *alg) argument 114 return crypto_unregister_alg(&alg [all...] |
H A D | xcbc.c | 202 struct crypto_alg *alg; local 210 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 212 if (IS_ERR(alg)) 213 return PTR_ERR(alg); 215 switch(alg->cra_blocksize) { 222 inst = shash_alloc_instance("xcbc", alg); 227 err = crypto_init_spawn(shash_instance_ctx(inst), alg, 233 alignmask = alg->cra_alignmask | 3; 234 inst->alg.base.cra_alignmask = alignmask; 235 inst->alg [all...] |
H A D | algboss.c | 41 } alg; member in union:cryptomgr_param::__anon7 58 char alg[CRYPTO_MAX_ALG_NAME]; member in struct:crypto_test_param 90 crypto_alg_put(¶m->larval->alg); 99 const char *name = larval->alg.cra_name; 151 param->attrs[i].alg.attr.rta_len = 152 sizeof(param->attrs[i].alg); 153 param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; 154 memcpy(param->attrs[i].alg.data.name, name, len); 183 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; 187 param->otype = larval->alg 233 cryptomgr_schedule_test(struct crypto_alg *alg) argument [all...] |
H A D | ecb.c | 121 struct crypto_alg *alg; local 128 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 130 if (IS_ERR(alg)) 131 return ERR_CAST(alg); 133 inst = crypto_alloc_instance("ecb", alg); 137 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 138 inst->alg.cra_priority = alg->cra_priority; 139 inst->alg.cra_blocksize = alg [all...] |
H A D | rng.c | 54 struct rng_alg *alg = &tfm->__crt_alg->cra_rng; local 57 ops->rng_gen_random = alg->rng_make_random; 64 static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) argument 70 rrng.seedsize = alg->cra_rng.seedsize; 81 static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) argument 87 static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) 89 static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) argument 92 seq_printf(m, "seedsize : %u\n", alg->cra_rng.seedsize); 95 static unsigned int crypto_rng_ctxsize(struct crypto_alg *alg, u32 type, argument 98 return alg [all...] |
H A D | ablkcipher.c | 348 static unsigned int crypto_ablkcipher_ctxsize(struct crypto_alg *alg, u32 type, argument 351 return alg->cra_ctxsize; 367 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; local 370 if (alg->ivsize > PAGE_SIZE / 8) 374 crt->encrypt = alg->encrypt; 375 crt->decrypt = alg->decrypt; 376 if (!alg->ivsize) { 381 crt->ivsize = alg->ivsize; 387 static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 392 strncpy(rblkcipher.geniv, alg 409 crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 417 crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg) argument 449 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; local 468 crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 490 crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 498 crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg) argument 522 crypto_default_geniv(const struct crypto_alg *alg) argument 534 crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) argument 618 struct crypto_alg *alg; local 659 struct crypto_alg *alg; local 685 struct crypto_alg *alg; local [all...] |
H A D | cts.c | 276 struct crypto_alg *alg; local 283 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, 285 if (IS_ERR(alg)) 286 return ERR_CAST(alg); 289 if (!is_power_of_2(alg->cra_blocksize)) 292 inst = crypto_alloc_instance("cts", alg); 296 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 297 inst->alg.cra_priority = alg->cra_priority; 298 inst->alg [all...] |
H A D | cbc.c | 217 struct crypto_alg *alg; local 224 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 226 if (IS_ERR(alg)) 227 return ERR_CAST(alg); 230 if (!is_power_of_2(alg->cra_blocksize)) 233 inst = crypto_alloc_instance("cbc", alg); 237 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 238 inst->alg.cra_priority = alg->cra_priority; 239 inst->alg [all...] |
H A D | pcbc.c | 227 struct crypto_alg *alg; local 234 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 236 if (IS_ERR(alg)) 237 return ERR_CAST(alg); 239 inst = crypto_alloc_instance("pcbc", alg); 243 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 244 inst->alg.cra_priority = alg->cra_priority; 245 inst->alg.cra_blocksize = alg [all...] |
H A D | cryptd.c | 284 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, argument 298 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, 299 "cryptd(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) 302 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); 304 inst->alg.cra_priority = alg->cra_priority + 50; 305 inst->alg.cra_blocksize = alg->cra_blocksize; 306 inst->alg 323 struct crypto_alg *alg; local 579 struct crypto_alg *alg; local 721 struct crypto_alg *alg; local [all...] |
H A D | cmac.c | 228 struct crypto_alg *alg; local 236 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 238 if (IS_ERR(alg)) 239 return PTR_ERR(alg); 241 switch (alg->cra_blocksize) { 249 inst = shash_alloc_instance("cmac", alg); 254 err = crypto_init_spawn(shash_instance_ctx(inst), alg, 260 alignmask = alg->cra_alignmask | (sizeof(long) - 1); 261 inst->alg.base.cra_alignmask = alignmask; 262 inst->alg [all...] |
H A D | hmac.c | 187 struct crypto_alg *alg; local 204 alg = &salg->base; 205 if (ds > alg->cra_blocksize || 206 ss < alg->cra_blocksize) 209 inst = shash_alloc_instance("hmac", alg); 219 inst->alg.base.cra_priority = alg->cra_priority; 220 inst->alg.base.cra_blocksize = alg->cra_blocksize; 221 inst->alg [all...] |
H A D | blkcipher.c | 421 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; local 429 return alg->encrypt(&desc, req->dst, req->src, req->nbytes); 435 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; local 442 return alg->decrypt(&desc, req->dst, req->src, req->nbytes); 445 static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg, u32 type, argument 448 struct blkcipher_alg *cipher = &alg->cra_blkcipher; 449 unsigned int len = alg->cra_ctxsize; 453 len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1); 463 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; local 468 if (!alg 481 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; local 499 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; local 511 crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 533 crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) argument 541 crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg) argument 565 struct crypto_alg *alg; local 600 struct crypto_alg *alg; local [all...] |
H A D | lrw.c | 329 struct crypto_alg *alg; local 336 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 338 if (IS_ERR(alg)) 339 return ERR_CAST(alg); 341 inst = crypto_alloc_instance("lrw", alg); 345 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 346 inst->alg.cra_priority = alg->cra_priority; 347 inst->alg.cra_blocksize = alg [all...] |
H A D | ahash.c | 369 struct ahash_alg *alg = crypto_ahash_alg(hash); local 378 hash->init = alg->init; 379 hash->update = alg->update; 380 hash->final = alg->final; 381 hash->finup = alg->finup ?: ahash_def_finup; 382 hash->digest = alg->digest; 384 if (alg->setkey) 385 hash->setkey = alg->setkey; 386 if (alg->export) 387 hash->export = alg 394 crypto_ahash_extsize(struct crypto_alg *alg) argument 403 crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) argument 421 crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) argument 429 crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) argument 460 ahash_prepare_alg(struct ahash_alg *alg) argument 475 crypto_register_ahash(struct ahash_alg *alg) argument 488 crypto_unregister_ahash(struct ahash_alg *alg) argument 514 crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn, struct hash_alg_common *alg, struct crypto_instance *inst) argument 525 struct crypto_alg *alg; local [all...] |
H A D | xts.c | 290 struct crypto_alg *alg; local 297 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, 299 if (IS_ERR(alg)) 300 return ERR_CAST(alg); 302 inst = crypto_alloc_instance("xts", alg); 306 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; 307 inst->alg.cra_priority = alg->cra_priority; 308 inst->alg.cra_blocksize = alg [all...] |
H A D | testmgr.c | 36 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) argument 112 const char *alg; member in struct:alg_test_desc 115 int fips_allowed; /* set if alg is allowed in fips mode */ 207 printk(KERN_ERR "alg: hash: Failed to allocate request for " 232 printk(KERN_ERR "alg: hash: setkey failed on " 244 pr_err("alg: hash: digest failed on test %d " 274 printk(KERN_ERR "alg: hash: Test %d failed for %s\n", 310 printk(KERN_ERR "alg: hash: setkey " 334 printk(KERN_ERR "alg: hash: digest failed " 342 printk(KERN_ERR "alg 3071 alg_find_test(const char *alg) argument 3096 alg_test(const char *driver, const char *alg, u32 type, u32 mask) argument [all...] |
H A D | pcrypt.c | 309 static struct crypto_instance *pcrypt_alloc_instance(struct crypto_alg *alg) argument 322 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, 323 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) 326 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); 329 err = crypto_init_spawn(&ctx->spawn, alg, inst, 334 inst->alg.cra_priority = alg->cra_priority + 100; 335 inst->alg.cra_blocksize = alg 351 struct crypto_alg *alg; local [all...] |