Home
last modified time | relevance | path

Searched refs:digest (Results 1 – 25 of 73) 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 …]
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()
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) override { in InstantiateOperation() argument
93 return new (std::nothrow) EcdsaSignOperation(digest, key); in InstantiateOperation()
100 Operation* InstantiateOperation(keymaster_digest_t digest, EVP_PKEY* key) override { in InstantiateOperation() argument
[all …]
Doperation.cpp44 bool OperationFactory::supported(keymaster_digest_t digest) const { in supported()
48 if (digest == supported_digests[i]) in supported()
115 keymaster_digest_t* digest, in GetAndValidateDigest() argument
118 if (!begin_params.GetTagValue(TAG_DIGEST, digest)) { in GetAndValidateDigest()
121 } else if (!supported(*digest)) { in GetAndValidateDigest()
122 LOG_E("Digest %d not supported", *digest); in GetAndValidateDigest()
128 !key.authorizations().Contains(TAG_DIGEST, *digest) && in GetAndValidateDigest()
129 !key.authorizations().Contains(TAG_DIGEST_OLD, *digest)) { in GetAndValidateDigest()
130 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(std::nothrow) 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.cpp401 keymaster_digest_t digest) { in SignMessage() argument
404 input_params.push_back(TAG_DIGEST, digest); in SignMessage()
413 keymaster_digest_t digest, keymaster_padding_t padding) { in SignMessage() argument
416 input_params.push_back(TAG_DIGEST, digest); in SignMessage()
437 keymaster_digest_t digest) { in VerifyMessage() argument
440 input_params.push_back(TAG_DIGEST, digest); in VerifyMessage()
448 keymaster_digest_t digest, keymaster_padding_t padding) { in VerifyMessage() argument
451 input_params.push_back(TAG_DIGEST, digest); in VerifyMessage()
482 string Keymaster2Test::EncryptMessage(const string& message, keymaster_digest_t digest, in EncryptMessage() argument
485 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.h240 void SignMessage(const std::string& message, std::string* signature, keymaster_digest_t digest);
241 void SignMessage(const std::string& message, std::string* signature, keymaster_digest_t digest,
246 keymaster_digest_t digest);
248 keymaster_digest_t digest, keymaster_padding_t padding);
253 std::string EncryptMessage(const std::string& message, keymaster_digest_t digest,
258 keymaster_digest_t digest, keymaster_padding_t padding,
269 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
273 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
278 keymaster_digest_t digest, keymaster_padding_t padding,
285 keymaster_digest_t digest, std::string expected_mac);
Dkeymaster0_engine.cpp253 int Keymaster0Engine::ecdsa_sign(const uint8_t* digest, size_t digest_len, uint8_t* sig, in ecdsa_sign() argument
255 ALOGV("ecdsa_sign(%p, %u, %p)", digest, (unsigned)digest_len, ec_key); in ecdsa_sign()
257 return instance_->EcdsaSign(digest, digest_len, sig, sig_len, ec_key); in ecdsa_sign()
343 int Keymaster0Engine::EcdsaSign(const uint8_t* digest, size_t digest_len, uint8_t* sig, in EcdsaSign() argument
359 if (!Keymaster0Sign(&sign_params, *key_blob, digest, digest_len, &signature, in EcdsaSign()
378 ALOGV("ecdsa_sign(%p, %u, %p) => success", digest, (unsigned)digest_len, ec_key); in EcdsaSign()
Dkeymaster0_engine.h75 static int ecdsa_sign(const uint8_t* digest, size_t digest_len, uint8_t* sig,
88 int EcdsaSign(const uint8_t* digest, size_t digest_len, uint8_t* sig, unsigned int* sig_len,
/system/nvram/core/
Dcrypto_boringssl.cpp31 uint8_t* digest, in SHA256() argument
40 memcpy(digest, buffer, digest_size); in SHA256()
42 memcpy(digest, buffer, sizeof(buffer)); in SHA256()
43 memset(digest + sizeof(buffer), 0, digest_size - sizeof(buffer)); in SHA256()
/system/core/gatekeeperd/
DSoftGateKeeper.h39 uint8_t digest[SHA256_DIGEST_LENGTH]; member
132 std::unique_ptr<uint8_t[]> digest(new uint8_t[digest_size]); in ComputeFastHash()
133 memcpy(digest.get(), &salt, sizeof(salt)); in ComputeFastHash()
134 memcpy(digest.get() + sizeof(salt), password.buffer.get(), password.length); in ComputeFastHash()
136 SHA256(digest.get(), digest_size, (uint8_t *) &fast_hash.digest); in ComputeFastHash()
144 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()
273 unsigned char digest[EVP_MAX_MD_SIZE]; in HmacSha256() local
276 reinterpret_cast<const unsigned char*>(data.data()), data.size(), digest, in HmacSha256()
279 return std::string(reinterpret_cast<char*>(digest), digest_length); in HmacSha256()
Dpolicy_session_test.cc105 std::string digest; in TEST_F() local
110 EXPECT_EQ(TPM_RC_SUCCESS, session.GetDigest(&digest)); in TEST_F()
111 EXPECT_EQ(static_cast<size_t>(SHA256_DIGEST_SIZE), digest.size()); in TEST_F()
116 std::string digest; in TEST_F() local
119 EXPECT_EQ(TPM_RC_FAILURE, session.GetDigest(&digest)); in TEST_F()
Dpolicy_session_impl.cc75 TPM_RC PolicySessionImpl::GetDigest(std::string* digest) { in GetDigest() argument
76 CHECK(digest); in GetDigest()
86 *digest = StringFrom_TPM2B_DIGEST(policy_digest); in GetDigest()
/system/extras/verity/
Dverify_boot_signature.c224 unsigned char *digest) in hash_image() argument
235 if (!aa || !digest) { in hash_image()
288 EVP_DigestFinal(ctx, digest, NULL); in hash_image()
324 unsigned char digest[SHA256_DIGEST_LENGTH]; in verify_signature() local
330 if (hash_image(fd, length, bs->authenticatedAttributes, digest) == -1) { in verify_signature()
344 if (!RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, in verify_signature()
361 if (!RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, in verify_signature()
/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