Lines Matching refs:stretching

248 static bool stretchingNeedsSalt(const std::string& stretching) {  in stretchingNeedsSalt()  argument
249 return stretching != kStretch_nopassword && stretching != kStretch_none; in stretchingNeedsSalt()
252 static bool stretchSecret(const std::string& stretching, const std::string& secret, in stretchSecret() argument
254 if (stretching == kStretch_nopassword) { in stretchSecret()
260 } else if (stretching == kStretch_none) { in stretchSecret()
263 stretching.begin())) { in stretchSecret()
265 if (!parse_scrypt_parameters(stretching.substr(kStretchPrefix_scrypt.size()).c_str(), &Nf, in stretchSecret()
267 LOG(ERROR) << "Unable to parse scrypt params in stretching: " << stretching; in stretchSecret()
275 LOG(ERROR) << "scrypt failed with params: " << stretching; in stretchSecret()
279 LOG(ERROR) << "Unknown stretching type: " << stretching; in stretchSecret()
285 static bool generateAppId(const KeyAuthentication& auth, const std::string& stretching, in generateAppId() argument
289 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false; in generateAppId()
412 std::string stretching = getStretching(auth); in storeKey() local
413 if (!writeStringToFile(stretching, dir + "/" + kFn_stretching)) return false; in storeKey()
415 if (stretchingNeedsSalt(stretching)) { in storeKey()
423 if (!generateAppId(auth, stretching, salt, secdiscardable, &appId)) return false; in storeKey()
449 std::string stretching; in retrieveKey() local
450 if (!readFileToString(dir + "/" + kFn_stretching, &stretching)) return false; in retrieveKey()
452 if (stretchingNeedsSalt(stretching)) { in retrieveKey()
456 if (!generateAppId(auth, stretching, salt, secdiscardable, &appId)) return false; in retrieveKey()