| /linux/crypto/ |
| H A D | api.c | 38 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() 62 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local 83 if (alg) in __crypto_alg_lookup() 84 crypto_mod_put(alg); in __crypto_alg_lookup() 85 alg = q; in __crypto_alg_lookup() [all …]
|
| H A D | testmgr.c | 64 int alg_test(const char *driver, const char *alg, u32 type, u32 mask) in alg_test() argument 141 const char *alg; member 145 int fips_allowed; /* set if alg is allowed in fips mode */ 1236 pr_err("alg: generic driver name for \"%s\" would be too long\n", in build_generic_driver_name() 1265 pr_err("alg: %s: %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", in check_hash_result() 1270 pr_err("alg: %s: %s overran result buffer on test vector %s, cfg=\"%s\"\n", in check_hash_result() 1282 pr_err("alg: shash: %s %s() failed with err %d on test vector %s, cfg=\"%s\"\n", in check_shash_op() 1311 …pr_err("alg: shash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=… in test_shash_vec_cfg() 1317 pr_err("alg: shash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", in test_shash_vec_cfg() 1326 pr_err("alg: shash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", in test_shash_vec_cfg() [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.setkey = essiv_skcipher_setkey; in essiv_create() [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()
|
| /linux/tools/crypto/tcrypt/ |
| H A D | tcrypt_speed_compare.py | 33 modprobe tcrypt alg="pcrypt(rfc4106(gcm(aes)))" type=3 40 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 | 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/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/drivers/crypto/bcm/ |
| H A D | cipher.c | 323 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req() 382 * any other cipher alg. in handle_skcipher_req() 413 0, ctx->auth.alg, ctx->auth.mode, in handle_skcipher_req() 500 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp() 700 hash_parms.alg = ctx->auth.alg; in handle_ahash_req() 769 if (hash_parms.alg == HASH_ALG_AES) in handle_ahash_req() 774 digestsize = spu->spu_digest_size(ctx->digestsize, ctx->auth.alg, in handle_ahash_req() 784 hash_parms.pad_len = spu->spu_hash_pad_len(hash_parms.alg, in handle_ahash_req() 794 (hash_parms.alg != HASH_ALG_AES)) { in handle_ahash_req() 841 hash_parms.pad_len, ctx->auth.alg, in handle_ahash_req() [all …]
|
| 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/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() 577 LIBIPW_DEBUG_WX("%s: unknown crypto alg %d\n", 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() [all …]
|
| /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 49 u32 alg; member 73 unsigned int alg; member 122 if (ctx->alg == SE_ALG_CBC) { in tegra_aes_update_iv() 124 } else if (ctx->alg == SE_ALG_CTR) { in tegra_aes_update_iv() 133 static int tegra234_aes_crypto_cfg(u32 alg, bool encrypt) in tegra234_aes_crypto_cfg() argument 135 switch (alg) { in tegra234_aes_crypto_cfg() 169 static int tegra234_aes_cfg(u32 alg, bool encrypt) in tegra234_aes_cfg() argument 171 switch (alg) { in tegra234_aes_cfg() 273 rctx->iv = (ctx->alg == SE_ALG_ECB) ? NULL : (u32 *)req->iv; in tegra_aes_do_one_req() [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/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/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/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/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/amcc/ |
| H A D | crypto4xx_core.c | 908 struct skcipher_alg *alg = crypto_skcipher_alg(sk); in crypto4xx_sk_init() local 912 if (alg->base.cra_flags & CRYPTO_ALG_NEED_FALLBACK) { in crypto4xx_sk_init() 914 crypto_alloc_sync_skcipher(alg->base.cra_name, 0, in crypto4xx_sk_init() 920 amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher); in crypto4xx_sk_init() 941 struct aead_alg *alg = crypto_aead_alg(tfm); in crypto4xx_aead_init() local 945 ctx->sw_cipher.aead = crypto_alloc_aead(alg->base.cra_name, 0, in crypto4xx_aead_init() 951 amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.aead); in crypto4xx_aead_init() 971 struct crypto4xx_alg *alg; in crypto4xx_register_alg() local 976 alg = kzalloc_obj(struct crypto4xx_alg); in crypto4xx_register_alg() 977 if (!alg) in crypto4xx_register_alg() [all …]
|
| /linux/lib/crypto/tests/ |
| H A D | sha3_kunit.c | 250 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/ |
| 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/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 == CONTEXT_CONTROL_CRYPTO_ALG_MD5 && in safexcel_ahash_final() [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() local 10 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()
|