diff options
author | Simon Warta <[email protected]> | 2015-06-23 20:16:51 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-23 20:16:51 +0200 |
commit | d4811ce2ea1c041795804e3ebd2a661d7e043d17 (patch) | |
tree | b4c0a8ad83dcbeaf90dafaed8576e2c1650c07ad /src/lib/passhash/passhash9 | |
parent | 2f729838547e1c9ce475ecc91c361f0531e1df61 (diff) |
lib/passhash: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/passhash/passhash9')
-rw-r--r-- | src/lib/passhash/passhash9/passhash9.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/passhash/passhash9/passhash9.cpp b/src/lib/passhash/passhash9/passhash9.cpp index 3898cdb44..f30684ec6 100644 --- a/src/lib/passhash/passhash9/passhash9.cpp +++ b/src/lib/passhash/passhash9/passhash9.cpp @@ -56,7 +56,7 @@ std::string generate_passhash9(const std::string& pass, PKCS5_PBKDF2 kdf(prf); // takes ownership of pointer secure_vector<byte> salt(SALT_BYTES); - rng.randomize(&salt[0], salt.size()); + rng.randomize(salt.data(), salt.size()); const size_t kdf_iterations = WORK_FACTOR_SCALE * work_factor; @@ -67,7 +67,7 @@ std::string generate_passhash9(const std::string& pass, blob += salt; blob += kdf.derive_key(PASSHASH9_PBKDF_OUTPUT_LEN, pass, - &salt[0], salt.size(), + salt.data(), salt.size(), kdf_iterations).bits_of(); return MAGIC_PREFIX + base64_encode(blob); @@ -123,7 +123,7 @@ bool check_passhash9(const std::string& pass, const std::string& hash) &bin[ALGID_BYTES + WORKFACTOR_BYTES], SALT_BYTES, kdf_iterations).bits_of(); - return same_mem(&cmp[0], + return same_mem(cmp.data(), &bin[ALGID_BYTES + WORKFACTOR_BYTES + SALT_BYTES], PASSHASH9_PBKDF_OUTPUT_LEN); } |