aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pbkdf
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-10-01 05:28:59 -0400
committerJack Lloyd <[email protected]>2018-10-01 05:28:59 -0400
commitb96189789154222a8de57e31deb457be4208b4b3 (patch)
tree3e507015919fe4c73ccdabd3903fdcf178d5fd1b /src/lib/pbkdf
parent388530b25b3de0e33f85612d91721dc190b3347d (diff)
Fix more MSVC warnings
Diffstat (limited to 'src/lib/pbkdf')
-rw-r--r--src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp b/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp
index 3f2c564c8..1cd07c490 100644
--- a/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp
+++ b/src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp
@@ -20,7 +20,7 @@ uint8_t RFC4880_encode_count(size_t desired_iterations)
for(size_t c = 0; c < 256; ++c)
{
// TODO could binary search
- const uint32_t decoded_iter = RFC4880_decode_count(c);
+ const size_t decoded_iter = RFC4880_decode_count(static_cast<uint8_t>(c));
if(decoded_iter >= desired_iterations)
return static_cast<uint8_t>(c);
}
@@ -178,7 +178,7 @@ std::unique_ptr<PasswordHash> RFC4880_S2K_Family::tune(size_t output_len, std::c
const size_t blocks_required = (output_len <= hash_size ? 1 : (output_len + hash_size - 1) / hash_size);
const double bytes_to_be_hashed = (hash_bytes_per_second * (desired_nsec / 1000000000.0)) / blocks_required;
- const size_t iterations = RFC4880_round_iterations(bytes_to_be_hashed);
+ const size_t iterations = RFC4880_round_iterations(static_cast<size_t>(bytes_to_be_hashed));
return std::unique_ptr<PasswordHash>(new RFC4880_S2K(m_hash->clone(), iterations));
}