/external/openssh/ |
D | ssh-rsa.c | 40 rsa_hash_alg_ident(int hash_alg) in rsa_hash_alg_ident() argument 42 switch (hash_alg) { in rsa_hash_alg_ident() 89 int nid, hash_alg, ret = SSH_ERR_INTERNAL_ERROR; in ssh_rsa_sign() local 98 hash_alg = SSH_DIGEST_SHA1; in ssh_rsa_sign() 100 hash_alg = rsa_hash_alg_from_ident(alg_ident); in ssh_rsa_sign() 101 if (key == NULL || key->rsa == NULL || hash_alg == -1 || in ssh_rsa_sign() 110 nid = rsa_hash_alg_nid(hash_alg); in ssh_rsa_sign() 111 if ((dlen = ssh_digest_bytes(hash_alg)) == 0) in ssh_rsa_sign() 113 if ((ret = ssh_digest_memory(hash_alg, data, datalen, in ssh_rsa_sign() 139 if ((ret = sshbuf_put_cstring(b, rsa_hash_alg_ident(hash_alg))) != 0 || in ssh_rsa_sign() [all …]
|
D | ssh-ecdsa.c | 52 int hash_alg; in ssh_ecdsa_sign() local 67 if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 || in ssh_ecdsa_sign() 68 (dlen = ssh_digest_bytes(hash_alg)) == 0) in ssh_ecdsa_sign() 70 if ((ret = ssh_digest_memory(hash_alg, data, datalen, in ssh_ecdsa_sign() 116 int hash_alg; in ssh_ecdsa_verify() local 128 if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 || in ssh_ecdsa_verify() 129 (dlen = ssh_digest_bytes(hash_alg)) == 0) in ssh_ecdsa_verify() 163 if ((ret = ssh_digest_memory(hash_alg, data, datalen, in ssh_ecdsa_verify()
|
D | kexdh.c | 46 int hash_alg, in kex_dh_hash() argument 60 if (*hashlen < ssh_digest_bytes(hash_alg)) in kex_dh_hash() 83 if (ssh_digest_buffer(hash_alg, b, hash, *hashlen) != 0) { in kex_dh_hash() 88 *hashlen = ssh_digest_bytes(hash_alg); in kex_dh_hash()
|
D | kexecdh.c | 51 int hash_alg, in kex_ecdh_hash() argument 66 if (*hashlen < ssh_digest_bytes(hash_alg)) in kex_ecdh_hash() 89 if (ssh_digest_buffer(hash_alg, b, hash, *hashlen) != 0) { in kex_ecdh_hash() 94 *hashlen = ssh_digest_bytes(hash_alg); in kex_ecdh_hash()
|
/external/vboot_reference/firmware/2lib/ |
D | 2sha_utility.c | 63 int vb2_digest_size(enum vb2_hash_algorithm hash_alg) in vb2_digest_size() argument 65 switch (hash_alg) { in vb2_digest_size() 84 enum vb2_hash_algorithm hash_alg) in vb2_digest_init() argument 86 dc->hash_alg = hash_alg; in vb2_digest_init() 89 switch (dc->hash_alg) { in vb2_digest_init() 114 switch (dc->hash_alg) { in vb2_digest_extend() 139 if (digest_size < vb2_digest_size(dc->hash_alg)) in vb2_digest_finalize() 142 switch (dc->hash_alg) { in vb2_digest_finalize()
|
/external/fsverity-utils/ |
D | sign.c | 91 const struct fsverity_hash_alg *hash_alg) in compare_fsverity_digest() argument 95 if (size != sizeof(*d) + hash_alg->digest_size) in compare_fsverity_digest() 98 if (le16_to_cpu(d->digest_algorithm) != hash_alg - fsverity_hash_algs) in compare_fsverity_digest() 101 if (le16_to_cpu(d->digest_size) != hash_alg->digest_size) in compare_fsverity_digest() 104 if (memcmp(expected_digest, d->digest, hash_alg->digest_size)) in compare_fsverity_digest() 217 const struct fsverity_hash_alg *hash_alg) in compare_fsverity_digest_pkcs7() argument 245 expected_measurement, hash_alg); in compare_fsverity_digest_pkcs7() 339 const struct fsverity_hash_alg *hash_alg) in compare_fsverity_digest_pkcs7() argument 363 hash_alg); in compare_fsverity_digest_pkcs7() 381 const struct fsverity_hash_alg *hash_alg, in sign_data() argument [all …]
|
D | cmd_setup.c | 247 desc_auth_len += FSVERITY_EXTLEN(params->hash_alg->digest_size); in append_fsverity_descriptor() 258 desc->data_algorithm = cpu_to_le16(params->hash_alg - in append_fsverity_descriptor() 271 root_hash, params->hash_alg->digest_size); in append_fsverity_descriptor() 400 hash = hash_create(params->hash_alg); in fsveritysetup() 428 bin2hex(measurement, params->hash_alg->digest_size, hash_hex); in fsveritysetup() 429 printf("File measurement: %s:%s\n", params->hash_alg->name, hash_hex); in fsveritysetup() 455 .hash_alg = DEFAULT_HASH_ALG, in fsverity_cmd_setup() 465 params.hash_alg = find_hash_alg_by_name(optarg); in fsverity_cmd_setup() 466 if (!params.hash_alg) in fsverity_cmd_setup() 511 ASSERT(params.hash_alg->digest_size <= FS_VERITY_MAX_DIGEST_SIZE); in fsverity_cmd_setup() [all …]
|
D | cmd_measure.c | 24 const struct fsverity_hash_alg *hash_alg; in fsverity_cmd_measure() local 50 hash_alg = find_hash_alg_by_num(d->digest_algorithm); in fsverity_cmd_measure() 51 if (hash_alg) { in fsverity_cmd_measure() 52 hash_alg_name = hash_alg->name; in fsverity_cmd_measure()
|
/external/vboot_reference/tests/ |
D | vb21_host_key_tests.c | 24 enum vb2_hash_algorithm hash_alg; member 73 key->hash_alg = combo->hash_alg; in private_key_tests() 88 TEST_EQ(k2->hash_alg, key->hash_alg, " hash alg"); in private_key_tests() 156 TEST_SUCC(vb2_private_key_hash(&ckey, combo->hash_alg), "Hash key"); in private_key_tests() 158 TEST_EQ(ckey->hash_alg, combo->hash_alg, " hash_alg"); in private_key_tests() 160 TEST_EQ(memcmp(&ckey->guid, vb2_hash_guid(combo->hash_alg), in private_key_tests() 216 key->hash_alg = combo->hash_alg; in public_key_tests() 222 TEST_EQ(pkey->hash_alg, key->hash_alg, " hash_alg"); in public_key_tests() 244 pkey->hash_alg = VB2_HASH_INVALID; in public_key_tests() 266 TEST_SUCC(vb2_public_key_hash(&k2, combo->hash_alg), "Hash key"); in public_key_tests() [all …]
|
D | vb21_host_keyblock_tests.c | 43 pubk2048->hash_alg = VB2_HASH_SHA256; in keyblock_tests() 49 pubk4096->hash_alg = VB2_HASH_SHA256; in keyblock_tests() 55 pubk8192->hash_alg = VB2_HASH_SHA512; in keyblock_tests() 62 prik4096->hash_alg = VB2_HASH_SHA256; in keyblock_tests() 69 prik8192->hash_alg = VB2_HASH_SHA512; in keyblock_tests() 108 prik8192->hash_alg = VB2_HASH_INVALID; in keyblock_tests()
|
D | vb21_common2_tests.c | 89 key2->hash_alg = VB2_HASH_INVALID; in test_unpack_key() 197 pubk.hash_alg = VB2_HASH_INVALID; in test_verify_data() 224 sig2->hash_alg = (sig2->hash_alg == VB2_HASH_SHA1 ? in test_verify_data() 246 enum vb2_hash_algorithm hash_alg = vb2_crypto_to_hash(key_algorithm); in test_algorithm() local 258 prik->hash_alg = hash_alg; in test_algorithm() 265 pubk->hash_alg = hash_alg; in test_algorithm()
|
D | vb21_host_sig_tests.c | 24 enum vb2_hash_algorithm hash_alg; member 64 prik->hash_alg = combo->hash_alg; in sig_tests() 70 pubk->hash_alg = combo->hash_alg; in sig_tests() 73 TEST_SUCC(vb2_private_key_hash(&prihash, combo->hash_alg), in sig_tests() 75 TEST_SUCC(vb2_public_key_hash(&pubhash, combo->hash_alg), in sig_tests()
|
D | vb20_api_tests.c | 125 key->hash_alg = vb2_crypto_to_hash(k->algorithm); in vb2_unpack_key() 130 int vb2ex_hwcrypto_digest_init(enum vb2_hash_algorithm hash_alg, in vb2ex_hwcrypto_digest_init() argument 137 if (hash_alg != mock_hash_alg) in vb2ex_hwcrypto_digest_init() 166 enum vb2_hash_algorithm hash_alg) in vb2_digest_init() argument 170 if (hash_alg != mock_hash_alg) in vb2_digest_init() 173 dc->hash_alg = hash_alg; in vb2_digest_init() 185 if (dc->hash_alg != mock_hash_alg) in vb2_digest_extend() 327 dc->hash_alg = mock_hash_alg + 1; in extend_hash_tests()
|
/external/epid-sdk/epid/member/tpm2/ibm_tss/ |
D | context.c | 90 tpm_ctx->hash_alg = kInvalidHashAlg; in Tpm2CreateContext() 121 EpidStatus Tpm2SetHashAlg(Tpm2Ctx* ctx, HashAlg hash_alg) { in Tpm2SetHashAlg() argument 123 if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg && in Tpm2SetHashAlg() 124 kSha512_256 != hash_alg) in Tpm2SetHashAlg() 128 ctx->hash_alg = hash_alg; in Tpm2SetHashAlg()
|
/external/epid-sdk/epid/member/tiny/src/ |
D | sethashalg.c | 24 EpidStatus EPID_API EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg) { in EpidMemberSetHashAlg() argument 28 if ((kSha512 != hash_alg) && (kSha256 != hash_alg)) { in EpidMemberSetHashAlg() 31 ctx->hash_alg = hash_alg; in EpidMemberSetHashAlg()
|
/external/vboot_reference/host/lib21/ |
D | host_key.c | 130 key->hash_alg = pkey->hash_alg; in vb2_private_key_unpack() 239 .hash_alg = key->hash_alg, in vb2_private_key_write() 287 enum vb2_hash_algorithm hash_alg) in vb2_private_key_hash() argument 291 switch (hash_alg) { in vb2_private_key_hash() 296 .hash_alg = VB2_HASH_SHA1, in vb2_private_key_hash() 309 .hash_alg = VB2_HASH_SHA256, in vb2_private_key_hash() 322 .hash_alg = VB2_HASH_SHA512, in vb2_private_key_hash() 486 key.hash_alg = pubk->hash_alg; in vb2_public_key_pack() 517 enum vb2_hash_algorithm hash_alg) in vb2_public_key_hash() argument 519 switch (hash_alg) { in vb2_public_key_hash() [all …]
|
D | host_signature.c | 28 static int vb2_digest_info(enum vb2_hash_algorithm hash_alg, in vb2_digest_info() argument 35 switch (hash_alg) { in vb2_digest_info() 91 .hash_alg = key->hash_alg, in vb2_sign_data() 113 s.sig_size = vb2_sig_size(key->sig_alg, key->hash_alg); in vb2_sign_data() 121 if (vb2_digest_info(s.hash_alg, &info, &info_size)) in vb2_sign_data() 125 digest_size = vb2_digest_size(key->hash_alg); in vb2_sign_data() 139 if (vb2_digest_init(&dc, s.hash_alg)) { in vb2_sign_data() 187 uint32_t size = vb2_sig_size(key->sig_alg, key->hash_alg); in vb2_sig_size_for_key()
|
/external/epid-sdk/epid/member/tpm2/src/ |
D | context.c | 106 EpidStatus Tpm2SetHashAlg(Tpm2Ctx* ctx, HashAlg hash_alg) { in Tpm2SetHashAlg() argument 108 if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg && in Tpm2SetHashAlg() 109 kSha512_256 != hash_alg) in Tpm2SetHashAlg() 111 ctx->hash_alg = hash_alg; in Tpm2SetHashAlg()
|
/external/epid-sdk/epid/member/src/ |
D | context.c | 65 ctx->hash_alg = kSha512; in EpidMemberInit() 67 ctx->hash_alg = kSha256; in EpidMemberInit() 117 sts = Tpm2SetHashAlg(ctx->tpm2_ctx, ctx->hash_alg); in EpidMemberInit() 222 EpidStatus EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg) { in EpidMemberSetHashAlg() argument 225 if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg && in EpidMemberSetHashAlg() 226 kSha512_256 != hash_alg) in EpidMemberSetHashAlg() 229 sts = Tpm2SetHashAlg(ctx->tpm2_ctx, hash_alg); in EpidMemberSetHashAlg() 231 ctx->hash_alg = hash_alg; in EpidMemberSetHashAlg()
|
D | join.c | 58 if (kSha256 != ctx->hash_alg && kSha384 != ctx->hash_alg && in EpidCreateJoinRequest() 59 kSha512 != ctx->hash_alg && kSha512_256 != ctx->hash_alg) { in EpidCreateJoinRequest() 107 sts = HashJoinCommitment(ctx->epid2_params->Fp, ctx->hash_alg, pub_key, in EpidCreateJoinRequest() 112 digest_size = EpidGetHashSize(ctx->hash_alg); in EpidCreateJoinRequest()
|
/external/epid-sdk/epid/member/tiny/math/src/ |
D | hashwrap.c | 33 s->hash_alg = kInvalidHashAlg; in tinysha_init() 36 s->hash_alg = sha_type; in tinysha_init() 40 switch (s->hash_alg) { in tinysha_update() 57 switch (s->hash_alg) { in tinysha_final() 74 switch (s->hash_alg) { in tinysha_digest_size()
|
/external/vboot_reference/firmware/lib21/ |
D | api.c | 97 rv = vb2ex_hwcrypto_digest_init(sig->hash_alg, sig->data_size); in vb2api_init_hash2() 100 sig->hash_alg); in vb2api_init_hash2() 101 dc->hash_alg = sig->hash_alg; in vb2api_init_hash2() 108 sig->hash_alg); in vb2api_init_hash2() 113 return vb2_digest_init(dc, sig->hash_alg); in vb2api_init_hash2() 124 uint32_t digest_size = vb2_digest_size(dc->hash_alg); in vb2api_check_hash()
|
D | common.c | 130 enum vb2_hash_algorithm hash_alg) in vb2_sig_size() argument 132 uint32_t digest_size = vb2_digest_size(hash_alg); in vb2_sig_size() 145 const struct vb2_guid *vb2_hash_guid(enum vb2_hash_algorithm hash_alg) in vb2_hash_guid() argument 147 switch(hash_alg) { in vb2_hash_guid() 210 expect_sig_size = vb2_sig_size(sig->sig_alg, sig->hash_alg); in vb2_verify_signature() 232 uint32_t key_sig_size = vb2_sig_size(key->sig_alg, key->hash_alg); in vb2_verify_digest() 239 if (key->sig_alg != sig->sig_alg || key->hash_alg != sig->hash_alg) in vb2_verify_digest() 278 digest_size = vb2_digest_size(key->hash_alg); in vb2_verify_data() 291 rv = vb2_digest_init(dc, key->hash_alg); in vb2_verify_data()
|
/external/vboot_reference/firmware/lib20/ |
D | api.c | 104 rv = vb2ex_hwcrypto_digest_init(key.hash_alg, in vb2api_init_hash() 108 key.hash_alg); in vb2api_init_hash() 109 dc->hash_alg = key.hash_alg; in vb2api_init_hash() 116 key.hash_alg); in vb2api_init_hash() 121 return vb2_digest_init(dc, key.hash_alg); in vb2api_init_hash() 132 uint32_t digest_size = vb2_digest_size(dc->hash_alg); in vb2api_check_hash()
|
/external/epid-sdk/epid/member/unittests/ |
D | iskeyvalid-test.cc | 42 HashAlg hash_alg = kSha256; in TEST_F() local 46 THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg)); in TEST_F() 70 HashAlg hash_alg = kSha256; in TEST_F() local 74 THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg)); in TEST_F() 89 HashAlg hash_alg = kSha256; in TEST_F() local 93 THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg)); in TEST_F() 147 HashAlg hash_alg = kSha256; in TEST_F() local 194 THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg)); in TEST_F()
|