8#include <botan/prf_ssl3.h>
9#include <botan/symkey.h>
10#include <botan/exceptn.h>
11#include <botan/sha160.h>
13#include <botan/internal/assert.h>
25 const byte secret[],
size_t secret_len,
26 const byte seed[],
size_t seed_len)
28 BOTAN_ASSERT(want <= md5.output_length(),
"Desired output too large");
30 const byte ASCII_A_CHAR = 0x41;
32 for(
size_t j = 0; j != where + 1; j++)
33 sha1.update(
static_cast<byte>(ASCII_A_CHAR + where));
34 sha1.update(secret, secret_len);
35 sha1.update(seed, seed_len);
38 md5.update(secret, secret_len);
39 md5.update(sha1_hash);
51 const byte secret[],
size_t secret_len,
52 const byte seed[],
size_t seed_len)
const
65 const size_t produce = std::min<size_t>(key_len, md5.
output_length());
67 output = output + next_hash(counter++, produce, md5, sha1,
68 secret, secret_len, seed, seed_len);
#define BOTAN_ASSERT(expr, msg)
size_t output_length() const
OctetString(class RandomNumberGenerator &rng, size_t len)
SecureVector< byte > bits_of() const
SecureVector< byte > derive(size_t, const byte[], size_t, const byte[], size_t) const
std::invalid_argument Invalid_Argument