Home
last modified time | relevance | path

Searched refs:alg (Results 1 – 25 of 335) sorted by relevance

12345678910>>...14

/linux-6.12.1/crypto/
Dapi.c39 static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg);
43 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) in crypto_mod_get() argument
45 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get()
49 void crypto_mod_put(struct crypto_alg *alg) in crypto_mod_put() argument
51 struct module *module = alg->cra_module; in crypto_mod_put()
53 crypto_alg_put(alg); in crypto_mod_put()
61 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local
82 if (alg) in __crypto_alg_lookup()
83 crypto_mod_put(alg); in __crypto_alg_lookup()
84 alg = q; in __crypto_alg_lookup()
[all …]
Dalgapi.c38 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument
40 crypto_check_module_sig(alg->cra_module); in crypto_check_alg()
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()
49 if (alg->cra_alignmask > MAX_ALGAPI_ALIGNMASK) in crypto_check_alg()
52 if (alg->cra_blocksize > MAX_ALGAPI_BLOCKSIZE) in crypto_check_alg()
56 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg()
58 if (alg->cra_alignmask > MAX_CIPHER_ALIGNMASK) in crypto_check_alg()
61 if (alg->cra_blocksize > MAX_CIPHER_BLOCKSIZE) in crypto_check_alg()
65 if (alg->cra_priority < 0) in crypto_check_alg()
[all …]
Dinternal.h31 struct crypto_alg alg; member
67 int alg_test(const char *driver, const char *alg, u32 type, u32 mask);
102 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument
104 return alg->cra_ctxsize; in crypto_cipher_ctxsize()
107 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument
109 return alg->cra_ctxsize; in crypto_compress_ctxsize()
112 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg);
119 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list,
122 void crypto_shoot_alg(struct crypto_alg *alg);
123 struct crypto_tfm *__crypto_alloc_tfmgfp(struct crypto_alg *alg, u32 type,
[all …]
Dshash.c26 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
28 if (crypto_shash_alg_needs_key(alg)) in shash_set_needkey()
147 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_exit_tfm() local
149 alg->exit_tfm(hash); in crypto_shash_exit_tfm()
155 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local
158 hash->descsize = alg->descsize; in crypto_shash_init_tfm()
160 shash_set_needkey(hash, alg); in crypto_shash_init_tfm()
162 if (alg->exit_tfm) in crypto_shash_init_tfm()
165 if (!alg->init_tfm) in crypto_shash_init_tfm()
168 err = alg->init_tfm(hash); in crypto_shash_init_tfm()
[all …]
Dcrypto_user.c37 struct crypto_alg *q, *alg = NULL; in crypto_alg_match() local
62 alg = q; in crypto_alg_match()
68 return alg; in crypto_alg_match()
71 static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_cipher() argument
79 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher()
80 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher()
81 rcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_report_cipher()
87 static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) in crypto_report_comp() argument
98 static int crypto_report_one(struct crypto_alg *alg, in crypto_report_one() argument
103 strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); in crypto_report_one()
[all …]
Dsimd.c43 struct skcipher_alg alg; member
116 struct skcipher_alg *alg; in simd_skcipher_init() local
119 alg = crypto_skcipher_alg(tfm); in simd_skcipher_init()
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()
158 if (snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", algname) >= in simd_skcipher_create_compat()
162 if (snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in simd_skcipher_create_compat()
166 alg->base.cra_flags = CRYPTO_ALG_ASYNC | in simd_skcipher_create_compat()
168 alg->base.cra_priority = ialg->base.cra_priority; in simd_skcipher_create_compat()
[all …]
Dproc.c39 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); in c_show() local
41 seq_printf(m, "name : %s\n", alg->cra_name); in c_show()
42 seq_printf(m, "driver : %s\n", alg->cra_driver_name); in c_show()
43 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); in c_show()
44 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show()
45 seq_printf(m, "refcnt : %u\n", refcount_read(&alg->cra_refcnt)); 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()
[all …]
Dacompress.c26 static inline struct acomp_alg *__crypto_acomp_alg(struct crypto_alg *alg) in __crypto_acomp_alg() argument
28 return container_of(alg, struct acomp_alg, calg.base); in __crypto_acomp_alg()
37 struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument
48 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg)
51 static void crypto_acomp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_acomp_show() argument
59 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_exit_tfm() local
61 alg->exit(acomp); in crypto_acomp_exit_tfm()
67 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_init_tfm() local
72 acomp->compress = alg->compress; in crypto_acomp_init_tfm()
73 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm()
[all …]
Dctr.c130 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()
157 inst->alg.encrypt = crypto_ctr_crypt; in crypto_ctr_create()
158 inst->alg.decrypt = crypto_ctr_crypt; in crypto_ctr_create()
262 struct skcipher_alg_common *alg; in crypto_rfc3686_create() local
281 alg = crypto_spawn_skcipher_alg_common(spawn); in crypto_rfc3686_create()
[all …]
Dakcipher.c24 struct sk_buff *skb, struct crypto_alg *alg) in crypto_akcipher_report() argument
36 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg)
39 static void crypto_akcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_akcipher_show() argument
47 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_exit_tfm() local
49 alg->exit(akcipher); in crypto_akcipher_exit_tfm()
55 struct akcipher_alg *alg = crypto_akcipher_alg(akcipher); in crypto_akcipher_init_tfm() local
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()
105 static void akcipher_prepare_alg(struct akcipher_alg *alg) in akcipher_prepare_alg() argument
[all …]
Daead.c111 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local
113 alg->exit(aead); in crypto_aead_exit_tfm()
119 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local
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()
135 struct sk_buff *skb, struct crypto_alg *alg) in crypto_aead_report() argument
138 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_report()
145 raead.blocksize = alg->cra_blocksize; in crypto_aead_report()
[all …]
Dgeniv.c46 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()
77 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
78 "%s(%s)", tmpl->name, alg->base.cra_name) >= in aead_geniv_alloc()
81 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
82 "%s(%s)", tmpl->name, alg->base.cra_driver_name) >= 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()
[all …]
Dkpp.c21 struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument
32 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg)
35 static void crypto_kpp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_kpp_show() 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()
51 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_init_tfm() local
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()
106 static void kpp_prepare_alg(struct kpp_alg *alg) in kpp_prepare_alg() argument
[all …]
Dlskcipher.c27 struct crypto_alg *alg) in __crypto_lskcipher_alg() argument
29 return container_of(alg, struct lskcipher_alg, co.base); in __crypto_lskcipher_alg()
143 struct lskcipher_alg *alg = crypto_lskcipher_alg(tfm); in crypto_lskcipher_encrypt() local
145 return crypto_lskcipher_crypt(tfm, src, dst, len, iv, alg->encrypt); in crypto_lskcipher_encrypt()
152 struct lskcipher_alg *alg = crypto_lskcipher_alg(tfm); in crypto_lskcipher_decrypt() local
154 return crypto_lskcipher_crypt(tfm, src, dst, len, iv, alg->decrypt); in crypto_lskcipher_decrypt()
205 struct lskcipher_alg *alg = crypto_lskcipher_alg(*ctx); in crypto_lskcipher_encrypt_sg() local
207 return crypto_lskcipher_crypt_sg(req, alg->encrypt); in crypto_lskcipher_encrypt_sg()
214 struct lskcipher_alg *alg = crypto_lskcipher_alg(*ctx); in crypto_lskcipher_decrypt_sg() local
216 return crypto_lskcipher_crypt_sg(req, alg->decrypt); in crypto_lskcipher_decrypt_sg()
[all …]
Dahash.c217 static void ahash_set_needkey(struct crypto_ahash *tfm, struct ahash_alg *alg) in ahash_set_needkey() argument
219 if (alg->setkey != ahash_nosetkey && in ahash_set_needkey()
220 !(alg->halg.base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey()
239 struct ahash_alg *alg = crypto_ahash_alg(tfm); in crypto_ahash_setkey() local
242 err = alg->setkey(tfm, key, keylen); in crypto_ahash_setkey()
244 ahash_set_needkey(tfm, alg); in crypto_ahash_setkey()
465 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_exit_tfm() local
467 alg->exit_tfm(hash); in crypto_ahash_exit_tfm()
473 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
475 crypto_ahash_set_statesize(hash, alg->halg.statesize); in crypto_ahash_init_tfm()
[all …]
Dskcipher.c87 struct crypto_alg *alg) in __crypto_skcipher_alg() argument
89 return container_of(alg, struct skcipher_alg, base); in __crypto_skcipher_alg()
451 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in skcipher_walk_skcipher() local
472 if (alg->co.base.cra_type != &crypto_skcipher_type) in skcipher_walk_skcipher()
473 walk->stride = alg->co.chunksize; in skcipher_walk_skcipher()
475 walk->stride = alg->walksize; in skcipher_walk_skcipher()
637 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_encrypt() local
641 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_encrypt()
643 return alg->encrypt(req); in crypto_skcipher_encrypt()
650 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_decrypt() local
[all …]
Dcrypto_engine.c77 struct crypto_engine_alg *alg; in crypto_pump_requests() local
152 alg = container_of(async_req->tfm->__crt_alg, in crypto_pump_requests()
154 op = &alg->op; in crypto_pump_requests()
568 int crypto_engine_register_aead(struct aead_engine_alg *alg) in crypto_engine_register_aead() argument
570 if (!alg->op.do_one_request) in crypto_engine_register_aead()
573 alg->base.base.cra_flags |= CRYPTO_ALG_ENGINE; in crypto_engine_register_aead()
575 return crypto_register_aead(&alg->base); in crypto_engine_register_aead()
579 void crypto_engine_unregister_aead(struct aead_engine_alg *alg) in crypto_engine_unregister_aead() argument
581 crypto_unregister_aead(&alg->base); in crypto_engine_unregister_aead()
613 int crypto_engine_register_ahash(struct ahash_engine_alg *alg) in crypto_engine_register_ahash() argument
[all …]
Dpcrypt.c221 struct crypto_alg *alg) in pcrypt_init_instance() argument
223 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance()
224 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_init_instance()
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
265 alg = crypto_spawn_aead_alg(&ctx->spawn); in pcrypt_create_aead()
266 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead()
[all …]
Dhmac.c181 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()
215 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); 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()
221 inst->alg.base.cra_ctxsize = sizeof(struct hmac_ctx) + (ss * 2); in hmac_create()
223 inst->alg.digestsize = ds; in hmac_create()
224 inst->alg.statesize = ss; in hmac_create()
[all …]
Dxcbc.c188 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()
211 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); 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()
217 inst->alg.base.cra_ctxsize = sizeof(struct xcbc_tfm_ctx) + in xcbc_create()
218 alg->cra_blocksize * 2; in xcbc_create()
220 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create()
221 inst->alg.descsize = sizeof(struct xcbc_desc_ctx) + in xcbc_create()
[all …]
Decb.c129 inst->alg.co.base.cra_blocksize = cipher_alg->cra_blocksize; in lskcipher_alloc_instance_simple2()
130 inst->alg.co.base.cra_alignmask = cipher_alg->cra_alignmask; in lskcipher_alloc_instance_simple2()
131 inst->alg.co.base.cra_priority = cipher_alg->cra_priority; in lskcipher_alloc_instance_simple2()
132 inst->alg.co.min_keysize = cipher_alg->cra_cipher.cia_min_keysize; in lskcipher_alloc_instance_simple2()
133 inst->alg.co.max_keysize = cipher_alg->cra_cipher.cia_max_keysize; in lskcipher_alloc_instance_simple2()
134 inst->alg.co.ivsize = cipher_alg->cra_blocksize; in lskcipher_alloc_instance_simple2()
137 inst->alg.co.base.cra_ctxsize = sizeof(struct crypto_cipher *); in lskcipher_alloc_instance_simple2()
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()
140 inst->alg.exit = lskcipher_exit_tfm_simple2; in lskcipher_alloc_instance_simple2()
[all …]
Dtestmgr.c63 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument
140 const char *alg; member
2033 "unkeyed ones must come first\n", desc->alg); in alg_test_hash()
3931 const char *alg) in do_test_kpp() argument
3972 alg, err); in do_test_kpp()
3988 alg); in do_test_kpp()
4010 alg, err); in do_test_kpp()
4041 alg, err); in do_test_kpp()
4057 alg); in do_test_kpp()
4072 static int test_kpp(struct crypto_kpp *tfm, const char *alg, in test_kpp() argument
[all …]
Dcmac.c236 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()
264 err = crypto_inst_setname(shash_crypto_instance(inst), tmpl->name, alg); 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()
270 inst->alg.base.cra_ctxsize = sizeof(struct cmac_tfm_ctx) + in cmac_create()
271 alg->cra_blocksize * 2; in cmac_create()
273 inst->alg.digestsize = alg->cra_blocksize; in cmac_create()
274 inst->alg.descsize = sizeof(struct cmac_desc_ctx) + in cmac_create()
[all …]
/linux-6.12.1/fs/verity/
Dhash_algs.c45 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local
54 alg = &fsverity_hash_algs[num]; in fsverity_get_hash_alg()
57 if (likely(smp_load_acquire(&alg->tfm) != NULL)) in fsverity_get_hash_alg()
58 return alg; in fsverity_get_hash_alg()
62 if (alg->tfm != NULL) in fsverity_get_hash_alg()
65 tfm = crypto_alloc_shash(alg->name, 0, 0); in fsverity_get_hash_alg()
70 alg->name); in fsverity_get_hash_alg()
71 alg = ERR_PTR(-ENOPKG); in fsverity_get_hash_alg()
76 alg->name, PTR_ERR(tfm)); in fsverity_get_hash_alg()
77 alg = ERR_CAST(tfm); in fsverity_get_hash_alg()
[all …]
/linux-6.12.1/tools/crypto/tcrypt/
Dtcrypt_speed_compare.py61 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] = {}
104 if op not in result[alg]:
105 result[alg][op] = []
109 result[alg][op].append(parsed_result)
115 for alg in base.keys():
[all …]

12345678910>>...14