Lines Matching refs:std

130   std::vector<uint8_t> plaintext;
131 std::vector<uint8_t> actual_ciphertext;
136 static bool GetInodeNumber(const std::string &path, uint64_t *inode_number) { in GetInodeNumber()
164 static bool IsFscryptV2Supported(const std::string &mountpoint) { in IsFscryptV2Supported()
220 static bool ReadRawDataOfFile(int fd, const std::string &blk_device, in ReadRawDataOfFile()
222 std::vector<uint8_t> *raw_data) { in ReadRawDataOfFile()
238 std::unique_ptr<struct fiemap> map( in ReadRawDataOfFile()
252 std::unique_ptr<void, void (*)(void *)> buf_mem( in ReadRawDataOfFile()
276 << std::hex << extent.fe_flags << std::dec; in ReadRawDataOfFile()
279 ADD_FAILURE() << "Unsupported extent flags: 0x" << std::hex in ReadRawDataOfFile()
280 << extent.fe_flags << std::dec; in ReadRawDataOfFile()
302 *raw_data = std::vector<uint8_t>(&buf[0], &buf[offset]); in ReadRawDataOfFile()
308 static bool WriteTestFile(const std::vector<uint8_t> &plaintext, in WriteTestFile()
309 const std::string &path, in WriteTestFile()
310 const std::string &blk_device, in WriteTestFile()
311 std::vector<uint8_t> *ciphertext) { in WriteTestFile()
345 bool SetMasterKey(const std::vector<uint8_t> &master_key, uint32_t flags = 0,
347 bool CreateAndSetHwWrappedKey(std::vector<uint8_t> *enc_key,
348 std::vector<uint8_t> *sw_secret);
353 bool VerifyKeyIdentifier(const std::vector<uint8_t> &master_key);
354 bool DerivePerModeEncryptionKey(const std::vector<uint8_t> &master_key,
356 std::vector<uint8_t> &enc_key);
357 bool DerivePerFileEncryptionKey(const std::vector<uint8_t> &master_key,
359 std::vector<uint8_t> &enc_key);
360 void VerifyCiphertext(const std::vector<uint8_t> &enc_key,
363 void TestEmmcOptimizedDunWraparound(const std::vector<uint8_t> &master_key,
364 const std::vector<uint8_t> &enc_key);
415 bool FBEPolicyTest::SetMasterKey(const std::vector<uint8_t> &master_key, in SetMasterKey()
418 std::unique_ptr<struct fscrypt_add_key_arg> arg( in SetMasterKey()
424 std::copy(master_key.begin(), master_key.end(), arg->raw); in SetMasterKey()
426 GTEST_LOG_(INFO) << "Adding fscrypt master key, flags are 0x" << std::hex in SetMasterKey()
427 << flags << std::dec << ", raw bytes are " in SetMasterKey()
456 bool FBEPolicyTest::CreateAndSetHwWrappedKey(std::vector<uint8_t> *enc_key, in CreateAndSetHwWrappedKey()
457 std::vector<uint8_t> *sw_secret) { in CreateAndSetHwWrappedKey()
458 std::vector<uint8_t> master_key, exported_key; in CreateAndSetHwWrappedKey()
536 << std::hex << flags << std::dec << Errno(); in SetEncryptionPolicy()
599 static std::vector<uint8_t> InitHkdfInfo(FscryptHkdfContext context) { in InitHkdfInfo()
604 static bool DeriveKey(const std::vector<uint8_t> &master_key, in DeriveKey()
605 const std::vector<uint8_t> &hkdf_info, in DeriveKey()
606 std::vector<uint8_t> &out) { in DeriveKey()
621 const std::vector<uint8_t> &master_key) { in VerifyKeyIdentifier()
622 std::vector<uint8_t> hkdf_info = InitHkdfInfo(HKDF_CONTEXT_KEY_IDENTIFIER); in VerifyKeyIdentifier()
623 std::vector<uint8_t> computed_key_identifier(FSCRYPT_KEY_IDENTIFIER_SIZE); in VerifyKeyIdentifier()
626 std::vector<uint8_t> actual_key_identifier( in VerifyKeyIdentifier()
627 std::begin(master_key_specifier_.u.identifier), in VerifyKeyIdentifier()
628 std::end(master_key_specifier_.u.identifier)); in VerifyKeyIdentifier()
636 const std::vector<uint8_t> &master_key, int mode, in DerivePerModeEncryptionKey()
637 FscryptHkdfContext context, std::vector<uint8_t> &enc_key) { in DerivePerModeEncryptionKey()
638 std::vector<uint8_t> hkdf_info = InitHkdfInfo(context); in DerivePerModeEncryptionKey()
644 std::end(fs_info_.uuid.bytes)); in DerivePerModeEncryptionKey()
651 const std::vector<uint8_t> &master_key, const FscryptFileNonce &nonce, in DerivePerFileEncryptionKey()
652 std::vector<uint8_t> &enc_key) { in DerivePerFileEncryptionKey()
653 std::vector<uint8_t> hkdf_info = InitHkdfInfo(HKDF_CONTEXT_PER_FILE_ENC_KEY); in DerivePerFileEncryptionKey()
655 hkdf_info.insert(hkdf_info.end(), nonce.bytes, std::end(nonce.bytes)); in DerivePerFileEncryptionKey()
662 static bool HashInodeNumber(const std::vector<uint8_t> &master_key, in HashInodeNumber()
673 std::vector<uint8_t> hkdf_info = InitHkdfInfo(HKDF_CONTEXT_INODE_HASH_KEY); in HashInodeNumber()
674 std::vector<uint8_t> ino_hash_key(sizeof(siphash_key)); in HashInodeNumber()
681 GTEST_LOG_(INFO) << "Inode hash key is {" << std::hex << "0x" in HashInodeNumber()
683 << "}" << std::dec; in HashInodeNumber()
689 << std::hex << *hash << std::dec; in HashInodeNumber()
693 void FBEPolicyTest::VerifyCiphertext(const std::vector<uint8_t> &enc_key, in VerifyCiphertext()
697 const std::vector<uint8_t> &plaintext = file_info.plaintext; in VerifyCiphertext()
702 std::vector<uint8_t> computed_ciphertext(plaintext.size()); in VerifyCiphertext()
707 std::min<size_t>(kFilesystemBlockSize, plaintext.size() - i); in VerifyCiphertext()
741 static bool InitIVForInoLblk32(const std::vector<uint8_t> &master_key, in InitIVForInoLblk32()
765 std::vector<uint8_t> enc_key(kAes256XtsKeySize); in TEST_F()
791 std::vector<uint8_t> enc_key(kAes256XtsKeySize); in TEST_F()
808 std::vector<uint8_t> enc_key, sw_secret; in TEST_F()
831 const std::vector<uint8_t> &master_key, in TestEmmcOptimizedDunWraparound()
832 const std::vector<uint8_t> &enc_key) { in TestEmmcOptimizedDunWraparound()
849 std::string path; in TestEmmcOptimizedDunWraparound()
895 std::unique_ptr<void, void (*)(void *)> buf_mem( in TestEmmcOptimizedDunWraparound()
931 std::vector<uint8_t> enc_key(kAes256XtsKeySize); in TEST_F()
950 std::vector<uint8_t> enc_key, sw_secret; in TEST_F()
989 std::vector<uint8_t> enc_key(kAdiantumKeySize); in TEST_F()
1003 std::vector<uint8_t> master_key, exported_key; in TEST_F()
1007 std::vector<uint8_t> corrupt_key(exported_key.begin(), exported_key.end()); in TEST_F()
1037 std::vector<uint8_t> zeroes(kTestFileBytes, 0); in TEST()
1038 std::vector<uint8_t> ciphertext_1; in TEST()
1039 std::vector<uint8_t> ciphertext_2; in TEST()
1053 std::vector<uint8_t> concatenated_ciphertext; in TEST()