| /linux/crypto/ | 
| H A D | skcipher.c | 33 	struct crypto_alg *alg)  in __crypto_skcipher_alg()  argument35 	return container_of(alg, struct skcipher_alg, base);  in __crypto_skcipher_alg()
 42 	struct skcipher_alg *alg;  in skcipher_walk_virt()  local
 46 	alg = crypto_skcipher_alg(tfm);  in skcipher_walk_virt()
 65 	if (alg->co.base.cra_type != &crypto_skcipher_type)  in skcipher_walk_virt()
 66 		walk->stride = alg->co.chunksize;  in skcipher_walk_virt()
 68 		walk->stride = alg->walksize;  in skcipher_walk_virt()
 189 	struct skcipher_alg *alg = crypto_skcipher_alg(tfm);  in crypto_skcipher_encrypt()  local
 193 	if (alg->co.base.cra_type != &crypto_skcipher_type)  in crypto_skcipher_encrypt()
 195 	return alg->encrypt(req);  in crypto_skcipher_encrypt()
 [all …]
 
 | 
| H A D | simd.c | 43 	struct skcipher_alg alg;  member116 	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 D | ahash.c | 283 static void ahash_set_needkey(struct crypto_ahash *tfm, struct ahash_alg *alg)  in ahash_set_needkey()  argument285 	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()
 689 	struct ahash_alg *alg = crypto_ahash_alg(hash);  in crypto_ahash_exit_tfm()  local
 691 	if (alg->exit_tfm)  in crypto_ahash_exit_tfm()
 692 		alg->exit_tfm(hash);  in crypto_ahash_exit_tfm()
 703 	struct ahash_alg *alg = crypto_ahash_alg(hash);  in crypto_ahash_init_tfm()  local
 [all …]
 
 | 
| H A D | essiv.c | 414 	struct crypto_alg *alg;  in essiv_supported_algorithms()  local417 	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 D | scompress.c | 49 	struct sk_buff *skb, struct crypto_alg *alg)  in crypto_scomp_report()  argument61 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/tools/crypto/tcrypt/ | 
| H A D | tcrypt_speed_compare.py | 33 modprobe tcrypt alg="pcrypt(rfc4106(gcm(aes)))" type=340 modprobe tcrypt alg="pcrypt(rfc4106(gcm(aes)))" type=3
 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] = {}
 104                 if op not in result[alg]:
 105                     result[alg][op] = []
 [all …]
 
 | 
| /linux/scripts/crypto/ | 
| H A D | gen-hash-testvecs.py | 53 def hash_init(alg):  argument54     if alg == 'poly1305':
 58     return hashlib.new(alg)
 66 def compute_hash(alg, data):  argument
 67     ctx = hash_init(alg)
 87 def alg_digest_size_const(alg):  argument
 88     if alg == 'blake2s':
 90     return f'{alg.upper()}_DIGEST_SIZE'
 92 def gen_unkeyed_testvecs(alg):  argument
 96     print(f'\tu8 digest[{alg_digest_size_const(alg)}];')
 [all …]
 
 | 
| /linux/fs/verity/ | 
| H A D | hash_algs.c | 33  * Return: pointer to the hash alg if it's known, otherwise NULL.48  * @alg: hash algorithm
 55 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()
 132  * @alg: the hash algorithm to use
 135  * @out: output digest, size 'alg->digest_size' bytes
 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
 [all …]
 
 | 
| /linux/net/ipv4/ | 
| H A D | tcp_sigpool.c | 24 	const char		*alg;  member120 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()
 154  * @alg: name of async hash algorithm
 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()
 [all …]
 
 | 
| /linux/drivers/crypto/ccp/ | 
| H A D | ccp-crypto-aes-xts.c | 231 	struct skcipher_alg *alg;  in ccp_register_aes_xts_alg()  local240 	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 D | ccp-crypto-sha.c | 187 	struct ccp_crypto_ahash_alg *alg =  in ccp_sha_init()  local194 	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 D | ccp-crypto.h | 41 	struct skcipher_alg alg;  member49 	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 D | ccp-crypto-aes-cmac.c | 260 	struct ccp_crypto_ahash_alg *alg =  in ccp_aes_cmac_setkey()  local281 	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/net/wireless/intel/ipw2x00/ | 
| H A D | libipw_crypto.c | 160 	struct libipw_crypto_alg *alg;  in libipw_register_crypto_ops()  local162 	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 …]
 
 | 
| H A D | libipw_wx.c | 508 	const char *alg, *module;  in libipw_wx_set_encodeext()  local529 		if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP)  in libipw_wx_set_encodeext()
 539 	    ext->alg == IW_ENCODE_ALG_NONE) {  in libipw_wx_set_encodeext()
 564 	switch (ext->alg) {  in libipw_wx_set_encodeext()
 566 		alg = "WEP";  in libipw_wx_set_encodeext()
 570 		alg = "TKIP";  in libipw_wx_set_encodeext()
 574 		alg = "CCMP";  in libipw_wx_set_encodeext()
 578 		LIBIPW_DEBUG_WX("%s: unknown crypto alg %d\n",  in libipw_wx_set_encodeext()
 579 				   dev->name, ext->alg);  in libipw_wx_set_encodeext()
 584 	ops = libipw_get_crypto_ops(alg);  in libipw_wx_set_encodeext()
 [all …]
 
 | 
| /linux/security/ipe/ | 
| H A D | digest.c | 28 	char *alg = NULL;  in ipe_digest_parse()  local41 	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/include/crypto/internal/ | 
| H A D | aead.h | 25 		struct aead_alg alg;  member50 	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/Documentation/crypto/ | 
| H A D | api-samples.rst | 104     static struct sdesc *init_sdesc(struct crypto_shash *alg)109         size = sizeof(struct shash_desc) + crypto_shash_descsize(alg);
 113         sdesc->shash.tfm = alg;
 117     static int calc_hash(struct crypto_shash *alg,
 124         sdesc = init_sdesc(alg);
 138         struct crypto_shash *alg;
 142         alg = crypto_alloc_shash(hash_alg_name, 0, 0);
 143         if (IS_ERR(alg)) {
 144                 pr_info("can't alloc alg %s\n", hash_alg_name);
 145                 return PTR_ERR(alg);
 [all …]
 
 | 
| /linux/drivers/crypto/tegra/ | 
| H A D | tegra-se-aes.c | 27 	u32 alg;  member48 	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/rockchip/ | 
| H A D | rk3288_crypto_skcipher.c | 26 	struct skcipher_alg *alg = crypto_skcipher_alg(tfm);  in rk_cipher_need_fallback()  local27 	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()
 438 	struct skcipher_alg *alg = crypto_skcipher_alg(tfm);  in rk_cipher_tfm_init()  local
 439 	struct rk_crypto_tmp *algt = container_of(alg, struct rk_crypto_tmp, alg.skcipher.base);  in rk_cipher_tfm_init()
 464 	.alg.skcipher.base = {
 482 	.alg.skcipher.op = {
 [all …]
 
 | 
| /linux/drivers/crypto/bcm/ | 
| H A D | util.c | 295 /* Returns the name for a given cipher alg/mode */296 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()
 [all …]
 
 | 
| /linux/include/crypto/ | 
| H A D | algapi.h | 60 	struct crypto_alg alg;  member89 	struct crypto_alg *alg;  member
 122 int crypto_register_alg(struct crypto_alg *alg);
 123 void crypto_unregister_alg(struct crypto_alg *alg);
 127 void crypto_mod_put(struct crypto_alg *alg);
 150 			  const char *driver, struct crypto_alg *alg);
 155 #define crypto_inst_setname_1(inst, name, alg) \  argument
 156 	__crypto_inst_setname(inst, name, name, alg)
 157 #define crypto_inst_setname_2(inst, name, driver, alg) \  argument
 158 	__crypto_inst_setname(inst, name, driver, alg)
 [all …]
 
 | 
| /linux/fs/smb/client/ | 
| H A D | compress.h | 53  * @alg: Compression algorithm to check.57  * If @alg is SMB3_COMPRESS_NONE, this function returns @valid_none.
 62  * Return: true if @alg is valid/supported, false otherwise.
 64 static __always_inline int smb_compress_alg_valid(__le16 alg, bool valid_none)  in smb_compress_alg_valid()  argument
 66 	if (alg == SMB3_COMPRESS_NONE)  in smb_compress_alg_valid()
 69 	if (alg == SMB3_COMPRESS_LZ77 || alg == SMB3_COMPRESS_PATTERN)  in smb_compress_alg_valid()
 
 | 
| /linux/drivers/crypto/inside-secure/ | 
| H A D | safexcel_cipher.c | 50 	enum safexcel_cipher_alg alg;  member91 	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 …]
 
 | 
| /linux/drivers/crypto/allwinner/sun4i-ss/ | 
| H A D | sun4i-ss-prng.c | 8 	struct rng_alg *alg = crypto_rng_alg(tfm);  in sun4i_ss_prng_seed()  local10 	algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);  in sun4i_ss_prng_seed()
 20 	struct rng_alg *alg = crypto_rng_alg(tfm);  in sun4i_ss_prng_generate()  local
 29 	algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);  in sun4i_ss_prng_generate()
 
 |