Home
last modified time | relevance | path

Searched refs:iv (Results 1 – 24 of 24) sorted by relevance

/system/keymaster/km_openssl/
Dwrapped_key.cpp40 keymaster_error_t build_wrapped_key(const KeymasterKeyBlob& transit_key, const KeymasterBlob& iv, in build_wrapped_key() argument
50 !ASN1_OCTET_STRING_set(wrapped_key->iv, iv.data, iv.data_length) || in build_wrapped_key()
81 keymaster_error_t parse_wrapped_key(const KeymasterKeyBlob& wrapped_key, KeymasterBlob* iv, in parse_wrapped_key() argument
86 if (!iv || !transit_key || !secure_key || !tag || !auth_list || !key_format || in parse_wrapped_key()
96 *iv = KeymasterBlob(record->iv->data, record->iv->length); in parse_wrapped_key()
97 if (record->iv->data && !iv->data) { in parse_wrapped_key()
/system/keymaster/include/keymaster/
Dwrapped_key.h41 ASN1_OCTET_STRING* iv; member
50 ASN1_SIMPLE(KM_WRAPPED_KEY, iv, ASN1_OCTET_STRING),
58 const KeymasterBlob& iv, keymaster_key_format_t key_format,
63 keymaster_error_t parse_wrapped_key(const KeymasterKeyBlob& wrapped_key, KeymasterBlob* iv,
/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()
97 iv: &[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()
Dlegacy_blob.rs113 iv: Vec<u8>,
126 iv: Vec<u8>,
141 iv: Vec<u8>,
152 iv: Vec<u8>,
397 let iv = &buffer[Self::IV_OFFSET..Self::IV_OFFSET + Self::IV_SIZE]; in new_from_stream() localVariable
407 iv: iv.to_vec(), in new_from_stream()
418 iv: iv.to_vec(), in new_from_stream()
429 iv: iv.to_vec(), in new_from_stream()
439 iv: iv.to_vec(), in new_from_stream()
449 iv: iv.to_vec(), in new_from_stream()
[all …]
Dsuper_key.rs158 fn decrypt(&self, data: &[u8], iv: &[u8], tag: &[u8]) -> Result<ZVec> { in decrypt()
160 aes_gcm_decrypt(data, iv, tag, &self.key).context(ks_err!("Decryption failed.")) in decrypt()
475 SuperEncryptionAlgorithm::Aes256Gcm => match (metadata.iv(), metadata.aead_tag()) { in unwrap_key_with_key()
476 (Some(iv), Some(tag)) => { in unwrap_key_with_key()
477 key.decrypt(blob, iv, tag).context(ks_err!("Failed to decrypt the key blob.")) in unwrap_key_with_key()
479 (iv, tag) => Err(Error::Rc(ResponseCode::VALUE_CORRUPTED)).context(ks_err!( in unwrap_key_with_key()
481 iv.is_some(), in unwrap_key_with_key()
486 match (metadata.public_key(), metadata.salt(), metadata.iv(), metadata.aead_tag()) { in unwrap_key_with_key()
487 (Some(public_key), Some(salt), Some(iv), Some(aead_tag)) => { in unwrap_key_with_key()
489 .and_then(|k| k.decrypt_message(public_key, salt, iv, blob, aead_tag)) in unwrap_key_with_key()
[all …]
Dlegacy_importer.rs496 (BlobValue::Encrypted { iv, tag, data }, Some(super_key)) => { in characteristics_file_to_cache()
498 super_key.decrypt(data, iv, tag).context(ks_err!("Decryption failed."))?; in characteristics_file_to_cache()
521 (BlobValue::Encrypted { iv, tag, data }, Some(super_key)) => { in characteristics_file_to_cache()
527 superseded_metadata.add(BlobMetaEntry::Iv(iv.to_vec())); in characteristics_file_to_cache()
534 let (data, iv, tag) = super_key in characteristics_file_to_cache()
538 Blob::new(flags, BlobValue::Encrypted { data, iv, tag }), in characteristics_file_to_cache()
635 BlobValue::Encrypted { iv, tag, data } => { in check_and_import()
642 blob_metadata.add(BlobMetaEntry::Iv(iv.to_vec())); in check_and_import()
808 Some((is_strongbox, BlobValue::Encrypted { iv, tag, data })) => { in bulk_delete()
814 blob_metadata.add(BlobMetaEntry::Iv(iv.to_vec())); in bulk_delete()
Dutils.rs408 fn decrypt(&self, data: &[u8], iv: &[u8], tag: &[u8]) -> Result<ZVec>; in decrypt()
423 fn decrypt(&self, data: &[u8], iv: &[u8], tag: &[u8]) -> Result<ZVec> { in decrypt()
424 aes_gcm_decrypt(data, iv, tag, self.key()).context(ks_err!("Decryption failed")) in decrypt()
Ddatabase.rs186 Iv(Vec<u8>) with accessor iv,
5614 let (encrypted_secret, iv, tag) = in test_store_super_key()
5638 let decrypted_secret_bytes = loaded_super_key.decrypt(&encrypted_secret, &iv, &tag)?; in test_store_super_key()
/system/keymaster/tests/
Dwrapped_key_test.cpp70 KeymasterBlob iv = {reinterpret_cast<const uint8_t*>(test_iv.c_str()), test_iv.size()}; in TEST() local
79 build_wrapped_key(tk, iv, KM_KEY_FORMAT_RAW, secure_key, tag, authorization_list, &asn1), in TEST()
112 KeymasterBlob iv; in TEST() local
117 EXPECT_EQ(parse_wrapped_key(wrapped_key, &iv, &transit_key, &secure_key, &tag, &auth_list, in TEST()
122 EXPECT_EQ(blob2string(iv), test_iv); in TEST()
/system/security/keystore2/src/crypto/
Dlib.rs99 pub fn aes_gcm_decrypt(data: &[u8], iv: &[u8], tag: &[u8], key: &[u8]) -> Result<ZVec, Error> { in aes_gcm_decrypt()
102 let iv = match iv.len() { in aes_gcm_decrypt() localVariable
103 GCM_IV_LENGTH => iv, in aes_gcm_decrypt()
104 LEGACY_IV_LENGTH => &iv[..GCM_IV_LENGTH], in aes_gcm_decrypt()
128 iv.as_ptr(), in aes_gcm_decrypt()
142 let mut iv = vec![0; GCM_IV_LENGTH]; in aes_gcm_encrypt() localVariable
144 if !unsafe { randomBytes(iv.as_mut_ptr(), GCM_IV_LENGTH) } { in aes_gcm_encrypt()
165 iv.as_ptr(), in aes_gcm_encrypt()
169 Ok((ciphertext, iv, tag)) in aes_gcm_encrypt()
480 let (cipher_text, iv, tag) = aes_gcm_encrypt(message, &key).unwrap(); in test_wrapper_roundtrip()
[all …]
Dcrypto.hpp29 const uint8_t* key, size_t key_size, const uint8_t* iv, uint8_t* tag);
31 const uint8_t* key, size_t key_size, const uint8_t* iv,
Dcrypto.cpp89 size_t key_size, const uint8_t* iv, uint8_t* tag) { in AES_gcm_encrypt() argument
96 EVP_EncryptInit_ex(ctx.get(), cipher, nullptr /* engine */, key, iv); in AES_gcm_encrypt()
125 size_t key_size, const uint8_t* iv, const uint8_t* tag) { in AES_gcm_decrypt() argument
132 EVP_DecryptInit_ex(ctx.get(), cipher, nullptr /* engine */, key, iv); in AES_gcm_decrypt()
/system/security/keystore2/tests/
Dffi_test_utils.rs30 iv: Vec<u8>, in createWrappedKey()
60 iv: &[u8], in create_wrapped_key()
66 iv.to_vec(), in create_wrapped_key()
Dffi_test_utils.hpp9 rust::Vec<rust::u8> iv,
Dffi_test_utils.cpp270 rust::Vec<rust::u8> encrypted_transport_key, rust::Vec<rust::u8> iv, in createWrappedKey() argument
279 uint8_t* iv_data = iv.data(); in createWrappedKey()
280 int iv_size = iv.size(); in createWrappedKey()
/system/libvintf/
DKernelConfigTypedValue.cpp75 KernelConfigIntValue iv; in matchValue() local
76 return parseKernelConfigInt(s, &iv) && iv == mIntegerValue; in matchValue()
/system/chre/apps/nearby/location/lbs/contexthub/nanoapps/nearby/crypto/
Daes.c251 int aesCtrInit(struct AesCtrContext *ctx, const void *k, const void *iv, in aesCtrInit() argument
273 memcpy(ctx->iv, iv, sizeof(ctx->iv)); in aesCtrInit()
320 aesEncr(&ctx->aes, ctx->iv, p_dst); in aesCtr()
338 ((uint8_t *)ctx->iv)[i]++; in aesCtr()
339 if (((uint8_t *)ctx->iv)[i]) break; in aesCtr()
Daes.h59 uint32_t iv[AES_BLOCK_WORDS]; member
77 int aesCtrInit(struct AesCtrContext *ctx, const void *k, const void *iv,
/system/keymint/tests/src/
Dlib.rs375 iv: &'static str, in test_aes_gcm() field
385 iv: "028318abc1824029138141a2", in test_aes_gcm()
393 iv: "921d2507fa8007b7bd067d34", in test_aes_gcm()
402 let iv = hex::decode(test.iv).unwrap(); in test_aes_gcm() localVariable
403 assert_eq!(iv.len(), 12); // Only 96-bit nonces supported. in test_aes_gcm()
413 aes::GcmMode::GcmTag16 { nonce: iv.clone().try_into().unwrap() }, in test_aes_gcm()
426 aes::GcmMode::GcmTag16 { nonce: iv.clone().try_into().unwrap() }, in test_aes_gcm()
439 aes::GcmMode::GcmTag12 { nonce: iv.clone().try_into().unwrap() }, in test_aes_gcm()
454 aes::GcmMode::GcmTag12 { nonce: iv.try_into().unwrap() }, in test_aes_gcm()
/system/security/keystore2/src/fuzzers/
Dkeystore2_unsafe_fuzzer.rs62 iv: &'a [u8],
145 FuzzCommand::AesGcmDecrypt { data, iv, tag, key_aes_decrypt } => {
146 let _res = aes_gcm_decrypt(data, iv, tag, key_aes_decrypt);
/system/keymaster/contexts/
Dpure_soft_keymaster_context.cpp485 KeymasterBlob iv; in UnwrapKey() local
490 error = parse_wrapped_key(wrapped_key_blob, &iv, &transit_key, &secure_key, &tag, in UnwrapKey()
546 .Authorization(TAG_NONCE, iv) in UnwrapKey()
555 .Authorization(TAG_NONCE, iv) in UnwrapKey()
/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/security/keystore/
Dkeystore_cli_v2.cpp391 if (auto iv = keymint::authorizationValue(keymint::TAG_NONCE, p)) { in encryptWithAuthentication() local
392 initVector = std::move(iv->get()); in encryptWithAuthentication()
/system/extras/simpleperf/scripts/inferno/
Dinferno.b641 …xWkWSgNaqT5fIbAwnDyU8+o4v+0PvxL3Paz/729J/u6B360PK4odo8WPMncQwDOOlmPHXMAxjw/iv/A10chr0+98c69lxGU6eq…