Lines Matching refs:string
70 static const std::string kStretchPrefix_scrypt = "scrypt ";
81 static bool checkSize(const std::string& kind, size_t actual, size_t expected) {
90 static void hashWithPrefix(char const* prefix, const std::string& tohash, std::string* res) {
97 std::string hashingPrefix = prefix;
106 const std::string& appId, std::string* key) {
130 const KeyAuthentication& auth, const std::string& appId) {
142 static bool readFileToString(const std::string& filename, std::string* result) {
150 static bool writeStringToFile(const std::string& payload, const std::string& filename) {
177 static bool readRandomBytesOrLog(size_t count, std::string* out) {
186 bool createSecdiscardable(const std::string& filename, std::string* hash) {
187 std::string secdiscardable;
194 bool readSecdiscardable(const std::string& filename, std::string* hash) {
195 std::string secdiscardable;
201 static KeymasterOperation begin(Keymaster& keymaster, const std::string& dir,
207 std::string kmKey;
218 std::string newKey;
234 static bool encryptWithKeymasterKey(Keymaster& keymaster, const std::string& dir,
237 const KeyBuffer& message, std::string* ciphertext) {
249 std::string nonce(reinterpret_cast<const char*>(&nonceBlob.value()[0]),
252 std::string body;
255 std::string mac;
262 static bool decryptWithKeymasterKey(Keymaster& keymaster, const std::string& dir,
265 const std::string& ciphertext, KeyBuffer* message) {
278 static std::string getStretching(const KeyAuthentication& auth) {
287 return std::string() + kStretchPrefix_scrypt + paramstr;
291 static bool stretchingNeedsSalt(const std::string& stretching) {
295 static bool stretchSecret(const std::string& stretching, const std::string& secret,
296 const std::string& salt, std::string* stretched) {
328 static bool generateAppId(const KeyAuthentication& auth, const std::string& stretching,
329 const std::string& salt, const std::string& secdiscardable_hash,
330 std::string* appId) {
331 std::string stretched;
341 static bool encryptWithoutKeymaster(const std::string& preKey, const KeyBuffer& plaintext,
342 std::string* ciphertext) {
343 std::string key;
391 static bool decryptWithoutKeymaster(const std::string& preKey, const std::string& ciphertext,
397 std::string key;
443 bool pathExists(const std::string& path) {
447 bool storeKey(const std::string& dir, const KeyAuthentication& auth, const KeyBuffer& key) {
453 std::string secdiscardable_hash;
455 std::string stretching = getStretching(auth);
457 std::string salt;
465 std::string appId;
467 std::string encryptedKey;
471 std::string kmKey;
486 bool storeKeyAtomically(const std::string& key_path, const std::string& tmp_path,
505 bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, KeyBuffer* key) {
506 std::string version;
512 std::string secdiscardable_hash;
514 std::string stretching;
516 std::string salt;
520 std::string appId;
522 std::string encryptedMessage;
538 static bool deleteKey(const std::string& dir) {
539 std::string kmKey;
547 bool runSecdiscardSingle(const std::string& file) {
548 if (ForkExecvp(std::vector<std::string>{kSecdiscardPath, "--", file}) != 0) {
555 static bool recursiveDeleteKey(const std::string& dir) {
556 if (ForkExecvp(std::vector<std::string>{kRmPath, "-rf", dir}) != 0) {
563 bool destroyKey(const std::string& dir) {
570 auto secdiscard_cmd = std::vector<std::string>{