diff options
author | Jack Lloyd <[email protected]> | 2019-06-29 16:16:21 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-06-29 17:11:19 -0400 |
commit | 8b8745236368c70a82db2b19feeed5e9f9b59c5b (patch) | |
tree | 1495a04a7e6f117e2cacd69ff0f7b2c4a31ddee9 /src/lib/pbkdf/argon2 | |
parent | 5922b1c3abf00c0e22e86498e1ee3a51e5343b0f (diff) |
Fix various MSVC warnings
Diffstat (limited to 'src/lib/pbkdf/argon2')
-rw-r--r-- | src/lib/pbkdf/argon2/argon2.h | 2 | ||||
-rw-r--r-- | src/lib/pbkdf/argon2/argon2fmt.cpp | 4 | ||||
-rw-r--r-- | src/lib/pbkdf/argon2/argon2pwhash.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/pbkdf/argon2/argon2.h b/src/lib/pbkdf/argon2/argon2.h index 15bda45cc..a6fa03314 100644 --- a/src/lib/pbkdf/argon2/argon2.h +++ b/src/lib/pbkdf/argon2/argon2.h @@ -95,7 +95,7 @@ std::string BOTAN_PUBLIC_API(2,11) argon2_generate_pwhash(const char* password, size_t password_len, RandomNumberGenerator& rng, size_t p, size_t M, size_t t, - size_t y = 2, size_t salt_len = 16, size_t output_len = 32); + uint8_t y = 2, size_t salt_len = 16, size_t output_len = 32); /** * Check a previously created password hash diff --git a/src/lib/pbkdf/argon2/argon2fmt.cpp b/src/lib/pbkdf/argon2/argon2fmt.cpp index f64cd2bbd..480be5fa3 100644 --- a/src/lib/pbkdf/argon2/argon2fmt.cpp +++ b/src/lib/pbkdf/argon2/argon2fmt.cpp @@ -26,7 +26,7 @@ std::string strip_padding(std::string s) std::string argon2_generate_pwhash(const char* password, size_t password_len, RandomNumberGenerator& rng, size_t p, size_t M, size_t t, - size_t y, size_t salt_len, size_t output_len) + uint8_t y, size_t salt_len, size_t output_len) { std::vector<uint8_t> salt(salt_len); rng.randomize(salt.data(), salt.size()); @@ -62,7 +62,7 @@ bool argon2_check_pwhash(const char* password, size_t password_len, if(parts.size() != 5) return false; - size_t family = 0; + uint8_t family = 0; if(parts[0] == "argon2d") family = 0; diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp index 25788c0bb..4eb2570f6 100644 --- a/src/lib/pbkdf/argon2/argon2pwhash.cpp +++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp @@ -115,14 +115,14 @@ std::unique_ptr<PasswordHash> Argon2_Family::tune(size_t /*output_length*/, const uint64_t mem_headroom = max_kib / M; const uint64_t M_mult = std::min(desired_cost_increase, mem_headroom); - M *= M_mult; + M *= static_cast<size_t>(M_mult); est_nsec *= M_mult; } if(est_nsec < target_nsec) { const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec; - t *= desired_cost_increase; + t *= static_cast<size_t>(desired_cost_increase); } return this->from_params(M, t, p); |