/system/keymaster/km_openssl/ |
D | wrapped_key.cpp | 40 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/ |
D | wrapped_key.h | 41 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/ |
D | ec_crypto.rs | 87 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()
|
D | legacy_blob.rs | 113 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 …]
|
D | super_key.rs | 158 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 …]
|
D | legacy_importer.rs | 496 (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()
|
D | utils.rs | 408 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()
|
D | database.rs | 186 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/ |
D | wrapped_key_test.cpp | 70 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/ |
D | lib.rs | 99 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 …]
|
D | crypto.hpp | 29 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,
|
D | crypto.cpp | 89 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/ |
D | ffi_test_utils.rs | 30 iv: Vec<u8>, in createWrappedKey() 60 iv: &[u8], in create_wrapped_key() 66 iv.to_vec(), in create_wrapped_key()
|
D | ffi_test_utils.hpp | 9 rust::Vec<rust::u8> iv,
|
D | ffi_test_utils.cpp | 270 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/ |
D | KernelConfigTypedValue.cpp | 75 KernelConfigIntValue iv; in matchValue() local 76 return parseKernelConfigInt(s, &iv) && iv == mIntegerValue; in matchValue()
|
/system/chre/apps/nearby/location/lbs/contexthub/nanoapps/nearby/crypto/ |
D | aes.c | 251 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()
|
D | aes.h | 59 uint32_t iv[AES_BLOCK_WORDS]; member 77 int aesCtrInit(struct AesCtrContext *ctx, const void *k, const void *iv,
|
/system/keymint/tests/src/ |
D | lib.rs | 375 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/ |
D | keystore2_unsafe_fuzzer.rs | 62 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/ |
D | pure_soft_keymaster_context.cpp | 485 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/ |
D | lib.rs | 504 .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/ |
D | keystore_cli_v2.cpp | 391 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/ |
D | inferno.b64 | 1 …xWkWSgNaqT5fIbAwnDyU8+o4v+0PvxL3Paz/729J/u6B360PK4odo8WPMncQwDOOlmPHXMAxjw/iv/A10chr0+98c69lxGU6eq…
|