Home
last modified time | relevance | path

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

1234567

/linux/tools/crypto/tcrypt/
H A 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 …]
/linux/crypto/
H A 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 …]
H A Dskcipher.c48 struct crypto_alg *alg) in __crypto_skcipher_alg() argument
50 return container_of(alg, struct skcipher_alg, base); in __crypto_skcipher_alg()
287 struct skcipher_alg *alg; in skcipher_walk_virt() local
291 alg = crypto_skcipher_alg(tfm); in skcipher_walk_virt()
312 if (alg->co.base.cra_type != &crypto_skcipher_type) in skcipher_walk_virt()
313 walk->stride = alg->co.chunksize; in skcipher_walk_virt()
315 walk->stride = alg->walksize; in skcipher_walk_virt()
438 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in crypto_skcipher_encrypt() local
442 if (alg->co.base.cra_type != &crypto_skcipher_type) in crypto_skcipher_encrypt()
444 return alg->encrypt(req); in crypto_skcipher_encrypt()
[all …]
H A Daead.c112 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local
114 alg->exit(aead); in crypto_aead_exit_tfm()
120 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local
125 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm()
127 if (alg->exit) in crypto_aead_init_tfm()
130 if (alg->init) in crypto_aead_init_tfm()
131 return alg->init(aead); in crypto_aead_init_tfm()
137 struct sk_buff *skb, struct crypto_alg *alg) in crypto_aead_report() argument
140 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_report()
147 raead.blocksize = alg->cra_blocksize; in crypto_aead_report()
[all …]
H A Dtestmgr.c64 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument
141 const char *alg; member
2011 "unkeyed ones must come first\n", desc->alg); in alg_test_hash()
3581 const char *alg) in do_test_kpp() argument
3622 alg, err); in do_test_kpp()
3638 alg); in do_test_kpp()
3660 alg, err); in do_test_kpp()
3691 alg, err); in do_test_kpp()
3707 alg); in do_test_kpp()
3722 static int test_kpp(struct crypto_kpp *tfm, const char *alg, in test_kpp() argument
[all …]
H A Dahash.c283 static void ahash_set_needkey(struct crypto_ahash *tfm, struct ahash_alg *alg) in ahash_set_needkey() argument
285 if (alg->setkey != ahash_nosetkey && in ahash_set_needkey()
286 !(alg->halg.base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey()
305 struct ahash_alg *alg = crypto_ahash_alg(tfm); in crypto_ahash_setkey() local
308 err = alg->setkey(tfm, key, keylen); in crypto_ahash_setkey()
313 ahash_set_needkey(tfm, alg); in crypto_ahash_setkey()
703 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_exit_tfm() local
705 if (alg->exit_tfm) in crypto_ahash_exit_tfm()
706 alg->exit_tfm(hash); in crypto_ahash_exit_tfm()
717 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
[all …]
H A Dessiv.c414 struct crypto_alg *alg; in essiv_supported_algorithms() local
417 alg = crypto_alg_mod_lookup(essiv_cipher_name, in essiv_supported_algorithms()
420 if (IS_ERR(alg)) in essiv_supported_algorithms()
423 if (hash_alg->digestsize < alg->cra_cipher.cia_min_keysize || in essiv_supported_algorithms()
424 hash_alg->digestsize > alg->cra_cipher.cia_max_keysize) in essiv_supported_algorithms()
427 if (ivsize != alg->cra_blocksize) in essiv_supported_algorithms()
436 crypto_mod_put(alg); in essiv_supported_algorithms()
481 base = &skcipher_inst->alg.base; in essiv_create()
501 base = &aead_inst->alg.base; in essiv_create()
575 skcipher_inst->alg.setkey = essiv_skcipher_setkey; in essiv_create()
[all …]
H A Dscompress.c49 struct sk_buff *skb, struct crypto_alg *alg) in crypto_scomp_report() argument
61 static void crypto_scomp_show(struct seq_file *m, struct crypto_alg *alg)
64 static void crypto_scomp_show(struct seq_file *m, struct crypto_alg *alg) in crypto_scomp_show() argument
124 struct scomp_alg *alg = crypto_scomp_alg(__crypto_scomp_tfm(tfm)); in crypto_scomp_init_tfm() local
128 ret = crypto_acomp_alloc_streams(&alg->streams); in crypto_scomp_init_tfm()
328 static void crypto_scomp_destroy(struct crypto_alg *alg) in crypto_scomp_destroy() argument
330 struct scomp_alg *scomp = __crypto_scomp_alg(alg); in crypto_scomp_destroy()
352 static void scomp_prepare_alg(struct scomp_alg *alg) in scomp_prepare_alg() argument
354 struct crypto_alg *base = &alg->calg.base; in scomp_prepare_alg()
356 comp_prepare_alg(&alg->calg); in scomp_prepare_alg()
[all …]
/linux/scripts/crypto/
H A Dgen-hash-testvecs.py82 def hash_init(alg): argument
83 if alg == 'poly1305':
87 if alg == 'polyval':
89 return hashlib.new(alg)
97 def compute_hash(alg, data): argument
98 ctx = hash_init(alg)
118 def alg_digest_size_const(alg): argument
119 if alg.startswith('blake2'):
123 def gen_unkeyed_testvecs(alg): argument
133 print_c_struct_u8_array_field('digest', compute_hash(alg, data))
[all …]
/linux/net/ipv4/
H A Dtcp_sigpool.c24 const char *alg; member
120 static int __cpool_alloc_ahash(struct sigpool_entry *e, const char *alg) in __cpool_alloc_ahash() argument
125 e->alg = kstrdup(alg, GFP_KERNEL); in __cpool_alloc_ahash()
126 if (!e->alg) in __cpool_alloc_ahash()
129 cpu0_hash = crypto_alloc_ahash(alg, 0, CRYPTO_ALG_ASYNC); in __cpool_alloc_ahash()
147 kfree(e->alg); in __cpool_alloc_ahash()
148 e->alg = NULL; in __cpool_alloc_ahash()
157 int tcp_sigpool_alloc_ahash(const char *alg, size_t scratch_size) in tcp_sigpool_alloc_ahash() argument
167 if (!cpool[i].alg) in tcp_sigpool_alloc_ahash()
169 if (strcmp(cpool[i].alg, alg)) in tcp_sigpool_alloc_ahash()
[all …]
/linux/drivers/crypto/ccp/
H A Dccp-crypto-aes-xts.c231 struct skcipher_alg *alg; in ccp_register_aes_xts_alg() local
240 alg = &ccp_alg->alg; in ccp_register_aes_xts_alg()
242 snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); in ccp_register_aes_xts_alg()
243 snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in ccp_register_aes_xts_alg()
245 alg->base.cra_flags = CRYPTO_ALG_ASYNC | in ccp_register_aes_xts_alg()
249 alg->base.cra_blocksize = AES_BLOCK_SIZE; in ccp_register_aes_xts_alg()
250 alg->base.cra_ctxsize = sizeof(struct ccp_ctx) + in ccp_register_aes_xts_alg()
252 alg->base.cra_priority = CCP_CRA_PRIORITY; in ccp_register_aes_xts_alg()
253 alg->base.cra_module = THIS_MODULE; in ccp_register_aes_xts_alg()
255 alg->setkey = ccp_aes_xts_setkey; in ccp_register_aes_xts_alg()
[all …]
H A Dccp-crypto-sha.c187 struct ccp_crypto_ahash_alg *alg = in ccp_sha_init() local
194 rctx->type = alg->type; in ccp_sha_init()
334 struct ccp_crypto_ahash_alg *alg = ccp_crypto_ahash_alg(tfm); in ccp_hmac_sha_cra_init() local
337 hmac_tfm = crypto_alloc_shash(alg->child_alg, 0, 0); in ccp_hmac_sha_cra_init()
340 alg->child_alg); in ccp_hmac_sha_cra_init()
416 struct ahash_alg *alg; in ccp_register_hmac_alg() local
431 alg = &ccp_alg->alg; in ccp_register_hmac_alg()
432 alg->setkey = ccp_sha_setkey; in ccp_register_hmac_alg()
434 halg = &alg->halg; in ccp_register_hmac_alg()
443 ret = crypto_register_ahash(alg); in ccp_register_hmac_alg()
[all …]
H A Dccp-crypto.h41 struct skcipher_alg alg; member
49 struct aead_alg alg; member
62 struct ahash_alg alg; member
68 struct akcipher_alg alg; member
74 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in ccp_crypto_skcipher_alg() local
76 return container_of(alg, struct ccp_crypto_skcipher_alg, alg); in ccp_crypto_skcipher_alg()
82 struct crypto_alg *alg = tfm->__crt_alg; in ccp_crypto_ahash_alg() local
85 ahash_alg = container_of(alg, struct ahash_alg, halg.base); in ccp_crypto_ahash_alg()
87 return container_of(ahash_alg, struct ccp_crypto_ahash_alg, alg); in ccp_crypto_ahash_alg()
/linux/fs/verity/
H A Dhash_algs.c55 fsverity_prepare_hash_state(const struct fsverity_hash_alg *alg, in fsverity_prepare_hash_state() argument
70 padded_salt_size = round_up(salt_size, alg->block_size); in fsverity_prepare_hash_state()
76 switch (alg->algo_id) { in fsverity_prepare_hash_state()
137 void fsverity_hash_buffer(const struct fsverity_hash_alg *alg, in fsverity_hash_buffer() argument
140 switch (alg->algo_id) { in fsverity_hash_buffer()
161 const struct fsverity_hash_alg *alg = &fsverity_hash_algs[i]; in fsverity_check_hash_algs() local
163 if (!alg->name) in fsverity_check_hash_algs()
174 BUG_ON(alg->digest_size > FS_VERITY_MAX_DIGEST_SIZE); in fsverity_check_hash_algs()
181 BUG_ON(!is_power_of_2(alg->digest_size)); in fsverity_check_hash_algs()
182 BUG_ON(!is_power_of_2(alg->block_size)); in fsverity_check_hash_algs()
[all …]
/linux/security/ipe/
H A Ddigest.c28 char *alg = NULL; in ipe_digest_parse() local
41 alg = kstrndup(valstr, sep - valstr, GFP_KERNEL); in ipe_digest_parse()
42 if (!alg) { in ipe_digest_parse()
63 info->alg = alg; in ipe_digest_parse()
68 kfree(alg); in ipe_digest_parse()
87 (!strcmp(expected->alg, digest->alg)) && in ipe_digest_eval()
100 kfree(info->alg); in ipe_digest_free()
115 audit_log_untrustedstring(ab, info->alg); in ipe_digest_audit()
/linux/lib/crypto/tests/
H A Dsha3_kunit.c250 static void shake(int alg, const u8 *in, size_t in_len, u8 *out, size_t out_len) in shake() argument
252 if (alg == 0) in shake()
258 static void shake_init(struct shake_ctx *ctx, int alg) in shake_init() argument
260 if (alg == 0) in shake_init()
283 for (int alg = 0; alg < 2; alg++) { in test_shake_all_lens_up_to_4096() local
288 shake(alg, in, in_len, out, out_len); in test_shake_all_lens_up_to_4096()
292 if (alg == 0) in test_shake_all_lens_up_to_4096()
320 const int alg = rand32() % 2; in test_shake_multiple_squeezes() local
334 shake(alg, in, in_len, ref_out, out_len); in test_shake_multiple_squeezes()
337 shake_init(&ctx, alg); in test_shake_multiple_squeezes()
[all …]
/linux/drivers/net/wireless/intel/ipw2x00/
H A Dlibipw_crypto.c160 struct libipw_crypto_alg *alg; in libipw_register_crypto_ops() local
162 alg = kzalloc(sizeof(*alg), GFP_KERNEL); in libipw_register_crypto_ops()
163 if (alg == NULL) in libipw_register_crypto_ops()
166 alg->ops = ops; in libipw_register_crypto_ops()
169 list_add(&alg->list, &libipw_crypto_algs); in libipw_register_crypto_ops()
181 struct libipw_crypto_alg *alg; in libipw_unregister_crypto_ops() local
185 list_for_each_entry(alg, &libipw_crypto_algs, list) { in libipw_unregister_crypto_ops()
186 if (alg->ops == ops) in libipw_unregister_crypto_ops()
195 list_del(&alg->list); in libipw_unregister_crypto_ops()
197 kfree(alg); in libipw_unregister_crypto_ops()
[all …]
/linux/drivers/crypto/bcm/
H A Dutil.c296 char *spu_alg_name(enum spu_cipher_alg alg, enum spu_cipher_mode mode) in spu_alg_name() argument
298 switch (alg) { in spu_alg_name()
359 u32 alg; in spu_debugfs_read() local
386 for (alg = 0; alg < CIPHER_ALG_LAST; alg++) { in spu_debugfs_read()
388 op_cnt = atomic_read(&ipriv->cipher_cnt[alg][mode]); in spu_debugfs_read()
393 spu_alg_name(alg, mode), op_cnt); in spu_debugfs_read()
400 for (alg = 0; alg < HASH_ALG_LAST; alg++) { in spu_debugfs_read()
401 op_cnt = atomic_read(&ipriv->hash_cnt[alg]); in spu_debugfs_read()
406 hash_alg_name[alg], op_cnt); in spu_debugfs_read()
415 for (alg = 0; alg < HASH_ALG_LAST; alg++) { in spu_debugfs_read()
[all …]
/linux/include/crypto/internal/
H A Daead.h25 struct aead_alg alg; member
50 return container_of(&inst->alg.base, struct crypto_instance, alg); in aead_crypto_instance()
55 return container_of(&inst->alg, struct aead_instance, alg.base); in aead_instance()
111 return container_of(spawn->base.alg, struct aead_alg, base); in crypto_spawn_aead_alg()
139 static inline unsigned int crypto_aead_alg_chunksize(struct aead_alg *alg) in crypto_aead_alg_chunksize() argument
141 return alg->chunksize; in crypto_aead_alg_chunksize()
160 int crypto_register_aead(struct aead_alg *alg);
161 void crypto_unregister_aead(struct aead_alg *alg);
H A Dskcipher.h34 struct skcipher_alg alg; member
45 struct lskcipher_alg alg; member
114 struct skcipher_instance, alg); in skcipher_alg_instance()
121 struct lskcipher_instance, alg); in lskcipher_alg_instance()
160 return container_of(spawn->base.alg, struct lskcipher_alg, co.base); in crypto_lskcipher_spawn_alg()
166 return container_of(spawn->base.alg, struct skcipher_alg_common, base); in crypto_spawn_skcipher_alg_common()
200 int crypto_register_skcipher(struct skcipher_alg *alg);
201 void crypto_unregister_skcipher(struct skcipher_alg *alg);
207 int crypto_register_lskcipher(struct lskcipher_alg *alg);
208 void crypto_unregister_lskcipher(struct lskcipher_alg *alg);
/linux/include/crypto/
H A Dalgapi.h60 struct crypto_alg alg; member
89 struct crypto_alg *alg; member
134 int crypto_register_alg(struct crypto_alg *alg);
135 void crypto_unregister_alg(struct crypto_alg *alg);
139 void crypto_mod_put(struct crypto_alg *alg);
162 const char *driver, struct crypto_alg *alg);
167 #define crypto_inst_setname_1(inst, name, alg) \ argument
168 __crypto_inst_setname(inst, name, name, alg)
169 #define crypto_inst_setname_2(inst, name, driver, alg) \ argument
170 __crypto_inst_setname(inst, name, driver, alg)
[all …]
/linux/drivers/firmware/cirrus/test/
H A Dcs_dsp_mock_mem_maps.c404 } alg; in cs_dsp_mock_xm_header_get_alg_base_in_words() local
412 for (;; alg_hdr_addr += sizeof(alg.adsp2) / 2) { in cs_dsp_mock_xm_header_get_alg_base_in_words()
417 &alg.adsp2, sizeof(alg.adsp2)); in cs_dsp_mock_xm_header_get_alg_base_in_words()
419 if (be32_to_cpu(alg.adsp2.alg.id) == alg_id) { in cs_dsp_mock_xm_header_get_alg_base_in_words()
420 xm_base = be32_to_cpu(alg.adsp2.xm); in cs_dsp_mock_xm_header_get_alg_base_in_words()
421 ym_base = be32_to_cpu(alg.adsp2.ym); in cs_dsp_mock_xm_header_get_alg_base_in_words()
422 zm_base = be32_to_cpu(alg.adsp2.zm); in cs_dsp_mock_xm_header_get_alg_base_in_words()
429 for (;; alg_hdr_addr += sizeof(alg.halo)) { in cs_dsp_mock_xm_header_get_alg_base_in_words()
434 &alg.halo, sizeof(alg.halo)); in cs_dsp_mock_xm_header_get_alg_base_in_words()
436 if (be32_to_cpu(alg.halo.alg.id) == alg_id) { in cs_dsp_mock_xm_header_get_alg_base_in_words()
[all …]
/linux/drivers/crypto/rockchip/
H A Drk3288_crypto_skcipher.c26 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in rk_cipher_need_fallback() local
27 struct rk_crypto_tmp *algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher.base); in rk_cipher_need_fallback()
73 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in rk_cipher_fallback() local
74 struct rk_crypto_tmp *algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher.base); in rk_cipher_fallback()
313 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in rk_cipher_run() local
314 struct rk_crypto_tmp *algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher.base); in rk_cipher_run()
437 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in rk_cipher_tfm_init() local
438 struct rk_crypto_tmp *algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher.base); in rk_cipher_tfm_init()
463 .alg.skcipher.base = {
481 .alg.skcipher.op = {
[all …]
/linux/drivers/crypto/tegra/
H A Dtegra-se-aes.c27 u32 alg; member
48 u32 alg; member
72 unsigned int alg; member
121 if (ctx->alg == SE_ALG_CBC) { in tegra_aes_update_iv()
123 } else if (ctx->alg == SE_ALG_CTR) { in tegra_aes_update_iv()
132 static int tegra234_aes_crypto_cfg(u32 alg, bool encrypt) in tegra234_aes_crypto_cfg() argument
134 switch (alg) { in tegra234_aes_crypto_cfg()
168 static int tegra234_aes_cfg(u32 alg, bool encrypt) in tegra234_aes_cfg() argument
170 switch (alg) { in tegra234_aes_cfg()
272 rctx->iv = (ctx->alg == SE_ALG_ECB) ? NULL : (u32 *)req->iv; in tegra_aes_do_one_req()
[all …]
/linux/drivers/crypto/inside-secure/
H A Dsafexcel_cipher.c50 enum safexcel_cipher_alg alg; member
91 if (ctx->alg == SAFEXCEL_CHACHA20) { in safexcel_skcipher_iv()
148 if (ctx->xcm == EIP197_XCM_MODE_GCM || ctx->alg == SAFEXCEL_CHACHA20) { in safexcel_aead_iv()
272 } else if (unlikely(ctx->alg == SAFEXCEL_CHACHA20 && in safexcel_aead_token()
300 if (likely(cryptlen || ctx->alg == SAFEXCEL_CHACHA20)) { in safexcel_aead_token()
411 const char *alg; in safexcel_aead_setkey() local
428 switch (ctx->alg) { in safexcel_aead_setkey()
466 alg = "safexcel-sha1"; in safexcel_aead_setkey()
469 alg = "safexcel-sha224"; in safexcel_aead_setkey()
472 alg = "safexcel-sha256"; in safexcel_aead_setkey()
[all …]

1234567