/kernel/linux/linux-6.6/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() 54 if (copy_to_user(uarg->digest, vi->file_digest, 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() [all...] |
H A D | signature.c | 90 const struct fsverity_hash_alg *hash_alg = vi->tree_params.hash_alg; in fsverity_verify_signature() local 119 d = kzalloc(sizeof(*d) + hash_alg->digest_size, GFP_KERNEL); in fsverity_verify_signature() 123 d->digest_algorithm = cpu_to_le16(hash_alg - fsverity_hash_algs); in fsverity_verify_signature() 124 d->digest_size = cpu_to_le16(hash_alg->digest_size); in fsverity_verify_signature() 125 memcpy(d->digest, vi->file_digest, hash_alg->digest_size); in fsverity_verify_signature() 134 err = verify_pkcs7_signature(d, sizeof(*d) + hash_alg->digest_size, in fsverity_verify_signature()
|
H A D | open.c | 37 const struct fsverity_hash_alg *hash_alg; in fsverity_init_merkle_tree_params() local 46 hash_alg = fsverity_get_hash_alg(inode, hash_algorithm); in fsverity_init_merkle_tree_params() 47 if (IS_ERR(hash_alg)) in fsverity_init_merkle_tree_params() 48 return PTR_ERR(hash_alg); in fsverity_init_merkle_tree_params() 49 params->hash_alg = hash_alg; in fsverity_init_merkle_tree_params() 50 params->digest_size = hash_alg->digest_size; in fsverity_init_merkle_tree_params() 52 params->hashstate = fsverity_prepare_hash_state(hash_alg, salt, in fsverity_init_merkle_tree_params() 95 params->block_size, hash_alg->name); in fsverity_init_merkle_tree_params() 163 static int compute_file_digest(const struct fsverity_hash_alg *hash_alg, in compute_file_digest() argument [all...] |
H A D | hash_algs.c | 181 SHASH_DESC_ON_STACK(desc, params->hash_alg->tfm); in fsverity_hash_block() 184 desc->tfm = params->hash_alg->tfm; in fsverity_hash_block()
|
/kernel/linux/linux-5.10/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() 54 if (copy_to_user(uarg->digest, vi->measurement, hash_alg->digest_size)) in fsverity_ioctl_measure()
|
H A D | signature.c | 83 const struct fsverity_hash_alg *hash_alg = vi->tree_params.hash_alg; in fsverity_verify_signature() local 118 d = kzalloc(sizeof(*d) + hash_alg->digest_size, GFP_KERNEL); in fsverity_verify_signature() 122 d->digest_algorithm = cpu_to_le16(hash_alg - fsverity_hash_algs); in fsverity_verify_signature() 123 d->digest_size = cpu_to_le16(hash_alg->digest_size); in fsverity_verify_signature() 124 memcpy(d->digest, vi->measurement, hash_alg->digest_size); in fsverity_verify_signature() 133 err = verify_pkcs7_signature(d, sizeof(*d) + hash_alg->digest_size, in fsverity_verify_signature() 155 hash_alg->name, hash_alg->digest_size, vi->measurement); in fsverity_verify_signature()
|
H A D | open.c | 36 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() 75 params->block_size, hash_alg->name); in fsverity_init_merkle_tree_params() 83 hash_alg in fsverity_init_merkle_tree_params() 132 compute_file_measurement(struct fsverity_hash_alg *hash_alg, struct fsverity_descriptor *desc, u8 *measurement) compute_file_measurement() argument [all...] |
H A D | verify.c | 64 vi->tree_params.hash_alg->name, hsize, want_hash, in cmp_hashes() 65 vi->tree_params.hash_alg->name, hsize, real_hash); in cmp_hashes() 143 params->hash_alg->name, in verify_page() 154 params->hash_alg->name, hsize, want_hash); in verify_page() 172 level - 1, params->hash_alg->name, hsize, want_hash); in verify_page() 204 req = fsverity_alloc_hash_request(vi->tree_params.hash_alg, GFP_NOFS); in fsverity_verify_page() 208 fsverity_free_hash_request(vi->tree_params.hash_alg, req); in fsverity_verify_page() 241 req = fsverity_alloc_hash_request(params->hash_alg, GFP_NOFS); in fsverity_verify_bio() 269 fsverity_free_hash_request(params->hash_alg, req); in fsverity_verify_bio()
|
/kernel/linux/linux-5.10/drivers/crypto/bcm/ |
H A D | spu.h | 55 enum hash_alg { enum 127 enum hash_alg alg; 228 u16 spum_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, 238 u32 spum_digest_size(u32 alg_digest_size, enum hash_alg alg, 259 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() 417 * @hash_alg: hash algorithm 426 u16 spum_hash_pad_len(enum hash_alg hash_al argument [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 | 100 enum hash_alg alg; 366 u16 (*spu_hash_pad_len)(enum hash_alg hash_alg, 377 u32 (*spu_digest_size)(u32 digest_size, enum hash_alg alg, 393 u32 hash_pad_len, enum hash_alg auth_alg,
|
H A D | spu2.c | 224 * @hash_alg: [in] hash algorithm value from software enumeration 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() 832 * @hash_alg: hash algorithm 841 u16 spu2_hash_pad_len(enum hash_alg hash_alg, enum hash_mode hash_mode, in spu2_hash_pad_len() argument 917 u32 spu2_digest_size(u32 alg_digest_size, enum hash_alg alg, in spu2_digest_size() 1243 enum hash_alg auth_al in spu2_request_pad() [all...] |
/kernel/linux/linux-6.6/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() 415 * @hash_alg: hash algorithm 424 u16 spum_hash_pad_len(enum hash_alg hash_al argument [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 | 224 * @hash_alg: [in] hash algorithm value from software enumeration 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() 835 * @hash_alg: hash algorithm 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_al in spu2_request_pad() [all...] |
/kernel/linux/linux-5.10/crypto/ |
H A D | essiv.c | 413 struct shash_alg *hash_alg, in essiv_supported_algorithms() 425 if (hash_alg->digestsize < alg->cra_cipher.cia_min_keysize || in essiv_supported_algorithms() 426 hash_alg->digestsize > alg->cra_cipher.cia_max_keysize) in essiv_supported_algorithms() 432 if (crypto_shash_alg_needs_key(hash_alg)) in essiv_supported_algorithms() 455 struct shash_alg *hash_alg; in essiv_create() local 538 hash_alg = __crypto_shash_alg(_hash_alg); in essiv_create() 541 if (!essiv_supported_algorithms(ictx->essiv_cipher_name, hash_alg, in essiv_create() 544 block_base->cra_name, hash_alg->base.cra_name); in essiv_create() 550 strlcpy(ictx->shash_driver_name, hash_alg->base.cra_driver_name, in essiv_create() 558 hash_alg in essiv_create() 412 essiv_supported_algorithms(const char *essiv_cipher_name, struct shash_alg *hash_alg, int ivsize) essiv_supported_algorithms() argument [all...] |
H A D | adiantum.c | 473 struct shash_alg *hash_alg) in adiantum_supported_algorithms() 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() 471 adiantum_supported_algorithms(struct skcipher_alg *streamcipher_alg, struct crypto_alg *blockcipher_alg, struct shash_alg *hash_alg) adiantum_supported_algorithms() argument
|
/kernel/linux/linux-6.6/crypto/ |
H A D | essiv.c | 414 struct shash_alg *hash_alg, in essiv_supported_algorithms() 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() 542 if (!essiv_supported_algorithms(ictx->essiv_cipher_name, 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 in essiv_create() 413 essiv_supported_algorithms(const char *essiv_cipher_name, struct shash_alg *hash_alg, int ivsize) essiv_supported_algorithms() argument [all...] |
H A D | adiantum.c | 473 struct shash_alg *hash_alg) in adiantum_supported_algorithms() 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() 471 adiantum_supported_algorithms(struct skcipher_alg *streamcipher_alg, struct crypto_alg *blockcipher_alg, struct shash_alg *hash_alg) adiantum_supported_algorithms() argument
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-6.6/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()
|
/kernel/linux/linux-6.6/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()
|