aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/passhash/bcrypt
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-23 20:16:51 +0200
committerSimon Warta <[email protected]>2015-06-23 20:16:51 +0200
commitd4811ce2ea1c041795804e3ebd2a661d7e043d17 (patch)
treeb4c0a8ad83dcbeaf90dafaed8576e2c1650c07ad /src/lib/passhash/bcrypt
parent2f729838547e1c9ce475ecc91c361f0531e1df61 (diff)
lib/passhash: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/passhash/bcrypt')
-rw-r--r--src/lib/passhash/bcrypt/bcrypt.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/passhash/bcrypt/bcrypt.cpp b/src/lib/passhash/bcrypt/bcrypt.cpp
index 218404110..3f6a68352 100644
--- a/src/lib/passhash/bcrypt/bcrypt.cpp
+++ b/src/lib/passhash/bcrypt/bcrypt.cpp
@@ -103,13 +103,13 @@ std::string make_bcrypt(const std::string& pass,
// Include the trailing NULL byte
blowfish.eks_key_schedule(reinterpret_cast<const byte*>(pass.c_str()),
pass.length() + 1,
- &salt[0],
+ salt.data(),
work_factor);
for(size_t i = 0; i != 64; ++i)
- blowfish.encrypt_n(&ctext[0], &ctext[0], 3);
+ blowfish.encrypt_n(ctext.data(), ctext.data(), 3);
- std::string salt_b64 = bcrypt_base64_encode(&salt[0], salt.size());
+ std::string salt_b64 = bcrypt_base64_encode(salt.data(), salt.size());
std::string work_factor_str = std::to_string(work_factor);
if(work_factor_str.length() == 1)
@@ -117,7 +117,7 @@ std::string make_bcrypt(const std::string& pass,
return "$2a$" + work_factor_str +
"$" + salt_b64.substr(0, 22) +
- bcrypt_base64_encode(&ctext[0], ctext.size() - 1);
+ bcrypt_base64_encode(ctext.data(), ctext.size() - 1);
}
}