Home
last modified time | relevance | path

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

123

/system/keymaster/km_openssl/
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()
Dhmac_operation.cpp60 keymaster_digest_t digest; in CreateOperation() local
61 if (!key.authorizations().GetTagValue(TAG_DIGEST, &digest)) { in CreateOperation()
69 move(key), purpose(), digest, mac_length_bits / 8, min_mac_length_bits / 8)); in CreateOperation()
88 HmacOperation::HmacOperation(Key&& key, keymaster_purpose_t purpose, keymaster_digest_t digest, in HmacOperation() argument
96 switch (digest) { in HmacOperation()
170 uint8_t digest[EVP_MAX_MD_SIZE]; in Finish() local
172 if (!HMAC_Final(&ctx_, digest, &digest_len)) return TranslateLastOpenSslError(); in Finish()
177 if (!output->reserve(mac_length_) || !output->write(digest, mac_length_)) in Finish()
185 if (CRYPTO_memcmp(signature.peek_read(), digest, siglen) != 0) in Finish()
Dhkdf.cpp65 UniquePtr<uint8_t[]> digest(new(std::nothrow) uint8_t[digest_size_]); in GenerateKey() local
66 if (buf.get() == nullptr || digest.get() == nullptr) in GenerateKey()
76 memcpy(buf.get(), digest.get(), digest_size_); in GenerateKey()
83 result = hmac.Sign(buf.get(), block_input_len, digest.get(), digest_size_); in GenerateKey()
89 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()
/system/keymaster/include/keymaster/km_openssl/
Drsa_operation.h37 keymaster_purpose_t purpose, keymaster_digest_t digest, in RsaOperation() argument
40 padding_(padding), digest_(digest), digest_algorithm_(nullptr) {} in RsaOperation()
51 keymaster_digest_t digest() const { return digest_; } in digest() function
77 keymaster_purpose_t purpose, keymaster_digest_t digest,
93 keymaster_digest_t digest, keymaster_padding_t padding, EVP_PKEY* key) in RsaSignOperation() argument
94 : RsaDigestingOperation(move(hw_enforced), move(sw_enforced), KM_PURPOSE_SIGN, digest, in RsaSignOperation()
117 keymaster_digest_t digest, keymaster_padding_t padding, EVP_PKEY* key) in RsaVerifyOperation() argument
118 : RsaDigestingOperation(move(hw_enforced), move(sw_enforced), KM_PURPOSE_VERIFY, digest, in RsaVerifyOperation()
141 keymaster_purpose_t purpose, keymaster_digest_t digest, in RsaCryptOperation() argument
143 : RsaOperation(move(hw_enforced), move(sw_enforced), purpose, digest, padding, key) {} in RsaCryptOperation()
[all …]
Decdsa_operation.h33 keymaster_purpose_t purpose, keymaster_digest_t digest, EVP_PKEY* key) in EcdsaOperation() argument
34 : Operation(purpose, move(hw_enforced), move(sw_enforced)), digest_(digest), in EcdsaOperation()
56 keymaster_digest_t digest, EVP_PKEY* key) in EcdsaSignOperation() argument
57 : EcdsaOperation(move(hw_enforced), move(sw_enforced), KM_PURPOSE_SIGN, digest, key) {} in EcdsaSignOperation()
71 keymaster_digest_t digest, EVP_PKEY* key) in EcdsaVerifyOperation() argument
72 : EcdsaOperation(move(hw_enforced), move(sw_enforced), KM_PURPOSE_VERIFY, digest, key) {} in EcdsaVerifyOperation()
93 keymaster_digest_t digest, EVP_PKEY* key) const = 0;
100 keymaster_digest_t digest, EVP_PKEY* key) const override { in InstantiateOperation() argument
102 EcdsaSignOperation(move(hw_enforced), move(sw_enforced), digest, key); in InstantiateOperation()
110 keymaster_digest_t digest, EVP_PKEY* key) const override { in InstantiateOperation() argument
[all …]
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,
/system/keymaster/android_keymaster/
Doperation.cpp42 bool OperationFactory::supported(keymaster_digest_t digest) const { in supported()
46 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()
120 *digest = KM_DIGEST_NONE; in GetAndValidateDigest()
126 } else if (!supported(*digest)) { in GetAndValidateDigest()
127 LOG_E("Digest %d not supported", *digest); in GetAndValidateDigest()
133 !key.authorizations().Contains(TAG_DIGEST, *digest) && in GetAndValidateDigest()
134 !key.authorizations().Contains(TAG_DIGEST_OLD, *digest)) { in GetAndValidateDigest()
135 LOG_E("Digest %d was specified, but not authorized by key", *digest); in GetAndValidateDigest()
/system/keymaster/legacy_support/
Dkeymaster1_legacy_support.cpp122 keymaster_digest_t digest, in findUnsupportedDigest() argument
130 if (digest != KM_DIGEST_NONE && !contains(supported_digests->second, digest)) { in findUnsupportedDigest()
131 LOG(WARNING) << "Digest " << digest << " requested but not supported by KM1 hal"; in findUnsupportedDigest()
146 keymaster_digest_t digest, in requiresSoftwareDigesting() argument
160 if (!findUnsupportedDigest(algorithm, purpose, digest, params, digest_map)) { in requiresSoftwareDigesting()
191 bool Keymaster1LegacySupport::RequiresSoftwareDigesting(const keymaster_digest_t digest, in RequiresSoftwareDigesting() argument
207 if (requiresSoftwareDigesting(algorithm, purpose, digest, key_description, in RequiresSoftwareDigesting()
267 keymaster_digest_t digest; in LoadKey() local
268 if (!additional_params.GetTagValue(TAG_DIGEST, &digest)) { in LoadKey()
269 digest = KM_DIGEST_NONE; in LoadKey()
[all …]
Drsa_keymaster1_operation.cpp122 keymaster_digest_t digest; in CreateOperation() local
123 if (!GetAndValidateDigest(begin_params, key, &digest, error)) return nullptr; in CreateOperation()
135 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), in CreateOperation()
139 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), 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()
Decdsa_keymaster1_operation.cpp101 keymaster_digest_t digest; in CreateOperation() local
102 if (!GetAndValidateDigest(begin_params, key, &digest, error)) return nullptr; in CreateOperation()
111 key.hw_enforced_move(), key.sw_enforced_move(), digest, ecdsa.release(), engine_)); in CreateOperation()
Drsa_keymaster1_key.cpp36 static bool is_supported(uint32_t digest) { in is_supported() argument
37 return digest == KM_DIGEST_NONE || digest == KM_DIGEST_SHA_2_256; in is_supported()
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()
/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()
Dcrypto.h39 uint8_t* digest,
/system/keymaster/tests/
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()
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 …]
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,
289 keymaster_digest_t digest, std::string expected_mac);
/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/core/fs_mgr/libfs_avb/
Dfs_avb.cpp67 std::string digest; in CalculateVbmetaDigest() local
77 digest = BytesToHex(hasher.finalize(), Hasher::DIGEST_SIZE); in CalculateVbmetaDigest()
78 return std::make_pair(digest, total_size); in CalculateVbmetaDigest()
133 std::string digest; in Create() local
134 fs_mgr_get_boot_config("vbmeta.digest", &digest); in Create()
135 if (digest.size() != expected_digest_size) { in Create()
136 LERROR << "Unexpected digest size: " << digest.size() in Create()
141 if (!HexToBytes(avb_verifier->digest_, sizeof(avb_verifier->digest_), digest)) { in Create()
142 LERROR << "Hash digest contains non-hexidecimal character: " << digest.c_str(); in Create()
250 std::string digest; in LoadAndVerifyVbmeta() local
[all …]
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_legacy_support.h49 bool RequiresSoftwareDigesting(const keymaster_digest_t digest,
104 keymaster_digest_t digest; in LoadKey() local
105 if (!additional_params.GetTagValue(TAG_DIGEST, &digest)) { in LoadKey()
106 digest = KM_DIGEST_NONE; in LoadKey()
109 if (legacy_support_.RequiresSoftwareDigesting(digest, in LoadKey()
/system/update_engine/
Dcertificate_checker.cc149 uint8_t digest[EVP_MAX_MD_SIZE]; in CheckCertificateChange() local
152 x509_ctx, &depth, &digest_length, digest)) { in CheckCertificateChange()
161 string digest_string = base::HexEncode(digest, digest_length); in CheckCertificateChange()
/system/core/fs_mgr/libfs_avb/include/fs_avb/
Dfs_avb.h32 std::string digest; member
39 : digest(std::move(digest_value)), hash_algorithm(algorithm), total_size(size) {} in VBMetaInfo()

123