aboutsummaryrefslogtreecommitdiffstats
path: root/util/random/entropy.h
blob: 9cb3b2abaea2183178749cc6593884ec17d73038 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

class TBuffer;
class IInputStream; 

/*
 * fast entropy pool, based on good prng, can lock for some time
 * initialized with some bits from system entropy pool
 * think as /dev/urandom replacement
 */
IInputStream& EntropyPool(); 

/*
 * fast(non-blocking) entropy pool, useful for seeding PRNGs
 */
IInputStream& Seed(); 

/*
 * Re-initialize entropy pool - useful after forking in multi-process programs.
 */
void ResetEntropyPool();