diff options
author | Jack Lloyd <[email protected]> | 2016-06-20 01:37:48 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-06-20 01:37:48 -0400 |
commit | c5369fc6f43379e9cb2f32e3d5b9a5ccd8f7ca1c (patch) | |
tree | 78e7f7064e5f6448ee5dc6b40f68fa83d91c477b /src | |
parent | 9a6621f473de4d2a49ed47e9a3db7cbf574b9236 (diff) |
Update KDF1-ISO 18033 with KDF label argument
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp | 4 | ||||
-rw-r--r-- | src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp index 3ff717993..b40fe55cc 100644 --- a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp +++ b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.cpp @@ -11,7 +11,8 @@ namespace Botan { size_t KDF1_18033::kdf(byte key[], size_t key_len, const byte secret[], size_t secret_len, - const byte salt[], size_t salt_len) const + const byte salt[], size_t salt_len, + const byte label[], size_t label_len) const { u32bit counter = 0; secure_vector<byte> h; @@ -21,6 +22,7 @@ size_t KDF1_18033::kdf(byte key[], size_t key_len, { m_hash->update(secret, secret_len); m_hash->update_be(counter++); + m_hash->update(label, label_len); m_hash->update(salt, salt_len); m_hash->final(h); diff --git a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h index 6ec7ead8e..d6ce851ae 100644 --- a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h +++ b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h @@ -25,7 +25,8 @@ class BOTAN_DLL KDF1_18033 : public KDF size_t kdf(byte key[], size_t key_len, const byte secret[], size_t secret_len, - const byte salt[], size_t salt_len) const override; + const byte salt[], size_t salt_len, + const byte label[], size_t label_len) const override; KDF1_18033(HashFunction* h) : m_hash(h) {} private: |