8#include <botan/internal/kdf1.h>
10#include <botan/exceptn.h>
11#include <botan/internal/fmt.h>
16 return fmt(
"KDF1({})", m_hash->name());
20 return std::make_unique<KDF1>(m_hash->new_object());
25 const uint8_t secret[],
29 const uint8_t label[],
30 size_t label_len)
const {
35 if(key_len > m_hash->output_length()) {
39 m_hash->update(secret, secret_len);
40 m_hash->update(label, label_len);
41 m_hash->update(salt, salt_len);
43 if(key_len == m_hash->output_length()) {
void 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 override
std::unique_ptr< KDF > new_object() const override
std::string name() const override
std::string fmt(std::string_view format, const T &... args)
std::vector< T, secure_allocator< T > > secure_vector
constexpr void copy_mem(T *out, const T *in, size_t n)