/linux/crypto/ |
H A D | api.c | 82 if (alg) in __crypto_alg_lookup() 84 alg = q; in __crypto_alg_lookup() 90 return alg; in __crypto_alg_lookup() 140 alg = &larval->alg; in crypto_larval_add() 145 if (alg != &larval->alg) { in crypto_larval_add() 148 alg = crypto_larval_wait(alg); in crypto_larval_add() 225 alg = &larval->alg; in crypto_larval_wait() 241 if (!IS_ERR(alg) && crypto_is_larval(alg)) in crypto_larval_wait() 273 if (alg && !crypto_is_larval(alg)) { in crypto_alg_lookup() 306 if (!IS_ERR_OR_NULL(alg) && crypto_is_larval(alg)) in crypto_larval_lookup() [all …]
|
H A D | algapi.c | 42 if (!alg->cra_name[0] || !alg->cra_driver_name[0]) in crypto_check_alg() 45 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 56 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 92 alg); in crypto_destroy_instance() 195 BUG_ON(&inst->alg == alg); in crypto_remove_spawns() 286 memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, in crypto_alloc_test_larval() 288 larval->alg.cra_priority = alg->cra_priority; in crypto_alloc_test_larval() 471 alg->cra_destroy(alg); in crypto_unregister_alg() 705 spawn->alg = alg; in crypto_grab_spawn() 743 alg = spawn->alg; in crypto_spawn_alg() [all …]
|
H A D | internal.h | 31 struct crypto_alg alg; member 104 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 109 return alg->cra_ctxsize; in crypto_compress_ctxsize() 122 void crypto_shoot_alg(struct crypto_alg *alg); 165 refcount_inc(&alg->cra_refcnt); in crypto_alg_get() 166 return alg; in crypto_alg_get() 171 if (refcount_dec_and_test(&alg->cra_refcnt) && alg->cra_destroy) in crypto_alg_put() 172 alg->cra_destroy(alg); in crypto_alg_put() 187 return alg->cra_flags & CRYPTO_ALG_LARVAL; in crypto_is_larval() 192 return alg->cra_flags & CRYPTO_ALG_DEAD; in crypto_is_dead() [all …]
|
H A D | shash.c | 149 alg->exit_tfm(hash); in crypto_shash_exit_tfm() 162 if (alg->exit_tfm) in crypto_shash_init_tfm() 165 if (!alg->init_tfm) in crypto_shash_init_tfm() 174 if (alg->exit_tfm) in crypto_shash_init_tfm() 269 if (!alg->clone_tfm && (alg->init_tfm || alg->base.cra_init)) in crypto_clone_shash() 314 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg() 335 if (!alg->finup) in shash_prepare_alg() 337 if (!alg->digest) in shash_prepare_alg() 339 if (!alg->export) in shash_prepare_alg() 340 alg->halg.statesize = alg->descsize; in shash_prepare_alg() [all …]
|
H A D | crypto_user.c | 62 alg = q; in crypto_alg_match() 68 return alg; in crypto_alg_match() 126 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one() 127 if (alg->cra_type->report(skb, alg)) in crypto_report_one() 197 if (!alg) in crypto_report() 213 crypto_mod_put(alg); in crypto_report() 277 if (!alg) in crypto_update_alg() 289 crypto_mod_put(alg); in crypto_update_alg() 309 if (!alg) in crypto_del_alg() 355 if (alg) { in crypto_add_alg() [all …]
|
H A D | simd.c | 43 struct skcipher_alg alg; member 116 struct skcipher_alg *alg; in simd_skcipher_init() local 120 salg = container_of(alg, struct simd_skcipher_alg, alg); in simd_skcipher_init() 145 struct skcipher_alg *alg; in simd_skcipher_create_compat() local 155 alg = &salg->alg; in simd_skcipher_create_compat() 174 alg->ivsize = ialg->ivsize; in simd_skcipher_create_compat() 261 struct aead_alg alg; member 342 struct aead_alg *alg; in simd_aead_init() local 346 salg = container_of(alg, struct simd_aead_alg, alg); in simd_aead_init() 370 struct aead_alg *alg; in simd_aead_create_compat() local [all …]
|
H A D | proc.c | 41 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 44 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 47 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 50 (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? in c_show() 54 (alg->cra_flags & CRYPTO_ALG_FIPS_INTERNAL) ? in c_show() 58 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 64 if (alg->cra_type && alg->cra_type->show) { in c_show() 65 alg->cra_type->show(m, alg); in c_show() 69 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { in c_show() 74 alg->cra_cipher.cia_min_keysize); in c_show() [all …]
|
H A D | acompress.c | 61 alg->exit(acomp); in crypto_acomp_exit_tfm() 72 acomp->compress = alg->compress; in crypto_acomp_init_tfm() 73 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm() 74 acomp->dst_free = alg->dst_free; in crypto_acomp_init_tfm() 75 acomp->reqsize = alg->reqsize; in crypto_acomp_init_tfm() 77 if (alg->exit) in crypto_acomp_init_tfm() 80 if (alg->init) in crypto_acomp_init_tfm() 81 return alg->init(acomp); in crypto_acomp_init_tfm() 88 int extsize = crypto_alg_extsize(alg); in crypto_acomp_extsize() 167 comp_prepare_alg(&alg->calg); in crypto_register_acomp() [all …]
|
H A D | ctr.c | 130 struct crypto_alg *alg; in crypto_ctr_create() local 137 alg = skcipher_ialg_simple(inst); in crypto_ctr_create() 141 if (alg->cra_blocksize < 4) in crypto_ctr_create() 145 if (alg->cra_blocksize % 4) in crypto_ctr_create() 149 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create() 155 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 301 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc3686_create() 303 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc3686_create() 306 inst->alg.chunksize = alg->chunksize; in crypto_rfc3686_create() 307 inst->alg.min_keysize = alg->min_keysize + CTR_RFC3686_NONCE_SIZE; in crypto_rfc3686_create() [all …]
|
H A D | akcipher.c | 49 alg->exit(akcipher); in crypto_akcipher_exit_tfm() 57 if (alg->exit) in crypto_akcipher_init_tfm() 60 if (alg->init) in crypto_akcipher_init_tfm() 61 return alg->init(akcipher); in crypto_akcipher_init_tfm() 129 if (!alg->sign) in crypto_register_akcipher() 130 alg->sign = akcipher_default_op; in crypto_register_akcipher() 131 if (!alg->verify) in crypto_register_akcipher() 133 if (!alg->encrypt) in crypto_register_akcipher() 135 if (!alg->decrypt) in crypto_register_akcipher() 137 if (!alg->set_priv_key) in crypto_register_akcipher() [all …]
|
H A D | aead.c | 113 alg->exit(aead); in crypto_aead_exit_tfm() 123 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() 125 if (alg->exit) in crypto_aead_init_tfm() 128 if (alg->init) in crypto_aead_init_tfm() 129 return alg->init(aead); in crypto_aead_init_tfm() 145 raead.blocksize = alg->cra_blocksize; in crypto_aead_report() 215 if (max3(alg->maxauthsize, alg->ivsize, alg->chunksize) > in aead_prepare_alg() 219 if (!alg->chunksize) in aead_prepare_alg() 234 err = aead_prepare_alg(alg); in crypto_register_aead() 244 crypto_unregister_alg(&alg->base); in crypto_unregister_aead() [all …]
|
H A D | geniv.c | 46 struct aead_alg *alg; in aead_geniv_alloc() local 67 alg = crypto_spawn_aead_alg(spawn); in aead_geniv_alloc() 69 ivsize = crypto_aead_alg_ivsize(alg); in aead_geniv_alloc() 70 maxauthsize = crypto_aead_alg_maxauthsize(alg); in aead_geniv_alloc() 86 inst->alg.base.cra_priority = alg->base.cra_priority; in aead_geniv_alloc() 87 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in aead_geniv_alloc() 88 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in aead_geniv_alloc() 91 inst->alg.setkey = aead_geniv_setkey; in aead_geniv_alloc() 92 inst->alg.setauthsize = aead_geniv_setauthsize; in aead_geniv_alloc() 94 inst->alg.ivsize = ivsize; in aead_geniv_alloc() [all …]
|
H A D | kpp.c | 21 struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 43 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_exit_tfm() local 45 alg->exit(kpp); in crypto_kpp_exit_tfm() 53 if (alg->exit) in crypto_kpp_init_tfm() 56 if (alg->init) in crypto_kpp_init_tfm() 57 return alg->init(kpp); in crypto_kpp_init_tfm() 108 struct crypto_alg *base = &alg->base; in kpp_prepare_alg() 117 struct crypto_alg *base = &alg->base; in crypto_register_kpp() 119 kpp_prepare_alg(alg); in crypto_register_kpp() 126 crypto_unregister_alg(&alg->base); in crypto_unregister_kpp() [all …]
|
H A D | lskcipher.c | 27 struct crypto_alg *alg) in __crypto_lskcipher_alg() argument 224 alg->exit(skcipher); in crypto_lskcipher_exit_tfm() 232 if (alg->exit) in crypto_lskcipher_init_tfm() 235 if (alg->init) in crypto_lskcipher_init_tfm() 236 return alg->init(skcipher); in crypto_lskcipher_init_tfm() 345 struct crypto_alg *base = &alg->co.base; in lskcipher_prepare_alg() 352 if (alg->co.chunksize & (alg->co.chunksize - 1)) in lskcipher_prepare_alg() 363 struct crypto_alg *base = &alg->co.base; in crypto_register_lskcipher() 366 err = lskcipher_prepare_alg(alg); in crypto_register_lskcipher() 376 crypto_unregister_alg(&alg->co.base); in crypto_unregister_lskcipher() [all …]
|
H A D | ahash.c | 244 ahash_set_needkey(tfm, alg); in crypto_ahash_setkey() 467 alg->exit_tfm(hash); in crypto_ahash_exit_tfm() 480 ahash_set_needkey(hash, alg); in crypto_ahash_init_tfm() 482 if (alg->exit_tfm) in crypto_ahash_init_tfm() 485 return alg->init_tfm ? alg->init_tfm(hash) : 0; in crypto_ahash_init_tfm() 583 struct ahash_alg *alg; in crypto_clone_ahash() local 617 alg = crypto_ahash_alg(hash); in crypto_clone_ahash() 618 if (!alg->clone_tfm) in crypto_clone_ahash() 638 if (alg->halg.statesize == 0) in ahash_prepare_alg() 648 if (!alg->finup) in ahash_prepare_alg() [all …]
|
H A D | skcipher.c | 87 struct crypto_alg *alg) in __crypto_skcipher_alg() argument 723 alg->exit(skcipher); in crypto_skcipher_exit_tfm() 745 if (alg->exit) in crypto_skcipher_init_tfm() 748 if (alg->init) in crypto_skcipher_init_tfm() 874 if (alg->ivsize > PAGE_SIZE / 8 || alg->chunksize > PAGE_SIZE / 8 || in skcipher_prepare_alg_common() 876 (alg->ivsize + alg->statesize) > PAGE_SIZE / 2) in skcipher_prepare_alg_common() 879 if (!alg->chunksize) in skcipher_prepare_alg_common() 899 if (!alg->walksize) in skcipher_prepare_alg() 900 alg->walksize = alg->chunksize; in skcipher_prepare_alg() 902 if (!alg->statesize) { in skcipher_prepare_alg() [all …]
|
H A D | crypto_engine.c | 77 struct crypto_engine_alg *alg; in crypto_pump_requests() local 154 op = &alg->op; in crypto_pump_requests() 570 if (!alg->op.do_one_request) in crypto_engine_register_aead() 581 crypto_unregister_aead(&alg->base); in crypto_engine_unregister_aead() 615 if (!alg->op.do_one_request) in crypto_engine_register_ahash() 626 crypto_unregister_ahash(&alg->base); in crypto_engine_unregister_ahash() 661 if (!alg->op.do_one_request) in crypto_engine_register_akcipher() 672 crypto_unregister_akcipher(&alg->base); in crypto_engine_unregister_akcipher() 678 if (!alg->op.do_one_request) in crypto_engine_register_kpp() 689 crypto_unregister_kpp(&alg->base); in crypto_engine_unregister_kpp() [all …]
|
H A D | xcbc.c | 188 struct crypto_alg *alg; in xcbc_create() local 205 alg = crypto_spawn_cipher_alg(spawn); in xcbc_create() 208 if (alg->cra_blocksize != XCBC_BLOCKSIZE) in xcbc_create() 215 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create() 216 inst->alg.base.cra_blocksize = alg->cra_blocksize; in xcbc_create() 218 alg->cra_blocksize * 2; in xcbc_create() 220 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create() 222 alg->cra_blocksize * 2; in xcbc_create() 224 inst->alg.base.cra_init = xcbc_init_tfm; in xcbc_create() 225 inst->alg.base.cra_exit = xcbc_exit_tfm; in xcbc_create() [all …]
|
H A D | ecb.c | 138 inst->alg.setkey = lskcipher_setkey_simple2; in lskcipher_alloc_instance_simple2() 139 inst->alg.init = lskcipher_init_tfm_simple2; in lskcipher_alloc_instance_simple2() 159 inst->alg.co.ivsize = 0; in crypto_ecb_create2() 161 inst->alg.encrypt = crypto_ecb_encrypt2; in crypto_ecb_create2() 162 inst->alg.decrypt = crypto_ecb_decrypt2; in crypto_ecb_create2() 188 inst->alg.co.ivsize = 0; in crypto_ecb_create() 193 inst->alg.setkey = cipher_alg->setkey; in crypto_ecb_create() 194 inst->alg.encrypt = cipher_alg->encrypt; in crypto_ecb_create() 195 inst->alg.decrypt = cipher_alg->decrypt; in crypto_ecb_create() 196 inst->alg.init = cipher_alg->init; in crypto_ecb_create() [all …]
|
H A D | hmac.c | 181 struct crypto_alg *alg; in hmac_create() local 202 alg = &salg->base; in hmac_create() 211 if (ds > alg->cra_blocksize || in hmac_create() 212 ss < alg->cra_blocksize) in hmac_create() 219 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 220 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 223 inst->alg.digestsize = ds; in hmac_create() 224 inst->alg.statesize = ss; in hmac_create() 225 inst->alg.init = hmac_init; in hmac_create() 227 inst->alg.final = hmac_final; in hmac_create() [all …]
|
H A D | pcrypt.c | 221 struct crypto_alg *alg) in pcrypt_init_instance() argument 227 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance() 229 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance() 230 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance() 231 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance() 241 struct aead_alg *alg; in pcrypt_create_aead() local 272 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in pcrypt_create_aead() 273 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in pcrypt_create_aead() 277 inst->alg.init = pcrypt_aead_init_tfm; in pcrypt_create_aead() 278 inst->alg.exit = pcrypt_aead_exit_tfm; in pcrypt_create_aead() [all …]
|
H A D | testmgr.c | 140 const char *alg; member 3988 alg); in do_test_kpp() 4057 alg); in do_test_kpp() 4857 .alg = "dh", 5387 .alg = "lz4", 5407 .alg = "lzo", 5427 .alg = "md4", 5433 .alg = "md5", 5570 .alg = "rsa", 5640 .alg = "sm3", [all …]
|
H A D | cmac.c | 236 struct crypto_alg *alg; in cmac_create() local 253 alg = crypto_spawn_cipher_alg(spawn); in cmac_create() 255 switch (alg->cra_blocksize) { in cmac_create() 268 inst->alg.base.cra_priority = alg->cra_priority; in cmac_create() 269 inst->alg.base.cra_blocksize = alg->cra_blocksize; in cmac_create() 271 alg->cra_blocksize * 2; in cmac_create() 273 inst->alg.digestsize = alg->cra_blocksize; in cmac_create() 275 alg->cra_blocksize * 2; in cmac_create() 280 inst->alg.init_tfm = cmac_init_tfm; in cmac_create() 281 inst->alg.clone_tfm = cmac_clone_tfm; in cmac_create() [all …]
|
/linux/fs/verity/ |
H A D | hash_algs.c | 45 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local 58 return alg; in fsverity_get_hash_alg() 62 if (alg->tfm != NULL) in fsverity_get_hash_alg() 70 alg->name); in fsverity_get_hash_alg() 71 alg = ERR_PTR(-ENOPKG); in fsverity_get_hash_alg() 77 alg = ERR_CAST(tfm); in fsverity_get_hash_alg() 96 alg = ERR_PTR(err); in fsverity_get_hash_alg() 99 return alg; in fsverity_get_hash_alg() 120 desc->tfm = alg->tfm; in fsverity_prepare_hash_state() 226 if (!alg->name) in fsverity_check_hash_algs() [all …]
|
/linux/tools/crypto/tcrypt/ |
H A D | tcrypt_speed_compare.py | 61 alg = match.group(1) 63 return alg, op 94 alg, op = "", "" 101 alg, op = _alg, _op 102 if alg not in result: 103 result[alg] = {} 115 for alg in base.keys(): 116 merged[alg] = {} 117 for op in base[alg].keys(): 119 merged[alg][op] = [] [all …]
|