diff options
author | Jack Lloyd <[email protected]> | 2016-12-11 15:28:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-18 16:48:24 -0500 |
commit | f3cb3edb512bdcab498d825886c3366c341b3f78 (patch) | |
tree | 645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/pbkdf/pbkdf2/pbkdf2.cpp | |
parent | c1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff) |
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency,
eg make_u32bit becomes make_uint32. The old typedefs remain for now
since probably lots of application code uses them.
Diffstat (limited to 'src/lib/pbkdf/pbkdf2/pbkdf2.cpp')
-rw-r--r-- | src/lib/pbkdf/pbkdf2/pbkdf2.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp index 0041fd537..03e746717 100644 --- a/src/lib/pbkdf/pbkdf2/pbkdf2.cpp +++ b/src/lib/pbkdf/pbkdf2/pbkdf2.cpp @@ -13,10 +13,10 @@ namespace Botan { size_t pbkdf2(MessageAuthenticationCode& prf, - byte out[], + uint8_t out[], size_t out_len, const std::string& passphrase, - const byte salt[], size_t salt_len, + const uint8_t salt[], size_t salt_len, size_t iterations, std::chrono::milliseconds msec) { @@ -27,7 +27,7 @@ pbkdf2(MessageAuthenticationCode& prf, try { - prf.set_key(reinterpret_cast<const byte*>(passphrase.data()), passphrase.size()); + prf.set_key(reinterpret_cast<const uint8_t*>(passphrase.data()), passphrase.size()); } catch(Invalid_Key_Length&) { @@ -37,14 +37,14 @@ pbkdf2(MessageAuthenticationCode& prf, } const size_t prf_sz = prf.output_length(); - secure_vector<byte> U(prf_sz); + secure_vector<uint8_t> U(prf_sz); const size_t blocks_needed = round_up(out_len, prf_sz) / prf_sz; std::chrono::microseconds usec_per_block = std::chrono::duration_cast<std::chrono::microseconds>(msec) / blocks_needed; - u32bit counter = 1; + uint32_t counter = 1; while(out_len) { const size_t prf_output = std::min<size_t>(prf_sz, out_len); @@ -105,9 +105,9 @@ pbkdf2(MessageAuthenticationCode& prf, } size_t -PKCS5_PBKDF2::pbkdf(byte key[], size_t key_len, +PKCS5_PBKDF2::pbkdf(uint8_t key[], size_t key_len, const std::string& passphrase, - const byte salt[], size_t salt_len, + const uint8_t salt[], size_t salt_len, size_t iterations, std::chrono::milliseconds msec) const { |