Botan 1.10.17
x931_rng.h
Go to the documentation of this file.
1/*
2* ANSI X9.31 RNG
3* (C) 1999-2009 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_ANSI_X931_RNG_H__
9#define BOTAN_ANSI_X931_RNG_H__
10
11#include <botan/rng.h>
12#include <botan/block_cipher.h>
13
14namespace Botan {
15
16/**
17* ANSI X9.31 RNG
18*/
19class BOTAN_DLL ANSI_X931_RNG : public RandomNumberGenerator
20 {
21 public:
22 void randomize(byte[], size_t);
23 bool is_seeded() const;
24 void clear();
25 std::string name() const;
26
27 void reseed(size_t poll_bits);
29 void add_entropy(const byte[], size_t);
30
31 /**
32 * @param cipher the block cipher to use in this PRNG
33 * @param rng the underlying PRNG for generating inputs
34 * (eg, an HMAC_RNG)
35 */
39 private:
40 void rekey();
41 void update_buffer();
42
43 BlockCipher* cipher;
46 size_t position;
47 };
48
49}
50
51#endif
bool is_seeded() const
Definition x931_rng.cpp:103
void reseed(size_t poll_bits)
Definition x931_rng.cpp:77
ANSI_X931_RNG(BlockCipher *cipher, RandomNumberGenerator *rng)
Definition x931_rng.cpp:132
void add_entropy(const byte[], size_t)
Definition x931_rng.cpp:94
void randomize(byte[], size_t)
Definition x931_rng.cpp:17
void add_entropy_source(EntropySource *)
Definition x931_rng.cpp:86
std::string name() const
Definition x931_rng.cpp:124