Home
last modified time | relevance | path

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

1234

/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/scripts/crypto/
H A Dgen-hash-testvecs.py146 def hash_init(alg):
150 if alg == 'aes-cmac':
152 if alg == 'ghash':
154 if alg == 'poly1305':
156 if alg == 'polyval':
158 return hashlib.new(alg)
166 def compute_hash(alg, data):
167 ctx = hash_init(alg)
187 def alg_digest_size_const(alg):
188 if alg
82 hash_init(alg) global() argument
97 compute_hash(alg, data) global() argument
118 alg_digest_size_const(alg) global() argument
123 gen_unkeyed_testvecs(alg) global() argument
157 gen_hmac_testvecs(alg) global() argument
170 gen_additional_blake2_testvecs(alg) global() argument
252 alg = sys.argv[1] global() variable
[all...]
/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.c29 char *alg = NULL; in ipe_digest_parse() local
42 alg = kstrndup(valstr, sep - valstr, GFP_KERNEL); in ipe_digest_parse()
43 if (!alg) { in ipe_digest_parse()
64 info->alg = alg; in ipe_digest_parse()
69 kfree(alg); in ipe_digest_parse()
88 (!strcmp(expected->alg, digest->alg)) && in ipe_digest_eval()
101 kfree(info->alg); in ipe_digest_free()
116 audit_log_untrustedstring(ab, info->alg); in ipe_digest_audit()
/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_obj(*alg); 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 …]
H A Dlibipw_wx.c507 const char *alg, *module; in libipw_wx_set_encodeext() local
528 if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP) in libipw_wx_set_encodeext()
538 ext->alg == IW_ENCODE_ALG_NONE) { in libipw_wx_set_encodeext()
563 switch (ext->alg) { in libipw_wx_set_encodeext()
565 alg = "WEP"; in libipw_wx_set_encodeext()
569 alg = "TKIP"; in libipw_wx_set_encodeext()
573 alg = "CCMP"; in libipw_wx_set_encodeext()
578 dev->name, ext->alg); in libipw_wx_set_encodeext()
583 ops = libipw_get_crypto_ops(alg); in libipw_wx_set_encodeext()
586 ops = libipw_get_crypto_ops(alg); in libipw_wx_set_encodeext()
[all …]
/linux/crypto/
H A Dalgboss.c46 char alg[CRYPTO_MAX_ALG_NAME]; member
68 param->larval->alg.cra_flags |= CRYPTO_ALG_DEAD; in cryptomgr_probe()
70 crypto_alg_put(&param->larval->alg); in cryptomgr_probe()
79 const char *name = larval->alg.cra_name; in cryptomgr_schedule_probe()
147 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; in cryptomgr_schedule_probe()
151 param->otype = larval->alg.cra_flags; in cryptomgr_schedule_probe()
154 crypto_alg_get(&larval->alg); in cryptomgr_schedule_probe()
164 crypto_alg_put(&larval->alg); in cryptomgr_schedule_probe()
179 err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED); in cryptomgr_test()
187 static int cryptomgr_schedule_test(struct crypto_alg *alg) in cryptomgr_schedule_test() argument
[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 Dseqiv.c137 if (inst->alg.ivsize != sizeof(u64)) in seqiv_aead_create()
140 inst->alg.encrypt = seqiv_aead_encrypt; in seqiv_aead_create()
141 inst->alg.decrypt = seqiv_aead_decrypt; in seqiv_aead_create()
143 inst->alg.init = aead_init_geniv; in seqiv_aead_create()
144 inst->alg.exit = aead_exit_geniv; in seqiv_aead_create()
146 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); in seqiv_aead_create()
147 inst->alg.base.cra_ctxsize += inst->alg.ivsize; in seqiv_aead_create()
H A Dauthenc.c395 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_create()
401 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_create()
406 inst->alg.base.cra_priority = enc->base.cra_priority * 10 + in crypto_authenc_create()
408 inst->alg.base.cra_blocksize = enc->base.cra_blocksize; in crypto_authenc_create()
409 inst->alg.base.cra_alignmask = enc->base.cra_alignmask; in crypto_authenc_create()
410 inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_ctx); in crypto_authenc_create()
412 inst->alg.ivsize = enc->ivsize; in crypto_authenc_create()
413 inst->alg.chunksize = enc->chunksize; in crypto_authenc_create()
414 inst->alg.maxauthsize = auth->digestsize; in crypto_authenc_create()
416 inst->alg.init = crypto_authenc_init_tfm; in crypto_authenc_create()
[all …]
/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/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);
/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/drivers/crypto/tegra/
H A Dtegra-se-hash.c27 unsigned int alg; member
39 unsigned int alg; member
49 static int tegra_sha_get_config(u32 alg) in tegra_sha_get_config() argument
53 switch (alg) { in tegra_sha_get_config()
253 if (ctx->alg == SE_ALG_SHA384 || ctx->alg == SE_ALG_SHA512) in tegra_se_insert_hash_result()
261 if (ctx->alg <= SE_ALG_SHA512) in tegra_se_insert_hash_result()
367 rctx->alg = ctx->alg; in tegra_sha_do_init()
454 rctx->config = tegra_sha_get_config(rctx->alg) | in tegra_sha_do_update()
489 rctx->config = tegra_sha_get_config(rctx->alg) | in tegra_sha_do_final()
587 struct ahash_alg *alg = __crypto_ahash_alg(tfm->__crt_alg); in tegra_sha_cra_init() local
[all …]
/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/crypto/ccp/
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()
H A Dccp-crypto-aes-cmac.c260 struct ccp_crypto_ahash_alg *alg = in ccp_aes_cmac_setkey() local
281 ctx->u.aes.mode = alg->mode; in ccp_aes_cmac_setkey()
352 struct ahash_alg *alg; in ccp_register_aes_cmac_algs() local
364 alg = &ccp_alg->alg; in ccp_register_aes_cmac_algs()
365 alg->init = ccp_aes_cmac_init; in ccp_register_aes_cmac_algs()
366 alg->update = ccp_aes_cmac_update; in ccp_register_aes_cmac_algs()
367 alg->final = ccp_aes_cmac_final; in ccp_register_aes_cmac_algs()
368 alg->finup = ccp_aes_cmac_finup; in ccp_register_aes_cmac_algs()
369 alg->digest = ccp_aes_cmac_digest; in ccp_register_aes_cmac_algs()
370 alg->export = ccp_aes_cmac_export; in ccp_register_aes_cmac_algs()
[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/allwinner/sun8i-ss/
H A Dsun8i-ss-hash.c98 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_init_tfm() local
102 algt = container_of(alg, struct sun8i_ss_alg_template, alg.hash.base); in sun8i_ss_hash_init_tfm()
201 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_final() local
204 algt = container_of(alg, struct sun8i_ss_alg_template, in sun8i_ss_hash_final()
205 alg.hash.base); in sun8i_ss_hash_final()
244 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_finup() local
247 algt = container_of(alg, struct sun8i_ss_alg_template, in sun8i_ss_hash_finup()
248 alg.hash.base); in sun8i_ss_hash_finup()
272 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_digest_fb() local
275 algt = container_of(alg, struct sun8i_ss_alg_template, in sun8i_ss_hash_digest_fb()
[all …]
/linux/drivers/crypto/inside-secure/
H A Dsafexcel_hash.c26 u32 alg; member
115 cdesc->control_data.control0 = ctx->alg; in safexcel_context_control()
778 if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_MD5) in safexcel_ahash_final()
781 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SHA1) in safexcel_ahash_final()
784 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SHA224) in safexcel_ahash_final()
787 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SHA256) in safexcel_ahash_final()
790 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SHA384) in safexcel_ahash_final()
793 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SHA512) in safexcel_ahash_final()
796 else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SM3) { in safexcel_ahash_final()
803 ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_MD5 && in safexcel_ahash_final()
[all …]
/linux/drivers/crypto/qce/
H A Dcipher.h50 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in to_cipher_tmpl() local
51 return container_of(alg, struct qce_alg_template, alg.skcipher); in to_cipher_tmpl()
H A Dsha.h64 struct ahash_alg *alg = container_of(crypto_hash_alg_common(ahash), in to_ahash_tmpl() local
67 return container_of(alg, struct qce_alg_template, alg.ahash); in to_ahash_tmpl()
H A Daead.h49 struct aead_alg *alg = crypto_aead_alg(tfm); in to_aead_tmpl() local
51 return container_of(alg, struct qce_alg_template, alg.aead); in to_aead_tmpl()
/linux/drivers/mmc/host/
H A Dcqhci-crypto.c16 enum cqhci_crypto_alg alg; member
20 .alg = CQHCI_CRYPTO_ALG_AES_XTS,
62 const struct cqhci_crypto_alg_entry *alg = in cqhci_crypto_keyslot_program() local
71 if (ccap_array[i].algorithm_id == alg->alg && in cqhci_crypto_keyslot_program()
72 ccap_array[i].key_size == alg->key_size && in cqhci_crypto_keyslot_program()
141 if (cqhci_crypto_algs[i].alg == cap.algorithm_id && in cqhci_find_blk_crypto_mode()
/linux/tools/testing/selftests/tpm2/
H A Dtpm2.py204 def __init__(self, alg): argument
205 self.alg = alg
208 return '0x%0x' % (alg)
220 def __init__(self, alg): argument
221 self.alg = alg
224 return '0x%0x' % (alg)
325 def get_digest_size(alg): argument
326 ds = ALG_DIGEST_SIZE_MAP.get(alg)
328 raise UnknownAlgorithmIdError(alg)
332 def get_hash_function(alg): argument
[all …]

1234