Home
last modified time | relevance | path

Searched refs:ciphertext (Results 1 – 25 of 28) sorted by relevance

12

/aosp12/system/keymaster/tests/
H A Dandroid_keymaster_test.cpp2303 string ciphertext; in TEST_P() local
2349 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
2400 string ciphertext; in TEST_P() local
2470 const string ciphertext = hex2str(test.ciphertext); in TEST_P() local
2606 string ciphertext; in TEST_P() local
2667 string ciphertext; in TEST_P() local
2730 string ciphertext; in TEST_P() local
2825 string ciphertext; in TEST_P() local
2865 string ciphertext; in TEST_P() local
3189 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
[all …]
H A Dandroid_keymaster_test_utils.cpp469 string ciphertext = in EncryptMessage() local
478 return ciphertext; in EncryptMessage()
508 string ciphertext = in EncryptMessage() local
517 return ciphertext; in EncryptMessage()
527 string ciphertext = in EncryptMessage() local
536 return ciphertext; in EncryptMessage()
546 string ciphertext = in EncryptMessage() local
555 return ciphertext; in EncryptMessage()
571 return ProcessMessage(KM_PURPOSE_DECRYPT, ciphertext, begin_params, update_params); in DecryptMessage()
690 string ciphertext = in CheckAesCtrTestVector() local
[all …]
H A Dandroid_keymaster_test_utils.h269 std::string DecryptMessage(const std::string& ciphertext, keymaster_padding_t padding);
270 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
272 std::string DecryptMessage(const std::string& ciphertext, keymaster_block_mode_t block_mode,
274 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
276 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
278 std::string DecryptMessage(const std::string& ciphertext, keymaster_block_mode_t block_mode,
280 std::string DecryptMessage(const AuthorizationSet& update_params, const std::string& ciphertext,
283 std::string DecryptMessage(const AuthorizationSet& update_params, const std::string& ciphertext,
H A Dkey_blob_test.cpp122 encrypted_key_.ciphertext.begin(), encrypted_key_.ciphertext.end())); in TEST_F()
189 encrypted_key_.ciphertext.begin(), encrypted_key_.ciphertext.end()); in TEST_F()
/aosp12/system/keymaster/cppcose/
H A Dcppcose.cpp225 auto ciphertext = aesGcmEncrypt(key, nonce, in createCoseEncryptCiphertext() local
233 if (!ciphertext) return ciphertext.moveMessage(); in createCoseEncryptCiphertext()
234 return ciphertext.moveValue(); in createCoseEncryptCiphertext()
245 auto ciphertext = in constructCoseEncrypt() local
247 if (!ciphertext) return ciphertext.moveMessage(); in constructCoseEncrypt()
273 auto& ciphertext = recipient->asArray()->get(2); in getSenderPubKeyFromCoseEncrypt() local
274 if (!ciphertext->asSimple() || !ciphertext->asSimple()->asNull()) { in getSenderPubKeyFromCoseEncrypt()
276 cppbor::prettyPrint(ciphertext.get()); in getSenderPubKeyFromCoseEncrypt()
359 if (!ciphertext->asBstr()) return "Invalid ciphertext"; in decryptCoseEncrypt()
414 bytevec ciphertext(plaintext.size() + kAesGcmTagSize); in aesGcmEncrypt() local
[all …]
/aosp12/system/keymaster/key_blob_utils/
H A Docb_utils.cpp116 KeymasterKeyBlob* ciphertext, Buffer* tag) { in OcbEncryptKey() argument
117 assert(ciphertext && tag); in OcbEncryptKey()
129 if (!ciphertext->Reset(plaintext.key_material_size)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in OcbEncryptKey()
133 0 /* additional data length */, ciphertext->writable_data(), in OcbEncryptKey()
147 const KeymasterKeyBlob& ciphertext, const Buffer& nonce, in OcbDecryptKey() argument
161 if (!plaintext->Reset(ciphertext.key_material_size)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in OcbDecryptKey()
163 int ae_err = ae_decrypt(ctx.get(), nonce.peek_read(), ciphertext.key_material, in OcbDecryptKey()
164 ciphertext.key_material_size, nullptr /* additional data */, in OcbDecryptKey()
177 assert(ae_err == static_cast<int>(ciphertext.key_material_size)); in OcbDecryptKey()
H A Dauth_encrypted_key_blob.cpp138 retval.ciphertext = KeymasterKeyBlob(ciphertext_len); in AesGcmEncryptKey()
144 EVP_EncryptUpdate(ctx.get(), retval.ciphertext.writable_data(), &ciphertext_len, in AesGcmEncryptKey()
146 EVP_EncryptFinal_ex(ctx.get(), retval.ciphertext.writable_data() /* not written to */, in AesGcmEncryptKey()
177 int plaintext_len = key.encrypted_key.ciphertext.size(); in AesGcmDecryptKey()
183 key.encrypted_key.ciphertext.key_material, in AesGcmDecryptKey()
184 key.encrypted_key.ciphertext.size()) && in AesGcmDecryptKey()
197 if (key.encrypted_key.ciphertext.size() != plaintext.size() || 0 != unused_len) { in AesGcmDecryptKey()
228 buf = encrypted_key.ciphertext.Serialize(buf, end); in SerializeAuthEncryptedBlob()
259 !retval.encrypted_key.ciphertext.Deserialize(buf_ptr, end) || // in DeserializeAuthEncryptedBlob()
305 retval.nonce, &retval.ciphertext, &retval.tag); in EncryptKey()
[all …]
/aosp12/hardware/interfaces/keymaster/4.0/vts/functional/
H A Dkeymaster_hidl_hal_test.cpp2787 string ciphertext; in TEST_P() local
2856 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
3070 const string ciphertext = hex2str(test.ciphertext); in TEST_P() local
3267 string ciphertext; in TEST_P() local
3318 string ciphertext; in TEST_P() local
3425 string ciphertext; in TEST_P() local
3516 string ciphertext; in TEST_P() local
3563 string ciphertext; in TEST_P() local
3623 string ciphertext; in TEST_P() local
3883 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
[all …]
H A DKeymasterHidlTest.cpp481 EXPECT_EQ(expected_ciphertext, ciphertext); in CheckAesCtrTestVector()
549 string ciphertext = EncryptMessage(message, params, &out_params); in EncryptMessage() local
551 return ciphertext; in EncryptMessage()
559 string ciphertext = EncryptMessage(message, params, &out_params); in EncryptMessage() local
561 return ciphertext; in EncryptMessage()
569 string ciphertext = EncryptMessage(message, params, &out_params); in EncryptMessage() local
574 return ciphertext; in EncryptMessage()
586 return ciphertext; in EncryptMessage()
600 return ciphertext; in EncryptMessage()
615 return DecryptMessage(key_blob_, ciphertext, params); in DecryptMessage()
[all …]
H A DKeymasterHidlTest.h197 string DecryptMessage(const HidlBuf& key_blob, const string& ciphertext,
199 string DecryptMessage(const string& ciphertext, const AuthorizationSet& params);
200 string DecryptMessage(const string& ciphertext, BlockMode block_mode, PaddingMode padding_mode,
/aosp12/system/security/keystore2/src/
H A Dec_crypto.rs97 let (ciphertext, iv, tag) = aes_gcm_encrypt(message, &aes_key) in encrypt_message()
99 Ok((sender_public_key, salt, iv, ciphertext, tag)) in encrypt_message()
108 ciphertext: &[u8], in decrypt_message()
115 aes_gcm_decrypt(ciphertext, iv, tag, &aes_key) in decrypt_message()
128 let (sender_public_key, salt, iv, ciphertext, tag) = in test_crypto_roundtrip()
132 recipient.decrypt_message(&sender_public_key, &salt, &iv, &ciphertext, &tag)?; in test_crypto_roundtrip()
H A Dsuper_key.rs179 ciphertext: Vec<u8>, // with tag appended field
184 let (mut ciphertext, nonce, mut tag) = aes_gcm_encrypt(&to_encrypt.key, key)?; in new()
185 ciphertext.append(&mut tag); in new()
186 Ok(LockedKey { algorithm: to_encrypt.algorithm, id: to_encrypt.id, nonce, ciphertext }) in new()
220 &self.ciphertext, in decrypt()
/aosp12/system/vold/
H A DKeyStorage.cpp380 const KeyBuffer& message, std::string* ciphertext) { in encryptWithKeymasterKey() argument
400 *ciphertext = nonce + body + mac; in encryptWithKeymasterKey()
407 const std::string nonce = ciphertext.substr(0, GCM_NONCE_BYTES); in decryptWithKeymasterKey()
408 auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES); in decryptWithKeymasterKey()
471 std::string* ciphertext) { in encryptWithoutKeymaster() argument
475 if (!readRandomBytesOrLog(GCM_NONCE_BYTES, ciphertext)) return false; in encryptWithoutKeymaster()
488 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster()
522 if (ciphertext.size() < GCM_NONCE_BYTES + GCM_MAC_BYTES) { in decryptWithoutKeymaster()
523 LOG(ERROR) << "GCM ciphertext too small: " << ciphertext.size(); in decryptWithoutKeymaster()
537 reinterpret_cast<const uint8_t*>(ciphertext.data()))) { in decryptWithoutKeymaster()
[all …]
/aosp12/hardware/interfaces/keymaster/3.0/vts/functional/
H A Dkeymaster_hidl_hal_test.cpp2926 string ciphertext; in TEST_P() local
2995 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
3204 const string ciphertext = hex2str(test.ciphertext); in TEST_P() local
3401 string ciphertext; in TEST_P() local
3471 string ciphertext; in TEST_P() local
3562 string ciphertext; in TEST_P() local
3609 string ciphertext; in TEST_P() local
3668 string ciphertext; in TEST_P() local
3716 string ciphertext; in TEST_P() local
3760 string ciphertext; in TEST_P() local
[all …]
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/
H A DManagedProfilePasswordCache.java118 byte[] ciphertext = cipher.doFinal(password.getCredential()); in storePassword()
120 byte[] block = Arrays.copyOf(iv, ciphertext.length + iv.length); in storePassword()
121 System.arraycopy(ciphertext, 0, block, iv.length, ciphertext.length); in storePassword()
149 byte[] ciphertext = Arrays.copyOfRange(block, 12, block.length); in retrievePassword()
154 credential = cipher.doFinal(ciphertext); in retrievePassword()
H A DSyntheticPasswordCrypto.java68 byte[] ciphertext = Arrays.copyOfRange(blob, PROFILE_KEY_IV_SIZE, blob.length); in decrypt()
72 return cipher.doFinal(ciphertext); in decrypt()
86 byte[] ciphertext = cipher.doFinal(blob); in encrypt()
98 outputStream.write(ciphertext); in encrypt()
116 public static byte[] decrypt(byte[] keyBytes, byte[] personalisation, byte[] ciphertext) { in decrypt() argument
121 return decrypt(key, ciphertext); in decrypt()
/aosp12/hardware/interfaces/security/keymint/aidl/vts/functional/
H A DKeyMintTest.cpp4478 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
4678 const string ciphertext = hex2str(test.ciphertext); in TEST_P() local
4872 string ciphertext; in TEST_P() local
4915 string ciphertext; in TEST_P() local
5042 string ciphertext; in TEST_P() local
5131 string ciphertext; in TEST_P() local
5178 string ciphertext; in TEST_P() local
5219 string ciphertext; in TEST_P() local
5252 string ciphertext; in TEST_P() local
5445 ++ciphertext[ciphertext.size() / 2]; in TEST_P()
[all …]
H A DKeyMintAidlTestBase.cpp651 EXPECT_EQ(expected_ciphertext, ciphertext); in CheckAesCtrTestVector()
909 return ciphertext; in EncryptMessage()
919 return ciphertext; in EncryptMessage()
932 return ciphertext; in EncryptMessage()
944 return ciphertext; in EncryptMessage()
958 return ciphertext; in EncryptMessage()
970 return ciphertext; in EncryptMessage()
974 const string& ciphertext, in DecryptMessage() argument
987 return DecryptMessage(key_blob_, ciphertext, params); in DecryptMessage()
997 return DecryptMessage(key_blob_, ciphertext, params); in DecryptMessage()
[all …]
H A DKeyMintAidlTestBase.h202 string DecryptMessage(const vector<uint8_t>& key_blob, const string& ciphertext,
204 string DecryptMessage(const string& ciphertext, const AuthorizationSet& params);
205 string DecryptMessage(const string& ciphertext, BlockMode block_mode, PaddingMode padding_mode,
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/
H A DSecureBox.java204 byte[] ciphertext = aesGcmEncrypt(encryptionKey, randNonce, payload, header); in encrypt()
206 return concat(VERSION, randNonce, ciphertext); in encrypt()
209 VERSION, encodePublicKey(senderKeyPair.getPublic()), randNonce, ciphertext); in encrypt()
270 byte[] ciphertext = readEncryptedPayload(ciphertextBuffer, ciphertextBuffer.remaining()); in decrypt()
273 return aesGcmDecrypt(decryptionKey, randNonce, ciphertext, header); in decrypt()
335 private static byte[] aesGcmDecrypt(SecretKey key, byte[] nonce, byte[] ciphertext, byte[] aad) in aesGcmDecrypt() argument
337 return aesGcmInternal(AesGcmOperation.DECRYPT, key, nonce, ciphertext, aad); in aesGcmDecrypt()
/aosp12/system/keymaster/include/keymaster/key_blob_utils/
H A Docb_utils.h38 KeymasterKeyBlob* ciphertext, Buffer* tag);
43 const KeymasterKeyBlob& ciphertext, const Buffer& nonce,
H A Dauth_encrypted_key_blob.h48 KeymasterKeyBlob ciphertext; member
/aosp12/system/security/keystore2/src/crypto/
H A Dlib.rs136 let mut ciphertext: Vec<u8> = vec![0; plaintext.len()]; in aes_gcm_encrypt() localVariable
144 ciphertext.as_mut_ptr(), in aes_gcm_encrypt()
152 Ok((ciphertext, iv, tag)) in aes_gcm_encrypt()
/aosp12/system/security/keystore2/src/km_compat/
H A Dlib.rs304 let ciphertext = result.unwrap(); in test_begin_update_finish() localVariable
305 assert!(!ciphertext.is_empty()); in test_begin_update_finish()
320 &ciphertext, in test_begin_update_finish()
/aosp12/system/security/keystore/
H A Dkeystore_cli_v2.cpp396 auto ciphertext = std::move(*optCiphertext); in encryptWithAuthentication() local
398 toBeSigned.insert(toBeSigned.end(), ciphertext.begin(), ciphertext.end()); in encryptWithAuthentication()
432 protobuf.set_encrypted_data(ciphertext.data(), ciphertext.size()); in encryptWithAuthentication()

12