/openbmc/linux/fs/verity/ |
H A D | measure.c | 28 const struct fsverity_hash_alg *hash_alg; in fsverity_ioctl_measure() local 34 hash_alg = vi->tree_params.hash_alg; in fsverity_ioctl_measure() 44 if (arg.digest_size < hash_alg->digest_size) in fsverity_ioctl_measure() 48 arg.digest_algorithm = hash_alg - fsverity_hash_algs; in fsverity_ioctl_measure() 49 arg.digest_size = hash_alg->digest_size; in fsverity_ioctl_measure() 88 const struct fsverity_hash_alg *hash_alg; in fsverity_get_digest() local 94 hash_alg = vi->tree_params.hash_alg; in fsverity_get_digest() 95 memcpy(raw_digest, vi->file_digest, hash_alg->digest_size); in fsverity_get_digest() 97 *alg = hash_alg - fsverity_hash_algs; in fsverity_get_digest() 99 *halg = hash_alg->algo_id; in fsverity_get_digest() [all …]
|
H A D | signature.c | 52 const struct fsverity_hash_alg *hash_alg = vi->tree_params.hash_alg; in fsverity_verify_signature() local 81 d = kzalloc(sizeof(*d) + hash_alg->digest_size, GFP_KERNEL); in fsverity_verify_signature() 85 d->digest_algorithm = cpu_to_le16(hash_alg - fsverity_hash_algs); in fsverity_verify_signature() 86 d->digest_size = cpu_to_le16(hash_alg->digest_size); in fsverity_verify_signature() 87 memcpy(d->digest, vi->file_digest, hash_alg->digest_size); in fsverity_verify_signature() 89 err = verify_pkcs7_signature(d, sizeof(*d) + hash_alg->digest_size, in fsverity_verify_signature()
|
H A D | open.c | 35 const struct fsverity_hash_alg *hash_alg; in fsverity_init_merkle_tree_params() local 44 hash_alg = fsverity_get_hash_alg(inode, hash_algorithm); in fsverity_init_merkle_tree_params() 45 if (IS_ERR(hash_alg)) in fsverity_init_merkle_tree_params() 46 return PTR_ERR(hash_alg); in fsverity_init_merkle_tree_params() 47 params->hash_alg = hash_alg; in fsverity_init_merkle_tree_params() 48 params->digest_size = hash_alg->digest_size; in fsverity_init_merkle_tree_params() 50 params->hashstate = fsverity_prepare_hash_state(hash_alg, salt, in fsverity_init_merkle_tree_params() 93 params->block_size, hash_alg->name); in fsverity_init_merkle_tree_params() 161 static int compute_file_digest(const struct fsverity_hash_alg *hash_alg, in compute_file_digest() argument 169 err = fsverity_hash_buffer(hash_alg, desc, sizeof(*desc), file_digest); in compute_file_digest() [all …]
|
H A D | hash_algs.c | 179 SHASH_DESC_ON_STACK(desc, params->hash_alg->tfm); in fsverity_hash_block() 182 desc->tfm = params->hash_alg->tfm; in fsverity_hash_block()
|
H A D | verify.c | 235 params->hash_alg->name, hsize, want_hash, in verify_data_block() 236 params->hash_alg->name, hsize, real_hash); in verify_data_block()
|
H A D | fsverity_private.h | 36 const struct fsverity_hash_alg *hash_alg; /* the hash algorithm */ member
|
/openbmc/linux/drivers/crypto/bcm/ |
H A D | spu.h | 56 enum hash_alg { enum 128 enum hash_alg alg; 229 u16 spum_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, 239 u32 spum_digest_size(u32 alg_digest_size, enum hash_alg alg, 260 enum hash_alg auth_alg,
|
H A D | spu.c | 34 u32 hash_alg; in spum_dump_msg_hdr() local 81 hash_alg = (cflags & HASH_ALG) >> HASH_ALG_SHIFT; in spum_dump_msg_hdr() 85 hash_alg, hash_mode, hash_type); in spum_dump_msg_hdr() 106 if (hash_alg && hash_mode) { in spum_dump_msg_hdr() 109 switch (hash_alg) { in spum_dump_msg_hdr() 146 } else if ((hash_alg == HASH_ALG_AES) && in spum_dump_msg_hdr() 170 if (hash_alg && (hash_mode == HASH_MODE_NONE) && in spum_dump_msg_hdr() 174 switch (hash_alg) { in spum_dump_msg_hdr() 424 u16 spum_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, in spum_hash_pad_len() argument 441 if ((hash_alg == HASH_ALG_SHA384) || (hash_alg == HASH_ALG_SHA512)) in spum_hash_pad_len() [all …]
|
H A D | spu2.h | 180 u16 spu2_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, 190 u32 spu2_digest_size(u32 alg_digest_size, enum hash_alg alg, 205 enum hash_alg auth_alg, enum hash_mode auth_mode,
|
H A D | cipher.h | 101 enum hash_alg alg; 364 u16 (*spu_hash_pad_len)(enum hash_alg hash_alg, 375 u32 (*spu_digest_size)(u32 digest_size, enum hash_alg alg, 391 u32 hash_pad_len, enum hash_alg auth_alg,
|
H A D | spu2.c | 234 spu2_hash_xlate(enum hash_alg hash_alg, enum hash_mode hash_mode, in spu2_hash_xlate() argument 246 switch (hash_alg) { in spu2_hash_xlate() 303 hash_alg, hash_type); in spu2_hash_xlate() 844 u16 spu2_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, in spu2_hash_pad_len() argument 922 u32 spu2_digest_size(u32 alg_digest_size, enum hash_alg alg, in spu2_digest_size() 1246 enum hash_alg auth_alg, enum hash_mode auth_mode, in spu2_request_pad()
|
/openbmc/linux/crypto/ |
H A D | essiv.c | 414 struct shash_alg *hash_alg, in essiv_supported_algorithms() argument 426 if (hash_alg->digestsize < alg->cra_cipher.cia_min_keysize || in essiv_supported_algorithms() 427 hash_alg->digestsize > alg->cra_cipher.cia_max_keysize) in essiv_supported_algorithms() 433 if (crypto_shash_alg_needs_key(hash_alg)) in essiv_supported_algorithms() 456 struct shash_alg *hash_alg; in essiv_create() local 539 hash_alg = __crypto_shash_alg(_hash_alg); in essiv_create() 545 block_base->cra_name, hash_alg->base.cra_name); in essiv_create() 551 strscpy(ictx->shash_driver_name, hash_alg->base.cra_driver_name, in essiv_create() 559 hash_alg->base.cra_name) >= CRYPTO_MAX_ALG_NAME) in essiv_create() 563 hash_alg->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in essiv_create() [all …]
|
H A D | adiantum.c | 473 struct shash_alg *hash_alg) in adiantum_supported_algorithms() argument 485 if (strcmp(hash_alg->base.cra_name, "nhpoly1305") != 0) in adiantum_supported_algorithms() 499 struct shash_alg *hash_alg; in adiantum_create() local 536 hash_alg = crypto_spawn_shash_alg(&ictx->hash_spawn); in adiantum_create() 540 hash_alg)) { in adiantum_create() 543 blockcipher_alg->cra_name, hash_alg->base.cra_name); in adiantum_create() 559 hash_alg->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in adiantum_create() 565 hash_alg->base.cra_alignmask; in adiantum_create() 573 2 * hash_alg->base.cra_priority + in adiantum_create()
|
/openbmc/qemu/crypto/ |
H A D | block-luks.c | 144 QCryptoHashAlgorithm hash_alg; member 648 luks->hash_alg = in qcrypto_block_luks_parse_header() 774 if (qcrypto_pbkdf2(luks->hash_alg, in qcrypto_block_luks_store_key() 911 if (qcrypto_pbkdf2(luks->hash_alg, in qcrypto_block_luks_load_key() 1002 if (qcrypto_pbkdf2(luks->hash_alg, in qcrypto_block_luks_load_key() 1246 block->kdfhash = luks->hash_alg; in qcrypto_block_luks_open() 1315 const char *hash_alg; in qcrypto_block_luks_create() local 1350 luks->hash_alg = luks_opts.hash_alg; in qcrypto_block_luks_create() 1395 hash_alg = QCryptoHashAlgorithm_str(luks_opts.hash_alg); in qcrypto_block_luks_create() 1410 hash_alg); in qcrypto_block_luks_create() [all …]
|
H A D | akcipher-nettle.c.inc | 37 QCryptoHashAlgorithm hash_alg; 278 switch (rsa->hash_alg) { 296 error_setg(errp, "Unknown hash algorithm: %d", rsa->hash_alg); 343 switch (rsa->hash_alg) { 361 error_setg(errp, "Unsupported hash algorithm: %d", rsa->hash_alg); 394 rsa->hash_alg = opt->hash_alg; 431 switch (opts->u.rsa.hash_alg) {
|
H A D | akcipher-gcrypt.c.inc | 36 QCryptoHashAlgorithm hash_alg; 420 QCryptoHashAlgorithm_str(rsa->hash_alg), 500 QCryptoHashAlgorithm_str(rsa->hash_alg), 539 rsa->hash_alg = opt->hash_alg; 577 switch (opts->u.rsa.hash_alg) {
|
/openbmc/qemu/tests/unit/ |
H A D | test-crypto-block.c | 102 .hash_alg = QCRYPTO_HASH_ALG_SHA1, 117 QCryptoHashAlgorithm hash_alg; member 146 .hash_alg = QCRYPTO_HASH_ALG_SHA256, 161 .hash_alg = QCRYPTO_HASH_ALG_SHA256, 176 .hash_alg = QCRYPTO_HASH_ALG_SHA1, 262 g_assert_cmpint(data->hash_alg, ==, in test_block_assert_setup() 576 !qcrypto_hash_supports(test_data[i].hash_alg)) { in main()
|
H A D | test-crypto-akcipher.c | 811 .hash_alg = QCRYPTO_HASH_ALG_SHA1, 856 .hash_alg = QCRYPTO_HASH_ALG_SHA1, 950 .hash_alg = QCRYPTO_HASH_ALG_SHA1, in test_rsakey()
|
/openbmc/linux/drivers/char/tpm/ |
H A D | tpm2-cmd.c | 144 __be16 hash_alg; member 543 __be16 hash_alg; member 558 u16 hash_alg; in tpm2_get_pcr_allocation() local 600 hash_alg = be16_to_cpu(pcr_selection.hash_alg); in tpm2_get_pcr_allocation() 605 chip->allocated_banks[nr_alloc_banks].alg_id = hash_alg; in tpm2_get_pcr_allocation() 614 sizeof_pcr_selection = sizeof(pcr_selection.hash_alg) + in tpm2_get_pcr_allocation()
|
/openbmc/u-boot/lib/ |
H A D | tpm-v2.c | 57 u16 l = tpm2_algorithm_to_len(digest_list->digests[i].hash_alg); in tcg2_event_get_size() 124 digest_list->digests[digest_list->count].hash_alg = in tcg2_create_digest() 153 u16 hash_alg = digest_list->digests[i].hash_alg; in tcg2_log_append() local 155 len = tpm2_algorithm_to_len(hash_alg); in tcg2_log_append() 159 pos += offsetof(struct tpmt_ha, hash_alg); in tcg2_log_append() 160 put_unaligned_le16(hash_alg, log + pos); in tcg2_log_append() 315 pos += offsetof(struct tpmt_ha, hash_alg); in tcg2_replay_eventlog() 333 if (algo != digest_list->digests[i].hash_alg || in tcg2_replay_eventlog() 442 digest_list.digests[digest_list.count++].hash_alg = algo; in tcg2_log_parse() 486 u32 alg = digest_list->digests[i].hash_alg; in tcg2_pcr_extend() [all …]
|
/openbmc/qemu/backends/ |
H A D | cryptodev-builtin.c | 196 int hash_alg; in cryptodev_builtin_set_rsa_options() local 198 hash_alg = cryptodev_builtin_get_rsa_hash_algo(virtio_hash_algo, errp); in cryptodev_builtin_set_rsa_options() 199 if (hash_alg < 0) { in cryptodev_builtin_set_rsa_options() 202 opt->hash_alg = hash_alg; in cryptodev_builtin_set_rsa_options()
|
H A D | cryptodev-lkcf.c | 145 QCryptoHashAlgorithm_str(rsa_opt->hash_alg)); in cryptodev_lkcf_set_op_desc() 164 opt->hash_alg = QCRYPTO_HASH_ALG_MD5; in cryptodev_lkcf_set_rsa_opt() 168 opt->hash_alg = QCRYPTO_HASH_ALG_SHA1; in cryptodev_lkcf_set_rsa_opt() 172 opt->hash_alg = QCRYPTO_HASH_ALG_SHA256; in cryptodev_lkcf_set_rsa_opt() 176 opt->hash_alg = QCRYPTO_HASH_ALG_SHA512; in cryptodev_lkcf_set_rsa_opt()
|
/openbmc/linux/security/keys/trusted-keys/ |
H A D | trusted_tpm1.c | 26 static const char hash_alg[] = "sha1"; variable 59 pr_info("can't alloc %s\n", hash_alg); in TSS_sha1() 132 pr_info("can't alloc %s\n", hash_alg); in TSS_authhmac() 208 pr_info("can't alloc %s\n", hash_alg); in TSS_checkhmac1() 301 pr_info("can't alloc %s\n", hash_alg); in TSS_checkhmac2() 1000 hashalg = crypto_alloc_shash(hash_alg, 0, 0); in trusted_shash_alloc() 1003 hash_alg); in trusted_shash_alloc()
|
/openbmc/linux/drivers/crypto/inside-secure/ |
H A D | safexcel_cipher.c | 63 u32 hash_alg; member 464 switch (ctx->hash_alg) { in safexcel_aead_setkey() 522 ctx->hash_alg | in safexcel_context_control() 532 ctx->hash_alg | in safexcel_context_control() 540 ctx->hash_alg | in safexcel_context_control() 1746 ctx->hash_alg = CONTEXT_CONTROL_CRYPTO_ALG_SHA1; in safexcel_aead_sha1_cra_init() 1782 ctx->hash_alg = CONTEXT_CONTROL_CRYPTO_ALG_SHA256; in safexcel_aead_sha256_cra_init() 1818 ctx->hash_alg = CONTEXT_CONTROL_CRYPTO_ALG_SHA224; in safexcel_aead_sha224_cra_init() 2636 ctx->hash_alg = CONTEXT_CONTROL_CRYPTO_ALG_GHASH; in safexcel_aead_gcm_cra_init() 3347 ctx->hash_alg = CONTEXT_CONTROL_CRYPTO_ALG_SHA1; in safexcel_aead_sm4cbc_sha1_cra_init() [all …]
|
/openbmc/qemu/tests/bench/ |
H A D | benchmark-crypto-akcipher.c | 30 opt.u.rsa.hash_alg = hash; in create_rsa_akcipher()
|