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/kdf/hkdf/hkdf.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/kdf/hkdf/hkdf.cpp')
-rw-r--r-- | src/lib/kdf/hkdf/hkdf.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/kdf/hkdf/hkdf.cpp b/src/lib/kdf/hkdf/hkdf.cpp index f44ed81bd..20215125b 100644 --- a/src/lib/kdf/hkdf/hkdf.cpp +++ b/src/lib/kdf/hkdf/hkdf.cpp @@ -10,28 +10,28 @@ namespace Botan { -size_t HKDF::kdf(byte key[], size_t key_len, - const byte secret[], size_t secret_len, - const byte salt[], size_t salt_len, - const byte label[], size_t label_len) const +size_t HKDF::kdf(uint8_t key[], size_t key_len, + const uint8_t secret[], size_t secret_len, + const uint8_t salt[], size_t salt_len, + const uint8_t label[], size_t label_len) const { HKDF_Extract extract(m_prf->clone()); HKDF_Expand expand(m_prf->clone()); - secure_vector<byte> prk(m_prf->output_length()); + secure_vector<uint8_t> prk(m_prf->output_length()); extract.kdf(prk.data(), prk.size(), secret, secret_len, salt, salt_len, nullptr, 0); return expand.kdf(key, key_len, prk.data(), prk.size(), nullptr, 0, label, label_len); } -size_t HKDF_Extract::kdf(byte key[], size_t key_len, - const byte secret[], size_t secret_len, - const byte salt[], size_t salt_len, - const byte[], size_t) const +size_t HKDF_Extract::kdf(uint8_t key[], size_t key_len, + const uint8_t secret[], size_t secret_len, + const uint8_t salt[], size_t salt_len, + const uint8_t[], size_t) const { - secure_vector<byte> prk; + secure_vector<uint8_t> prk; if(salt_len == 0) { - m_prf->set_key(std::vector<byte>(m_prf->output_length())); + m_prf->set_key(std::vector<uint8_t>(m_prf->output_length())); } else { @@ -46,15 +46,15 @@ size_t HKDF_Extract::kdf(byte key[], size_t key_len, return written; } -size_t HKDF_Expand::kdf(byte key[], size_t key_len, - const byte secret[], size_t secret_len, - const byte salt[], size_t salt_len, - const byte label[], size_t label_len) const +size_t HKDF_Expand::kdf(uint8_t key[], size_t key_len, + const uint8_t secret[], size_t secret_len, + const uint8_t salt[], size_t salt_len, + const uint8_t label[], size_t label_len) const { m_prf->set_key(secret, secret_len); - byte counter = 1; - secure_vector<byte> h; + uint8_t counter = 1; + secure_vector<uint8_t> h; size_t offset = 0; while(offset != key_len && counter != 0) |