aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/sp800_56c/sp800_56c.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-06-17 14:00:40 -0400
committerJack Lloyd <[email protected]>2016-06-17 14:00:40 -0400
commit62df969643bdee70a78b7254a98a6a7c4a21b34a (patch)
tree4684c10452725c7dd9ba95c24171a309e4dd1526 /src/lib/kdf/sp800_56c/sp800_56c.cpp
parenta4bfe3df7e4572d95b266891adab50fef3bf3387 (diff)
parent9e6ce11e96676b13205d60f531420be3eb89acd5 (diff)
Merge GH #495 Add label argument to KDF::derive_key
Diffstat (limited to 'src/lib/kdf/sp800_56c/sp800_56c.cpp')
-rw-r--r--src/lib/kdf/sp800_56c/sp800_56c.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/kdf/sp800_56c/sp800_56c.cpp b/src/lib/kdf/sp800_56c/sp800_56c.cpp
index 664d32b30..338feba2a 100644
--- a/src/lib/kdf/sp800_56c/sp800_56c.cpp
+++ b/src/lib/kdf/sp800_56c/sp800_56c.cpp
@@ -27,17 +27,18 @@ SP800_56C* SP800_56C::make(const Spec& spec)
size_t SP800_56C::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
{
// Randomness Extraction
- secure_vector< byte > k_dk, context;
+ secure_vector< byte > k_dk;
m_prf->set_key(salt, salt_len);
m_prf->update(secret, secret_len);
m_prf->final(k_dk);
// Key Expansion
- m_exp->kdf(key, key_len, k_dk.data(), k_dk.size(), context.data(), context.size());
+ m_exp->kdf(key, key_len, k_dk.data(), k_dk.size(), nullptr, 0, label, label_len);
return key_len;
}