Searched refs:plaintext (Results 1 – 6 of 6) sorted by relevance
/system/keymaster/key_blob_utils/ |
D | ocb_utils.cpp | 121 const KeymasterKeyBlob& plaintext, const Buffer& nonce, in OcbEncryptKey() argument 137 if (!ciphertext->Reset(plaintext.key_material_size)) in OcbEncryptKey() 140 int ae_err = ae_encrypt(ctx.get(), nonce.peek_read(), plaintext.key_material, in OcbEncryptKey() 141 plaintext.key_material_size, nullptr /* additional data */, in OcbEncryptKey() 150 assert(ae_err == static_cast<int>(plaintext.key_material_size)); in OcbEncryptKey() 158 const Buffer& tag, KeymasterKeyBlob* plaintext) { in OcbDecryptKey() argument 159 assert(plaintext); in OcbDecryptKey() 173 if (!plaintext->Reset(ciphertext.key_material_size)) in OcbDecryptKey() 178 0 /* additional data length */, plaintext->writable_data(), in OcbDecryptKey() 183 plaintext->Clear(); in OcbDecryptKey()
|
/system/keymaster/tests/ |
D | android_keymaster_test.cpp | 1789 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7); in TEST_P() local 1790 EXPECT_EQ(message, plaintext); in TEST_P() 1965 string plaintext = ProcessMessage(KM_PURPOSE_DECRYPT, ciphertext, params); in TEST_F() local 1967 EXPECT_EQ(message, plaintext); in TEST_F() 2093 string plaintext = DecryptMessage(ciphertext, KM_PAD_NONE); in TEST_P() local 2095 EXPECT_EQ(expected_plaintext, plaintext); in TEST_P() 2213 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP); in TEST_P() local 2214 EXPECT_EQ(message, plaintext); in TEST_P() 2230 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_224, KM_PAD_RSA_OAEP); in TEST_P() local 2231 EXPECT_EQ(message, plaintext); in TEST_P() [all …]
|
D | key_blob_test.cpp | 117 KeymasterKeyBlob plaintext; in TEST_F() local 118 OcbDecryptKey(hw2, sw2, hidden_, master_key_, ciphertext_, nonce_, tag_, &plaintext); in TEST_F() 123 ASSERT_EQ(key_material_.key_material_size, plaintext.key_material_size); in TEST_F() 124 EXPECT_EQ(0, memcmp(plaintext.begin(), key_material_.begin(), plaintext.key_material_size)); in TEST_F()
|
/system/vold/ |
D | KeyStorage.cpp | 346 static bool encryptWithoutKeymaster(const std::string& preKey, const KeyBuffer& plaintext, in encryptWithoutKeymaster() argument 364 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster() 368 &outlen, reinterpret_cast<const uint8_t*>(plaintext.data()), plaintext.size())) { in encryptWithoutKeymaster() 372 if (outlen != static_cast<int>(plaintext.size())) { in encryptWithoutKeymaster() 373 LOG(ERROR) << "GCM ciphertext length should be " << plaintext.size() << " was " << outlen; in encryptWithoutKeymaster() 378 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + plaintext.size()), in encryptWithoutKeymaster() 389 plaintext.size()))) { in encryptWithoutKeymaster() 397 KeyBuffer* plaintext) { in decryptWithoutKeymaster() argument 417 *plaintext = KeyBuffer(ciphertext.size() - GCM_NONCE_BYTES - GCM_MAC_BYTES); in decryptWithoutKeymaster() 419 if (1 != EVP_DecryptUpdate(ctx.get(), reinterpret_cast<uint8_t*>(&(*plaintext)[0]), &outlen, in decryptWithoutKeymaster() [all …]
|
/system/keymaster/include/keymaster/key_blob_utils/ |
D | ocb_utils.h | 38 const KeymasterKeyBlob& plaintext, const Buffer& nonce, 45 const Buffer& tag, KeymasterKeyBlob* plaintext);
|
/system/keymaster/contexts/ |
D | pure_soft_keymaster_context.cpp | 368 Buffer encrypted_key, plaintext; in UnwrapKey() local 369 if (!plaintext.Reinitialize(secure_key.key_material_size + tag.data_length)) { in UnwrapKey() 391 error = aes_operation->Update(update_params, encrypted_key, &update_outparams, &plaintext, in UnwrapKey() 398 &finish_out_params, &plaintext); in UnwrapKey() 401 *wrapped_key_material = {plaintext.peek_read(), plaintext.available_read()}; in UnwrapKey() 402 if (!wrapped_key_material->key_material && plaintext.peek_read()) { in UnwrapKey()
|