diff options
author | Jack Lloyd <[email protected]> | 2019-06-14 10:52:40 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-06-14 10:52:40 -0400 |
commit | ed65dcf5d0f8f0cb4a5ec2c74653d4737aaa7c38 (patch) | |
tree | bce8bf4a35553ac6198f56d6daba1462048157a5 | |
parent | 1e160e460357d318326733007c7aeb015e333651 (diff) |
Resolve some MSVC warnings
-rw-r--r-- | src/lib/pbkdf/argon2/argon2.h | 2 | ||||
-rw-r--r-- | src/lib/pbkdf/argon2/argon2pwhash.cpp | 10 | ||||
-rw-r--r-- | src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp | 2 | ||||
-rw-r--r-- | src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h | 2 | ||||
-rw-r--r-- | src/lib/pbkdf/scrypt/scrypt.cpp | 2 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/point_gfp.h | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/pbkdf/argon2/argon2.h b/src/lib/pbkdf/argon2/argon2.h index e0fe1d83d..e17456676 100644 --- a/src/lib/pbkdf/argon2/argon2.h +++ b/src/lib/pbkdf/argon2/argon2.h @@ -28,7 +28,7 @@ class BOTAN_PUBLIC_API(2,11) Argon2 final : public PasswordHash * Derive a new key under the current Argon2 parameter set */ void derive_key(uint8_t out[], size_t out_len, - const char* password, const size_t password_len, + const char* password, size_t password_len, const uint8_t salt[], size_t salt_len) const override; std::string to_string() const override; diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp index 5af3c709b..25788c0bb 100644 --- a/src/lib/pbkdf/argon2/argon2pwhash.cpp +++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp @@ -19,7 +19,7 @@ Argon2::Argon2(uint8_t family, size_t M, size_t t, size_t p) : {} void Argon2::derive_key(uint8_t output[], size_t output_len, - const char* password, const size_t password_len, + const char* password, size_t password_len, const uint8_t salt[], size_t salt_len) const { argon2(output, output_len, @@ -111,17 +111,17 @@ std::unique_ptr<PasswordHash> Argon2_Family::tune(size_t /*output_length*/, if(est_nsec < target_nsec && M < max_kib) { - const size_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec; - const size_t mem_headroom = max_kib / M; + const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec; + const uint64_t mem_headroom = max_kib / M; - const size_t M_mult = std::min(desired_cost_increase, mem_headroom); + const uint64_t M_mult = std::min(desired_cost_increase, mem_headroom); M *= M_mult; est_nsec *= M_mult; } if(est_nsec < target_nsec) { - const size_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec; + const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec; t *= desired_cost_increase; } diff --git a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp index ecdac689a..f4e7676bd 100644 --- a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp +++ b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp @@ -12,7 +12,7 @@ namespace Botan { void Bcrypt_PBKDF::derive_key(uint8_t output[], size_t output_len, - const char* password, const size_t password_len, + const char* password, size_t password_len, const uint8_t salt[], size_t salt_len) const { bcrypt_pbkdf(output, output_len, diff --git a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h index 8984e6497..5f0f9e80f 100644 --- a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h +++ b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h @@ -26,7 +26,7 @@ class BOTAN_PUBLIC_API(2,11) Bcrypt_PBKDF final : public PasswordHash * Derive a new key under the current Bcrypt-PBKDF parameter set */ void derive_key(uint8_t out[], size_t out_len, - const char* password, const size_t password_len, + const char* password, size_t password_len, const uint8_t salt[], size_t salt_len) const override; std::string to_string() const override; diff --git a/src/lib/pbkdf/scrypt/scrypt.cpp b/src/lib/pbkdf/scrypt/scrypt.cpp index e50073669..d493c17e1 100644 --- a/src/lib/pbkdf/scrypt/scrypt.cpp +++ b/src/lib/pbkdf/scrypt/scrypt.cpp @@ -97,7 +97,7 @@ std::unique_ptr<PasswordHash> Scrypt_Family::tune(size_t output_length, // If we have extra runtime budget, increment p if(target_nsec / est_nsec > 2) - p *= std::min<size_t>(1024, (target_nsec / est_nsec)); + p *= std::min<uint64_t>(1024, (target_nsec / est_nsec)); return std::unique_ptr<PasswordHash>(new Scrypt(N, r, p)); } diff --git a/src/lib/pubkey/ec_group/point_gfp.h b/src/lib/pubkey/ec_group/point_gfp.h index aa8a7d7bc..a233c5b94 100644 --- a/src/lib/pubkey/ec_group/point_gfp.h +++ b/src/lib/pubkey/ec_group/point_gfp.h @@ -419,7 +419,7 @@ class PointGFp_Var_Point_Precompute; * Deprecated API for point multiplication * Use EC_Group::blinded_base_point_multiply or EC_Group::blinded_var_point_multiply */ -class BOTAN_PUBLIC_API(2,0) BOTAN_DEPRECATED("See comments") Blinded_Point_Multiply final +class BOTAN_PUBLIC_API(2,0) BOTAN_DEPRECATED("Use alternative APIs") Blinded_Point_Multiply final { public: Blinded_Point_Multiply(const PointGFp& base, const BigInt& order, size_t h = 0); |