diff options
author | lloyd <[email protected]> | 2010-09-13 15:54:50 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 15:54:50 +0000 |
commit | 36bfef27271eadffefbc6891a9d7fa7eed7b1e10 (patch) | |
tree | 81fe9b37bb580cedba5bb25ac04dfecdd36b18de /src/constructs/passhash | |
parent | 4a7e9edcc92b08a285ea24549fd8c813d10b63b9 (diff) |
More vector->pointer conversion removals.
Add RandomNumberGenerator::random_vec, which takes an length n and
returns a new SecureVector with randomized contents of that size. This
nicely covers most of the cases where randomize was being called on a
vector, and is a little cleaner in the code as well, instead of
vec.resize(length);
rng.randomize(&vec[0], vec.size());
we just write
vec = rng.random_vec(length);
Diffstat (limited to 'src/constructs/passhash')
-rw-r--r-- | src/constructs/passhash/passhash9.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/constructs/passhash/passhash9.cpp b/src/constructs/passhash/passhash9.cpp index c120b39c5..adde40ed5 100644 --- a/src/constructs/passhash/passhash9.cpp +++ b/src/constructs/passhash/passhash9.cpp @@ -121,7 +121,7 @@ bool check_passhash9(const std::string& pass, const std::string& hash) byte alg_id = bin[0]; u32bit kdf_iterations = - WORK_FACTOR_SCALE * load_be<u16bit>(bin + ALGID_BYTES, 0); + WORK_FACTOR_SCALE * load_be<u16bit>(&bin[ALGID_BYTES], 0); if(kdf_iterations == 0) return false; |