| /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] = {} 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 D | gen-hash-testvecs.py | 146 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/crypto/ |
| H A D | ccm.c | 491 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 495 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 500 inst->alg.base.cra_priority = (mac->base.cra_priority + in crypto_ccm_create_common() 502 inst->alg.base.cra_blocksize = 1; in crypto_ccm_create_common() 503 inst->alg.base.cra_alignmask = ctr->base.cra_alignmask; in crypto_ccm_create_common() 504 inst->alg.ivsize = 16; in crypto_ccm_create_common() 505 inst->alg.chunksize = ctr->chunksize; in crypto_ccm_create_common() 506 inst->alg.maxauthsize = 16; in crypto_ccm_create_common() 507 inst->alg.base.cra_ctxsize = sizeof(struct crypto_ccm_ctx); in crypto_ccm_create_common() 508 inst->alg.init = crypto_ccm_init_tfm; in crypto_ccm_create_common() [all …]
|
| H A D | algboss.c | 46 char alg[CRYPTO_MAX_ALG_NAME]; member 68 param->larval->alg.cra_flags |= CRYPTO_ALG_DEAD; in cryptomgr_probe() 70 crypto_alg_put(¶m->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 D | essiv.c | 414 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 in essiv_create() [all...] |
| H A D | acompress.c | 41 static inline struct acomp_alg *__crypto_acomp_alg(struct crypto_alg *alg) in __crypto_acomp_alg() argument 43 return container_of(alg, struct acomp_alg, calg.base); in __crypto_acomp_alg() 52 struct sk_buff *skb, struct crypto_alg *alg) in crypto_acomp_report() argument 62 struct crypto_alg *alg) in crypto_acomp_show() argument 70 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_exit_tfm() local 72 if (alg->exit) in crypto_acomp_exit_tfm() 73 alg->exit(acomp); in crypto_acomp_exit_tfm() 82 struct acomp_alg *alg = crypto_acomp_alg(acomp); in crypto_acomp_init_tfm() local 102 acomp->compress = alg->compress; in crypto_acomp_init_tfm() 103 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm() [all …]
|
| H A D | seqiv.c | 137 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 D | authenc.c | 395 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/fs/verity/ |
| H A D | hash_algs.c | 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() 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/drivers/net/wireless/intel/ipw2x00/ |
| H A D | libipw_crypto.c | 160 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 D | libipw_wx.c | 507 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/security/ipe/ |
| H A D | digest.c | 29 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/crypto/bcm/ |
| H A D | util.c | 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() 415 for (alg = 0; alg < HASH_ALG_LAST; alg++) { in spu_debugfs_read() [all …]
|
| /linux/include/crypto/internal/ |
| H A D | aead.h | 25 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/tegra/ |
| H A D | tegra-se-hash.c | 27 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 …]
|
| H A D | tegra-se-aes.c | 28 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/fs/smb/common/compress/ |
| H A D | compress.h | 14 static __always_inline bool smb_compress_alg_valid(__le16 alg, bool valid_none) in smb_compress_alg_valid() argument 16 if (alg == SMB3_COMPRESS_NONE) in smb_compress_alg_valid() 19 return alg == SMB3_COMPRESS_LZ77 || alg == SMB3_COMPRESS_PATTERN; in smb_compress_alg_valid() 22 int smb_compression_decompress(__le16 alg, bool allow_chained, 25 int smb_compression_compress_chained(__le16 alg, bool allow_pattern,
|
| H A D | compress.c | 97 static int smb_decompress_chained(__le16 alg, bool allow_chained, in smb_decompress_chained() argument 157 } else if (payload_alg == alg && alg == SMB3_COMPRESS_LZ77) { in smb_decompress_chained() 171 static int smb_decompress_unchained(__le16 alg, in smb_decompress_unchained() 177 if (hdr->CompressionAlgorithm != alg || in smb_decompress_unchained() 195 * @alg: negotiated general-purpose compression algorithm 209 int smb_compression_decompress(__le16 alg, bool allow_chained, in smb_compression_decompress() 217 alg == SMB3_COMPRESS_NONE) in smb_compression_decompress() 221 return smb_decompress_chained(alg, allow_chained, allow_pattern, in smb_compression_decompress() 227 return smb_decompress_unchained(alg, hd 165 smb_decompress_unchained(__le16 alg,const struct smb2_compression_hdr * hdr,u32 slen,void * dst,u32 dlen) smb_decompress_unchained() argument 203 smb_compression_decompress(__le16 alg,bool allow_chained,bool allow_pattern,const void * src,u32 slen,void * dst,u32 dlen) smb_compression_decompress() argument 237 smb_compression_add_payload(struct smb_compression_builder * builder,__le16 alg,u32 payload_len,bool orig_size) smb_compression_add_payload() argument 340 smb_compression_compress_chained(__le16 alg,bool allow_pattern,const void * src,u32 slen,void * dst,u32 * dlen) smb_compression_compress_chained() argument [all...] |
| /linux/include/crypto/ |
| H A D | algapi.h | 60 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 D | ccp-crypto.h | 41 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 D | ccp-crypto-aes-cmac.c | 260 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/ |
| H A D | talitos.c | 908 * crypto alg 2336 } alg; 2343 .alg.aead = { 2365 .alg.aead = { 2386 .alg.aead = { 2411 .alg.aead = { 2435 .alg.aead = { 2457 .alg.aead = { 2478 .alg.aead = { 2503 .alg 2338 } alg; global() member 3150 struct aead_alg *alg = crypto_aead_alg(tfm); talitos_cra_init_aead() local 3162 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); talitos_cra_init_skcipher() local 3174 struct crypto_alg *alg = tfm->__crt_alg; talitos_cra_init_ahash() local 3258 struct crypto_alg *alg; talitos_alg_alloc() local 3558 struct crypto_alg *alg = NULL; talitos_probe() local [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() 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/inside-secure/ |
| H A D | safexcel_hash.c | 26 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 in safexcel_ahash_final() 1114 __safexcel_hmac_setkey(const char * alg,const u8 * key,unsigned int keylen,void * istate,void * ostate) __safexcel_hmac_setkey() argument 1166 safexcel_hmac_setkey(struct safexcel_context * base,const u8 * key,unsigned int keylen,const char * alg,unsigned int state_sz) safexcel_hmac_setkey() argument 1189 safexcel_hmac_alg_setkey(struct crypto_ahash * tfm,const u8 * key,unsigned int keylen,const char * alg,unsigned int state_sz) safexcel_hmac_alg_setkey() argument 2639 safexcel_hmac_sha3_cra_init(struct crypto_tfm * tfm,const char * alg) safexcel_hmac_sha3_cra_init() argument [all...] |
| /linux/drivers/crypto/allwinner/sun8i-ss/ |
| H A D | sun8i-ss-hash.c | 98 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() 200 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_final() 203 algt = container_of(alg, struct sun8i_ss_alg_template, in sun8i_ss_hash_final() 204 alg.hash.base); in sun8i_ss_hash_final() 243 struct ahash_alg *alg = crypto_ahash_alg(tfm); in sun8i_ss_hash_finup() 246 algt = container_of(alg, struct sun8i_ss_alg_template, in sun8i_ss_hash_finup() 247 alg.hash.base); in sun8i_ss_hash_finup() 271 struct ahash_alg *alg in sun8i_ss_hash_digest_fb() 201 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_final() local 244 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_finup() local 272 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_digest_fb() local 348 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_need_fallback() local 398 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_digest() local 484 struct ahash_alg *alg = crypto_ahash_alg(tfm); sun8i_ss_hash_run() local [all...] |