Lines Matching refs:std

54 std::string Errno() { return std::string(": ") + strerror(errno); }  in Errno()
57 void DeleteRecursively(const std::string &path) { in DeleteRecursively()
61 std::unique_ptr<DIR, int (*)(DIR *)> dirp(opendir(path.c_str()), closedir); in DeleteRecursively()
68 std::string filename(entry->d_name); in DeleteRecursively()
78 void RandomBytesForTesting(std::vector<uint8_t> &bytes) { in RandomBytesForTesting()
85 std::vector<uint8_t> GenerateTestKey(size_t size) { in GenerateTestKey()
86 std::vector<uint8_t> key(size); in GenerateTestKey()
91 std::string BytesToHex(const std::vector<uint8_t> &bytes) { in BytesToHex()
92 std::ostringstream o; in BytesToHex()
94 o << std::hex << std::setw(2) << std::setfill('0') << (int)b; in BytesToHex()
114 static bool GetFsBlockDeviceAndType(const std::string &mountpoint, in GetFsBlockDeviceAndType()
115 std::string *fs_blk_device, in GetFsBlockDeviceAndType()
116 std::string *fs_type) { in GetFsBlockDeviceAndType()
117 std::unique_ptr<FILE, int (*)(FILE *)> mnts(setmntent("/proc/mounts", "re"), in GetFsBlockDeviceAndType()
140 static bool GetFilesystemUuid(const std::string &fs_blk_device, in GetFilesystemUuid()
141 const std::string &fs_type, in GetFilesystemUuid()
205 static bool GetRawBlockDevice(const std::string &fs_blk_device, in GetRawBlockDevice()
206 std::string *raw_blk_device) { in GetRawBlockDevice()
216 const std::optional<std::string> name = in GetRawBlockDevice()
224 std::vector<DeviceMapper::TargetInfo> table; in GetRawBlockDevice()
236 const std::string target_type = dm.GetTargetType(table[0].spec); in GetRawBlockDevice()
244 std::optional<std::string> parent = in GetRawBlockDevice()
255 bool GetFilesystemInfo(const std::string &mountpoint, FilesystemInfo *info) { in GetFilesystemInfo()
281 bool VerifyDataRandomness(const std::vector<uint8_t> &bytes) { in VerifyDataRandomness()
285 size_t destLen = bytes.size() - std::min<size_t>(4, bytes.size()); in VerifyDataRandomness()
286 std::vector<uint8_t> dest(destLen); in VerifyDataRandomness()
310 const std::string &master_key_string, in TryPrepareHwWrappedKey()
311 std::string *exported_key_string, in TryPrepareHwWrappedKey()
321 std::string wrapped_key_blob; in TryPrepareHwWrappedKey()
335 bool CreateHwWrappedKey(std::vector<uint8_t> *master_key, in CreateHwWrappedKey()
336 std::vector<uint8_t> *exported_key) { in CreateHwWrappedKey()
344 std::string master_key_string(master_key->begin(), master_key->end()); in CreateHwWrappedKey()
345 std::string exported_key_string; in CreateHwWrappedKey()
361 static void PushBigEndian32(uint32_t val, std::vector<uint8_t> *vec) { in PushBigEndian32()
368 const std::vector<uint8_t> &label, in GetFixedInputString()
369 const std::vector<uint8_t> &context, in GetFixedInputString()
371 std::vector<uint8_t> *fixed_input_string) { in GetFixedInputString()
381 static bool AesCmacKdfHelper(const std::vector<uint8_t> &key, in AesCmacKdfHelper()
382 const std::vector<uint8_t> &label, in AesCmacKdfHelper()
383 const std::vector<uint8_t> &context, in AesCmacKdfHelper()
385 std::vector<uint8_t> *output_data) { in AesCmacKdfHelper()
388 std::vector<uint8_t> fixed_input_string; in AesCmacKdfHelper()
402 bool DeriveHwWrappedEncryptionKey(const std::vector<uint8_t> &master_key, in DeriveHwWrappedEncryptionKey()
403 std::vector<uint8_t> *enc_key) { in DeriveHwWrappedEncryptionKey()
404 std::vector<uint8_t> label{0x00, 0x00, 0x40, 0x00, 0x00, 0x00, in DeriveHwWrappedEncryptionKey()
408 std::vector<uint8_t> context = { in DeriveHwWrappedEncryptionKey()
419 bool DeriveHwWrappedRawSecret(const std::vector<uint8_t> &master_key, in DeriveHwWrappedRawSecret()
420 std::vector<uint8_t> *secret) { in DeriveHwWrappedRawSecret()
421 std::vector<uint8_t> label{0x00, 0x00, 0x40, 0x00, 0x00, 0x00, in DeriveHwWrappedRawSecret()
425 std::vector<uint8_t> context = {'r', 'a', 'w', ' ', 's', 'e', 'c', in DeriveHwWrappedRawSecret()