8#include <botan/pbkdf2.h>
9#include <botan/get_byte.h>
10#include <botan/internal/xor_buf.h>
18 const std::string& passphrase,
19 const byte salt[],
size_t salt_size,
20 size_t iterations)
const
27 mac->set_key(
reinterpret_cast<const byte*
>(passphrase.data()),
32 throw Exception(
name() +
" cannot accept passphrases of length " +
45 size_t T_size = std::min<size_t>(mac->output_length(), key_len);
47 mac->update(salt, salt_size);
48 mac->update_be(counter);
53 for(
size_t j = 1; j != iterations; ++j)
OctetString derive_key(size_t output_len, const std::string &passphrase, const byte salt[], size_t salt_len, size_t iterations) const
std::string to_string(u64bit n, size_t min_len)
std::runtime_error Exception
void xor_buf(byte out[], const byte in[], size_t length)
std::invalid_argument Invalid_Argument