Home
last modified time | relevance | path

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

/system/keymaster/key_blob_utils/
Docb_utils.cpp122 KeymasterKeyBlob* ciphertext, Buffer* tag) { in OcbEncryptKey() argument
123 assert(ciphertext && tag); in OcbEncryptKey()
137 if (!ciphertext->Reset(plaintext.key_material_size)) in OcbEncryptKey()
142 0 /* additional data length */, ciphertext->writable_data(), in OcbEncryptKey()
157 const KeymasterKeyBlob& ciphertext, const Buffer& nonce, in OcbDecryptKey() argument
173 if (!plaintext->Reset(ciphertext.key_material_size)) in OcbDecryptKey()
176 int ae_err = ae_decrypt(ctx.get(), nonce.peek_read(), ciphertext.key_material, in OcbDecryptKey()
177 ciphertext.key_material_size, nullptr /* additional data */, in OcbDecryptKey()
190 assert(ae_err == static_cast<int>(ciphertext.key_material_size)); in OcbDecryptKey()
/system/keymaster/tests/
Dandroid_keymaster_test.cpp1788 string ciphertext = EncryptMessage(message, KM_MODE_ECB, KM_PAD_PKCS7); in TEST_P() local
1789 string plaintext = DecryptMessage(ciphertext, KM_MODE_ECB, KM_PAD_PKCS7); in TEST_P()
1964 string ciphertext = ProcessMessage(KM_PURPOSE_ENCRYPT, message, params); in TEST_F() local
1965 string plaintext = ProcessMessage(KM_PURPOSE_DECRYPT, ciphertext, params); in TEST_F()
2089 string ciphertext = EncryptMessage(message, KM_PAD_NONE); in TEST_P() local
2090 EXPECT_EQ(256U / 8, ciphertext.size()); in TEST_P()
2093 string plaintext = DecryptMessage(ciphertext, KM_PAD_NONE); in TEST_P()
2210 string ciphertext = EncryptMessage(string(message), KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP); in TEST_P() local
2211 EXPECT_EQ(key_size / 8, ciphertext.size()); in TEST_P()
2213 string plaintext = DecryptMessage(ciphertext, KM_DIGEST_SHA_2_256, KM_PAD_RSA_OAEP); in TEST_P()
[all …]
Dandroid_keymaster_test_utils.cpp470 string ciphertext = in EncryptMessage() local
479 return ciphertext; in EncryptMessage()
501 string ciphertext = in EncryptMessage() local
510 return ciphertext; in EncryptMessage()
520 string ciphertext = in EncryptMessage() local
529 return ciphertext; in EncryptMessage()
540 string Keymaster2Test::DecryptMessage(const string& ciphertext, keymaster_padding_t padding) { in DecryptMessage() argument
545 return ProcessMessage(KM_PURPOSE_DECRYPT, ciphertext, begin_params, update_params); in DecryptMessage()
548 string Keymaster2Test::DecryptMessage(const string& ciphertext, keymaster_digest_t digest, in DecryptMessage() argument
555 return ProcessMessage(KM_PURPOSE_DECRYPT, ciphertext, begin_params, update_params); in DecryptMessage()
[all …]
Dandroid_keymaster_test_utils.h268 std::string DecryptMessage(const std::string& ciphertext, keymaster_padding_t padding);
269 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
271 std::string DecryptMessage(const std::string& ciphertext, keymaster_block_mode_t block_mode,
273 std::string DecryptMessage(const std::string& ciphertext, keymaster_digest_t digest,
275 std::string DecryptMessage(const std::string& ciphertext, keymaster_block_mode_t block_mode,
277 std::string DecryptMessage(const AuthorizationSet& update_params, const std::string& ciphertext,
280 std::string DecryptMessage(const AuthorizationSet& update_params, const std::string& ciphertext,
/system/vold/
DKeyStorage.cpp241 std::string* ciphertext, bool keepOld) { in encryptWithKeymasterKey() argument
262 *ciphertext = nonce + body + mac; in encryptWithKeymasterKey()
269 const std::string& ciphertext, KeyBuffer* message, in decryptWithKeymasterKey() argument
271 auto nonce = ciphertext.substr(0, GCM_NONCE_BYTES); in decryptWithKeymasterKey()
272 auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES); in decryptWithKeymasterKey()
347 std::string* ciphertext) { in encryptWithoutKeymaster() argument
351 if (!readRandomBytesOrLog(GCM_NONCE_BYTES, ciphertext)) return false; in encryptWithoutKeymaster()
360 reinterpret_cast<const uint8_t*>(ciphertext->data()))) { in encryptWithoutKeymaster()
364 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster()
367 ctx.get(), reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES), in encryptWithoutKeymaster()
[all …]
/system/keymaster/include/keymaster/key_blob_utils/
Docb_utils.h39 KeymasterKeyBlob* ciphertext, Buffer* tag);
44 const KeymasterKeyBlob& ciphertext, const Buffer& nonce,