Lines Matching refs:std

42 static const std::vector<std::vector<uint8_t>> HwWrappedEncryptionKeyContexts =
56 static bool GetKdfContext(std::vector<uint8_t> *ctx) { in GetKdfContext()
57 std::string kdf = in GetKdfContext()
84 std::string Errno() { return std::string(": ") + strerror(errno); } in Errno()
87 void DeleteRecursively(const std::string &path) { in DeleteRecursively()
91 std::unique_ptr<DIR, int (*)(DIR *)> dirp(opendir(path.c_str()), closedir); in DeleteRecursively()
98 std::string filename(entry->d_name); in DeleteRecursively()
108 void RandomBytesForTesting(std::vector<uint8_t> &bytes) { in RandomBytesForTesting()
115 std::vector<uint8_t> GenerateTestKey(size_t size) { in GenerateTestKey()
116 std::vector<uint8_t> key(size); in GenerateTestKey()
121 std::string BytesToHex(const std::vector<uint8_t> &bytes) { in BytesToHex()
122 std::ostringstream o; in BytesToHex()
124 o << std::hex << std::setw(2) << std::setfill('0') << (int)b; in BytesToHex()
144 static bool GetFsBlockDeviceAndType(const std::string &mountpoint, in GetFsBlockDeviceAndType()
145 std::string *fs_blk_device, in GetFsBlockDeviceAndType()
146 std::string *fs_type) { in GetFsBlockDeviceAndType()
147 std::unique_ptr<FILE, int (*)(FILE *)> mnts(setmntent("/proc/mounts", "re"), in GetFsBlockDeviceAndType()
170 static bool GetFilesystemUuid(const std::string &fs_blk_device, in GetFilesystemUuid()
171 const std::string &fs_type, in GetFilesystemUuid()
235 static bool GetRawBlockDevice(const std::string &fs_blk_device, in GetRawBlockDevice()
236 std::string *raw_blk_device) { in GetRawBlockDevice()
246 const std::optional<std::string> name = in GetRawBlockDevice()
254 std::vector<DeviceMapper::TargetInfo> table; in GetRawBlockDevice()
266 const std::string target_type = dm.GetTargetType(table[0].spec); in GetRawBlockDevice()
274 std::optional<std::string> parent = in GetRawBlockDevice()
285 bool GetFilesystemInfo(const std::string &mountpoint, FilesystemInfo *info) { in GetFilesystemInfo()
311 bool VerifyDataRandomness(const std::vector<uint8_t> &bytes) { in VerifyDataRandomness()
315 size_t destLen = bytes.size() - std::min<size_t>(4, bytes.size()); in VerifyDataRandomness()
316 std::vector<uint8_t> dest(destLen); in VerifyDataRandomness()
340 const std::string &master_key_string, in TryPrepareHwWrappedKey()
341 std::string *exported_key_string, in TryPrepareHwWrappedKey()
351 std::string wrapped_key_blob; in TryPrepareHwWrappedKey()
365 bool CreateHwWrappedKey(std::vector<uint8_t> *master_key, in CreateHwWrappedKey()
366 std::vector<uint8_t> *exported_key) { in CreateHwWrappedKey()
374 std::string master_key_string(master_key->begin(), master_key->end()); in CreateHwWrappedKey()
375 std::string exported_key_string; in CreateHwWrappedKey()
391 static void PushBigEndian32(uint32_t val, std::vector<uint8_t> *vec) { in PushBigEndian32()
398 const std::vector<uint8_t> &label, in GetFixedInputString()
399 const std::vector<uint8_t> &context, in GetFixedInputString()
401 std::vector<uint8_t> *fixed_input_string) { in GetFixedInputString()
411 static bool AesCmacKdfHelper(const std::vector<uint8_t> &key, in AesCmacKdfHelper()
412 const std::vector<uint8_t> &label, in AesCmacKdfHelper()
413 const std::vector<uint8_t> &context, in AesCmacKdfHelper()
415 std::vector<uint8_t> *output_data) { in AesCmacKdfHelper()
418 std::vector<uint8_t> fixed_input_string; in AesCmacKdfHelper()
432 bool DeriveHwWrappedEncryptionKey(const std::vector<uint8_t> &master_key, in DeriveHwWrappedEncryptionKey()
433 std::vector<uint8_t> *enc_key) { in DeriveHwWrappedEncryptionKey()
434 std::vector<uint8_t> label{0x00, 0x00, 0x40, 0x00, 0x00, 0x00, in DeriveHwWrappedEncryptionKey()
437 std::vector<uint8_t> ctx; in DeriveHwWrappedEncryptionKey()
444 bool DeriveHwWrappedRawSecret(const std::vector<uint8_t> &master_key, in DeriveHwWrappedRawSecret()
445 std::vector<uint8_t> *secret) { in DeriveHwWrappedRawSecret()
446 std::vector<uint8_t> label{0x00, 0x00, 0x40, 0x00, 0x00, 0x00, in DeriveHwWrappedRawSecret()
450 std::vector<uint8_t> context = {'r', 'a', 'w', ' ', 's', 'e', 'c', in DeriveHwWrappedRawSecret()