-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed files and classes according to new revisions
- Loading branch information
1 parent
58d1004
commit bab8300
Showing
6 changed files
with
100 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Two-Step KDF defined in NIST SP 800-56Cr2 (Section 5) | ||
* (C) 2016 Kai Michaelis | ||
* | ||
* Botan is released under the Simplified BSD License (see license.txt) | ||
*/ | ||
|
||
#include <botan/internal/sp800_56c_two_step.h> | ||
|
||
#include <botan/internal/fmt.h> | ||
|
||
namespace Botan { | ||
|
||
std::string SP800_56C_Two_Step::name() const { | ||
return fmt("SP800-56C({})", m_prf->name()); | ||
} | ||
|
||
std::unique_ptr<KDF> SP800_56C_Two_Step::new_object() const { | ||
return std::make_unique<SP800_56C_Two_Step>(m_prf->new_object(), m_exp->new_object()); | ||
} | ||
|
||
void SP800_56C_Two_Step::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 { | ||
// Randomness Extraction | ||
secure_vector<uint8_t> 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(), nullptr, 0, label, label_len); | ||
} | ||
|
||
} // namespace Botan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters