Home
last modified time | relevance | path

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

/system/keymaster/key_blob_utils/
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()
Dauth_encrypted_key_blob.cpp143 retval.ciphertext = KeymasterKeyBlob(ciphertext_len); in AesGcmEncryptKey()
149 EVP_EncryptUpdate(ctx.get(), retval.ciphertext.writable_data(), &ciphertext_len, in AesGcmEncryptKey()
151 EVP_EncryptFinal_ex(ctx.get(), retval.ciphertext.writable_data() /* not written to */, in AesGcmEncryptKey()
178 int plaintext_len = key.encrypted_key.ciphertext.size(); in AesGcmDecryptKey()
184 key.encrypted_key.ciphertext.key_material, in AesGcmDecryptKey()
185 key.encrypted_key.ciphertext.size()) && in AesGcmDecryptKey()
196 if (key.encrypted_key.ciphertext.size() != plaintext.size() || 0 != unused_len) { in AesGcmDecryptKey()
212 encrypted_key.ciphertext.SerializedSize() + encrypted_key.tag.SerializedSize() + in SerializeAuthEncryptedBlob()
227 buf = encrypted_key.ciphertext.Serialize(buf, end); in SerializeAuthEncryptedBlob()
254 !retval.encrypted_key.ciphertext.Deserialize(buf_ptr, end) || // in DeserializeAuthEncryptedBlob()
[all …]
/system/security/keystore2/src/
Dec_crypto.rs87 let (ciphertext, iv, tag) = in encrypt_message()
89 Ok((sender_public_key, salt, iv, ciphertext, tag)) in encrypt_message()
98 ciphertext: &[u8], in decrypt_message()
105 aes_gcm_decrypt(ciphertext, iv, tag, &aes_key).context(ks_err!("aes_gcm_decrypt failed")) in decrypt_message()
117 let (sender_public_key, salt, iv, ciphertext, tag) = in test_crypto_roundtrip()
121 recipient.decrypt_message(&sender_public_key, &salt, &iv, &ciphertext, &tag)?; in test_crypto_roundtrip()
Dsuper_key.rs181 ciphertext: Vec<u8>, // with tag appended field
186 let (mut ciphertext, nonce, mut tag) = aes_gcm_encrypt(&to_encrypt.key, key)?; in new()
187 ciphertext.append(&mut tag); in new()
188 Ok(LockedKey { algorithm: to_encrypt.algorithm, id: to_encrypt.id, nonce, ciphertext }) in new()
222 &self.ciphertext, in decrypt()
Dlegacy_blob.rs1379 let (ciphertext, iv, tag) = aes_gcm_encrypt(&data, key).unwrap(); in prepare_blob()
1380 Ok(Blob { value: BlobValue::EncryptedGeneric { data: ciphertext, iv, tag }, flags }) in prepare_blob()
1383 let (ciphertext, iv, tag) = aes_gcm_encrypt(&data, key).unwrap(); in prepare_blob()
1385 value: BlobValue::EncryptedCharacteristics { data: ciphertext, iv, tag }, in prepare_blob()
1390 let (ciphertext, iv, tag) = aes_gcm_encrypt(&data, key).unwrap(); in prepare_blob()
1391 Ok(Blob { value: BlobValue::Encrypted { data: ciphertext, iv, tag }, flags }) in prepare_blob()
/system/vold/
DKeyStorage.cpp372 std::string* ciphertext) { in encryptWithKeystoreKey() argument
392 *ciphertext = nonce + body + mac; in encryptWithKeystoreKey()
398 const std::string& ciphertext, KeyBuffer* message) { in decryptWithKeystoreKey() argument
399 const std::string nonce = ciphertext.substr(0, GCM_NONCE_BYTES); in decryptWithKeystoreKey()
400 auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES); in decryptWithKeystoreKey()
435 std::string* ciphertext) { in encryptWithoutKeystore() argument
439 if (!readRandomBytesOrLog(GCM_NONCE_BYTES, ciphertext)) return false; in encryptWithoutKeystore()
448 reinterpret_cast<const uint8_t*>(ciphertext->data()))) { in encryptWithoutKeystore()
452 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeystore()
455 ctx.get(), reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES), in encryptWithoutKeystore()
[all …]
/system/keymaster/cppcose/
Dcppcose.cpp460 auto ciphertext = aesGcmEncrypt(key, nonce, in createCoseEncryptCiphertext() local
468 if (!ciphertext) return ciphertext.moveMessage(); in createCoseEncryptCiphertext()
469 return ciphertext.moveValue(); in createCoseEncryptCiphertext()
480 auto ciphertext = in constructCoseEncrypt() local
482 if (!ciphertext) return ciphertext.moveMessage(); in constructCoseEncrypt()
487 .add(*ciphertext) // Payload in constructCoseEncrypt()
508 auto& ciphertext = recipient->asArray()->get(2); in getSenderPubKeyFromCoseEncrypt() local
509 if (!ciphertext->asSimple() || !ciphertext->asSimple()->asNull()) { in getSenderPubKeyFromCoseEncrypt()
511 cppbor::prettyPrint(ciphertext.get()); in getSenderPubKeyFromCoseEncrypt()
584 auto& ciphertext = coseEncrypt->asArray()->get(kCoseEncryptPayload); in decryptCoseEncrypt() local
[all …]
/system/keymaster/include/keymaster/key_blob_utils/
Docb_utils.h38 KeymasterKeyBlob* ciphertext, Buffer* tag);
43 const KeymasterKeyBlob& ciphertext, const Buffer& nonce,
Dauth_encrypted_key_blob.h71 KeymasterKeyBlob ciphertext; member
/system/keymint/common/src/keyblob/
Dlegacy.rs49 pub ciphertext: Vec<u8>, field
72 + self.ciphertext.len() in serialize()
82 result.extend_from_slice(&(self.ciphertext.len() as u32).to_ne_bytes()); in serialize()
83 result.extend_from_slice(&self.ciphertext); in serialize()
124 let ciphertext = consume_vec(&mut data)?; in deserialize() localVariable
144 ciphertext, in deserialize()
Dkeyblob.cddl39 Cose_Encrypt0 = [ protected: bstr, unprotected: { * (int / tstr) => any }, ciphertext: bstr / nil ]
/system/keymint/common/src/keyblob/legacy/
Dtests.rs93 ciphertext: vec![0xbb, 0xbb], in test_serialize_encrypted_keyblob()
126 ciphertext: vec![0xbb, 0xbb], in test_serialize_encrypted_keyblob()
161 ciphertext: vec![0xbb, 0xbb], in test_serialize_encrypted_keyblob()
/system/keymint/common/src/bin/
Dkeyblob-cddl-dump.rs62 .ciphertext(vec![1, 2, 3]) in main()
75 .ciphertext(vec![1, 2, 3]) in main()
/system/keymint/tests/src/bin/
Dencrypted-keyblob-parse.rs50 keyblob.ciphertext.len(), in process()
/system/keymaster/tests/
Dkey_blob_test.cpp136 encrypted_key_.ciphertext.begin(), encrypted_key_.ciphertext.end())); in TEST_P()
203 encrypted_key_.ciphertext.begin(), encrypted_key_.ciphertext.end()); in TEST_P()
/system/security/keystore2/src/crypto/
Dlib.rs153 let mut ciphertext: Vec<u8> = vec![0; plaintext.len()]; in aes_gcm_encrypt() localVariable
161 ciphertext.as_mut_ptr(), in aes_gcm_encrypt()
169 Ok((ciphertext, iv, tag)) in aes_gcm_encrypt()
/system/security/keystore2/src/km_compat/
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()
/system/security/keystore/
Dkeystore_cli_v2.cpp407 auto ciphertext = std::move(*optCiphertext); in encryptWithAuthentication() local
409 toBeSigned.insert(toBeSigned.end(), ciphertext.begin(), ciphertext.end()); in encryptWithAuthentication()
443 protobuf.set_encrypted_data(ciphertext.data(), ciphertext.size()); in encryptWithAuthentication()
/system/security/keystore2/legacykeystore/
Dlib.rs504 .read_legacy_keystore_entry(uid, alias, |ciphertext, iv, tag, _salt, _key_size| { in import_one_legacy_entry()
508 key.decrypt(ciphertext, iv, tag) in import_one_legacy_entry()
/system/keymint/common/src/
Dkeyblob.rs438 let mut pt_data = op.update(&cose_encrypt.ciphertext.unwrap_or_default())?; in decrypt()