monotone

monotone Mtn Source Tree

Root/botan/randpool.h

1/*************************************************
2* Randpool Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_RANDPOOL_H__
7#define BOTAN_RANDPOOL_H__
8
9#include <botan/base.h>
10
11namespace Botan {
12
13/*************************************************
14* Randpool *
15*************************************************/
16class Randpool : public RandomNumberGenerator
17 {
18 public:
19 void randomize(byte[], u32bit) throw(PRNG_Unseeded);
20 bool is_seeded() const;
21 void clear() throw();
22 std::string name() const;
23
24 Randpool();
25 ~Randpool();
26 private:
27 void add_randomness(const byte[], u32bit);
28 void update_buffer();
29 void mix_pool();
30
31 const u32bit ITERATIONS_BEFORE_RESEED, POOL_BLOCKS;
32 BlockCipher* cipher;
33 MessageAuthenticationCode* mac;
34
35 SecureVector<byte> pool, buffer, counter;
36 u32bit entropy;
37 };
38
39}
40
41#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status