Home
last modified time | relevance | path

Searched refs:digest (Results 1 – 25 of 65) sorted by relevance

123

/system/keymaster/
Drsa_operation.h36 RsaOperation(keymaster_purpose_t purpose, keymaster_digest_t digest, in RsaOperation() argument
38 : Operation(purpose), rsa_key_(key), padding_(padding), digest_(digest), in RsaOperation()
50 keymaster_digest_t digest() const { return digest_; } in digest() function
75 RsaDigestingOperation(keymaster_purpose_t purpose, keymaster_digest_t digest,
90 RsaSignOperation(keymaster_digest_t digest, keymaster_padding_t padding, EVP_PKEY* key) in RsaSignOperation() argument
91 : RsaDigestingOperation(KM_PURPOSE_SIGN, digest, padding, key) {} in RsaSignOperation()
112 RsaVerifyOperation(keymaster_digest_t digest, keymaster_padding_t padding, EVP_PKEY* key) in RsaVerifyOperation() argument
113 : RsaDigestingOperation(KM_PURPOSE_VERIFY, digest, padding, key) {} in RsaVerifyOperation()
134 RsaCryptOperation(keymaster_purpose_t purpose, keymaster_digest_t digest, in RsaCryptOperation() argument
136 : RsaOperation(purpose, digest, padding, key) {} in RsaCryptOperation()
[all …]
Decdsa_operation.h31 EcdsaOperation(keymaster_purpose_t purpose, keymaster_digest_t digest, EVP_PKEY* key) in EcdsaOperation() argument
32 : Operation(purpose), digest_(digest), ecdsa_key_(key) { in EcdsaOperation()
52 EcdsaSignOperation(keymaster_digest_t digest, EVP_PKEY* key) in EcdsaSignOperation() argument
53 : EcdsaOperation(KM_PURPOSE_SIGN, digest, key) {} in EcdsaSignOperation()
66 EcdsaVerifyOperation(keymaster_digest_t digest, EVP_PKEY* key) in EcdsaVerifyOperation() argument
67 : EcdsaOperation(KM_PURPOSE_VERIFY, digest, key) {} in EcdsaVerifyOperation()
86 virtual Operation* InstantiateOperation(keymaster_digest_t digest, EVP_PKEY* key) = 0;
92 Operation* InstantiateOperation(keymaster_digest_t digest, EVP_PKEY* key) { in InstantiateOperation() argument
93 return new (std::nothrow) EcdsaSignOperation(digest, key); in InstantiateOperation()
100 Operation* InstantiateOperation(keymaster_digest_t digest, EVP_PKEY* key) { in InstantiateOperation() argument
[all …]
Dhmac.cpp59 uint8_t* digest = tmp; in Sign() local
61 digest = out_digest; in Sign()
63 if (nullptr == ::HMAC(EVP_sha256(), key_.get(), key_len_, data, data_len, digest, nullptr)) { in Sign()
72 bool HmacSha256::Verify(const Buffer& data, const Buffer& digest) const { in Verify()
73 return Verify(data.peek_read(), data.available_read(), digest.peek_read(), in Verify()
74 digest.available_read()); in Verify()
77 bool HmacSha256::Verify(const uint8_t* data, size_t data_len, const uint8_t* digest, in Verify() argument
86 return 0 == CRYPTO_memcmp(digest, computed_digest, SHA256_DIGEST_LENGTH); in Verify()
Doperation.cpp43 bool OperationFactory::supported(keymaster_digest_t digest) const { in supported()
47 if (digest == supported_digests[i]) in supported()
114 keymaster_digest_t* digest, in GetAndValidateDigest() argument
117 if (!begin_params.GetTagValue(TAG_DIGEST, digest)) { in GetAndValidateDigest()
120 } else if (!supported(*digest)) { in GetAndValidateDigest()
121 LOG_E("Digest %d not supported", *digest); in GetAndValidateDigest()
127 !key.authorizations().Contains(TAG_DIGEST, *digest) && in GetAndValidateDigest()
128 !key.authorizations().Contains(TAG_DIGEST_OLD, *digest)) { in GetAndValidateDigest()
129 LOG_E("Digest %d was specified, but not authorized by key", *digest); in GetAndValidateDigest()
Dhmac_operation.cpp60 keymaster_digest_t digest; in CreateOperation() local
61 if (!key.authorizations().GetTagValue(TAG_DIGEST, &digest)) { in CreateOperation()
70 purpose(), symmetric_key->key_data(), symmetric_key->key_data_size(), digest, in CreateOperation()
92 size_t key_data_size, keymaster_digest_t digest, size_t mac_length, in HmacOperation() argument
100 switch (digest) { in HmacOperation()
170 uint8_t digest[EVP_MAX_MD_SIZE]; in Finish() local
172 if (!HMAC_Final(&ctx_, digest, &digest_len)) in Finish()
179 if (!output->reserve(mac_length_) || !output->write(digest, mac_length_)) in Finish()
188 if (CRYPTO_memcmp(signature.peek_read(), digest, siglen) != 0) in Finish()
Dhmac.h40 bool Sign(const Buffer& data, uint8_t* digest, size_t digest_len) const;
41 bool Sign(const uint8_t* data, size_t data_len, uint8_t* digest, size_t digest_len) const;
49 bool Verify(const Buffer& data, const Buffer& digest) const;
50 bool Verify(const uint8_t* data, size_t data_len, const uint8_t* digest,
Dhmac_test.cpp33 uint8_t digest[32]; member
70 uint8_t digest_copy[sizeof(test.digest)]; in TEST()
71 memcpy(digest_copy, test.digest, sizeof(test.digest)); in TEST()
Dhkdf.cpp67 UniquePtr<uint8_t[]> digest(new uint8_t[digest_size_]); in GenerateKey() local
68 if (buf.get() == nullptr || digest.get() == nullptr) in GenerateKey()
78 memcpy(buf.get(), digest.get(), digest_size_); in GenerateKey()
85 result = hmac.Sign(buf.get(), block_input_len, digest.get(), digest_size_); in GenerateKey()
91 memcpy(output + i * digest_size_, digest.get(), block_output_len); in GenerateKey()
Drsa_key.cpp53 bool RsaKey::SupportedMode(keymaster_purpose_t purpose, keymaster_digest_t digest) { in SupportedMode() argument
57 return digest == KM_DIGEST_NONE || digest == KM_DIGEST_SHA_2_256; in SupportedMode()
Dhmac_key.cpp70 keymaster_digest_t digest; in validate_algorithm_specific_new_key_params() local
71 if (!key_description.GetTagValue(TAG_DIGEST, &digest)) { in validate_algorithm_specific_new_key_params()
77 switch (digest) { in validate_algorithm_specific_new_key_params()
Dandroid_keymaster_test_utils.cpp406 keymaster_digest_t digest) { in SignMessage() argument
409 input_params.push_back(TAG_DIGEST, digest); in SignMessage()
418 keymaster_digest_t digest, keymaster_padding_t padding) { in SignMessage() argument
421 input_params.push_back(TAG_DIGEST, digest); in SignMessage()
442 keymaster_digest_t digest) { in VerifyMessage() argument
445 input_params.push_back(TAG_DIGEST, digest); in VerifyMessage()
453 keymaster_digest_t digest, keymaster_padding_t padding) { in VerifyMessage() argument
456 input_params.push_back(TAG_DIGEST, digest); in VerifyMessage()
487 string Keymaster2Test::EncryptMessage(const string& message, keymaster_digest_t digest, in EncryptMessage() argument
490 return EncryptMessage(update_params, message, digest, padding, generated_nonce); in EncryptMessage()
[all …]
Drsa_keymaster1_operation.cpp118 keymaster_digest_t digest; in CreateOperation() local
119 if (!GetAndValidateDigest(begin_params, key, &digest, error)) in CreateOperation()
133 return new RsaKeymaster1Operation<RsaSignOperation>(digest, padding, rsa.release(), in CreateOperation()
136 return new RsaKeymaster1Operation<RsaDecryptOperation>(digest, padding, rsa.release(), in CreateOperation()
Decdsa_keymaster1_operation.cpp102 keymaster_digest_t digest; in CreateOperation() local
103 if (!GetAndValidateDigest(begin_params, key, &digest, error)) in CreateOperation()
113 return new EcdsaKeymaster1Operation<EcdsaSignOperation>(digest, ecdsa.release(), engine_); in CreateOperation()
Dec_keymaster1_key.cpp37 static bool is_supported(uint32_t digest) { in is_supported() argument
38 return digest == KM_DIGEST_NONE || digest == KM_DIGEST_SHA_2_256; in is_supported()
Drsa_keymaster1_key.cpp39 static bool is_supported(uint32_t digest) { in is_supported() argument
40 return digest == KM_DIGEST_NONE || digest == KM_DIGEST_SHA_2_256; in is_supported()
Dandroid_keymaster_test_utils.h233 void SignMessage(const std::string& message, std::string* signature, keymaster_digest_t digest);
234 void SignMessage(const std::string& message, std::string* signature, keymaster_digest_t digest,
239 keymaster_digest_t digest);
241 keymaster_digest_t digest, keymaster_padding_t padding);
246 std::string EncryptMessage(const std::string& message, keymaster_digest_t digest,
251 keymaster_digest_t digest, keymaster_padding_t padding,
262 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
266 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
271 keymaster_digest_t digest, keymaster_padding_t padding,
277 void CheckHmacTestVector(std::string key, std::string message, keymaster_digest_t digest,
/system/core/metricsd/uploader/
Dmetrics_hashes.cc44 base::MD5Digest digest; in HashMetricName() local
45 base::MD5Final(&digest, &context); in HashMetricName()
47 std::string hash_str(reinterpret_cast<char*>(digest.a), arraysize(digest.a)); in HashMetricName()
/system/core/gatekeeperd/
DSoftGateKeeper.h39 uint8_t digest[SHA256_DIGEST_LENGTH]; member
139 std::unique_ptr<uint8_t[]> digest(new uint8_t[digest_size]); in ComputeFastHash()
140 memcpy(digest.get(), &salt, sizeof(salt)); in ComputeFastHash()
141 memcpy(digest.get() + sizeof(salt), password.buffer.get(), password.length); in ComputeFastHash()
143 SHA256(digest.get(), digest_size, (uint8_t *) &fast_hash.digest); in ComputeFastHash()
151 return memcmp(computed.digest, fast_hash.digest, SHA256_DIGEST_LENGTH) == 0; in VerifyFast()
/system/tpm/trunks/
Dhmac_authorization_delegate.cc98 std::string digest = HmacSha256(hmac_key, hmac_data); in GetCommandAuthorization() local
99 auth.hmac = Make_TPM2B_DIGEST(digest); in GetCommandAuthorization()
160 std::string digest = HmacSha256(hmac_key, hmac_data); in CheckResponseAuthorization() local
161 CHECK_EQ(digest.size(), auth_response.hmac.size); in CheckResponseAuthorization()
162 if (!crypto::SecureMemEqual(digest.data(), auth_response.hmac.buffer, in CheckResponseAuthorization()
163 digest.size())) { in CheckResponseAuthorization()
276 unsigned char digest[EVP_MAX_MD_SIZE]; in HmacSha256() local
283 digest, in HmacSha256()
286 return std::string(reinterpret_cast<char*>(digest), digest_length); in HmacSha256()
Dpolicy_session_test.cc105 std::string digest; in TEST_F() local
111 EXPECT_EQ(TPM_RC_SUCCESS, session.GetDigest(&digest)); in TEST_F()
112 EXPECT_EQ(static_cast<size_t>(SHA256_DIGEST_SIZE), digest.size()); in TEST_F()
117 std::string digest; in TEST_F() local
120 EXPECT_EQ(TPM_RC_FAILURE, session.GetDigest(&digest)); in TEST_F()
Dtpm_utility_test.cc437 digests.digests[0].digest.sha256, in TEST_F()
765 std::string digest(32, 'a'); in TEST_F() local
786 digest, in TEST_F()
795 std::string digest(32, 'a'); in TEST_F() local
810 digest, in TEST_F()
818 std::string digest(32, 'a'); in TEST_F() local
829 digest, in TEST_F()
837 std::string digest(32, 'a'); in TEST_F() local
842 digest, in TEST_F()
850 std::string digest(32, 'a'); in TEST_F() local
[all …]
/system/extras/verity/
Dverify_boot_signature.c223 unsigned char *digest) in hash_image() argument
234 if (!aa || !digest) { in hash_image()
287 EVP_DigestFinal(ctx, digest, NULL); in hash_image()
318 unsigned char digest[SHA256_DIGEST_LENGTH]; in verify_signature() local
324 if (hash_image(fd, length, bs->authenticatedAttributes, digest) == -1) { in verify_signature()
338 if (!RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, in verify_signature()
/system/core/include/mincrypt/
Dhash-internal.h56 #define HASH_hash(data, len, digest) (ctx)->f->hash(data, len, digest) argument
/system/core/libmincrypt/
Dsha.c149 const uint8_t* SHA_hash(const void* data, int len, uint8_t* digest) { in SHA_hash() argument
153 memcpy(digest, SHA_final(&ctx), SHA_DIGEST_SIZE); in SHA_hash()
154 return digest; in SHA_hash()
/system/update_engine/
Dcertificate_checker.cc148 uint8_t digest[EVP_MAX_MD_SIZE]; in CheckCertificateChange() local
153 digest)) { in CheckCertificateChange()
162 string digest_string = base::HexEncode(digest, digest_length); in CheckCertificateChange()

123