Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
rng
auto_rng
auto_rng.h
Go to the documentation of this file.
1
/*
2
* Auto Seeded RNG
3
* (C) 2008,2016 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_AUTO_SEEDING_RNG_H_
9
#define BOTAN_AUTO_SEEDING_RNG_H_
10
11
#include <botan/rng.h>
12
13
namespace
Botan
{
14
15
class
Stateful_RNG;
16
17
/**
18
* A userspace PRNG
19
*/
20
class
BOTAN_PUBLIC_API
(2, 0)
AutoSeeded_RNG
final
:
public
RandomNumberGenerator
{
21
public
:
22
bool
is_seeded()
const override
;
23
24
bool
accepts_input
()
const override
{
return
true
; }
25
26
/**
27
* Mark state as requiring a reseed on next use
28
*/
29
void
force_reseed();
30
31
size_t
reseed(
Entropy_Sources
& srcs,
32
size_t
poll_bits =
BOTAN_RNG_RESEED_POLL_BITS
,
33
std::chrono::milliseconds poll_timeout =
BOTAN_RNG_RESEED_DEFAULT_TIMEOUT
)
override
;
34
35
std::string
name
()
const override
;
36
37
void
clear()
override
;
38
39
/**
40
* Uses the system RNG (if available) or else a default group of
41
* entropy sources (all other systems) to gather seed material.
42
*
43
* @param reseed_interval specifies a limit of how many times
44
* the RNG will be called before automatic reseeding is performed
45
*/
46
AutoSeeded_RNG
(
size_t
reseed_interval =
BOTAN_RNG_DEFAULT_RESEED_INTERVAL
);
47
48
/**
49
* Create an AutoSeeded_RNG which will get seed material from some other
50
* RNG instance. For example you could provide a reference to the system
51
* RNG or a hardware RNG.
52
*
53
* @param underlying_rng is a reference to some RNG which will be used
54
* to perform the periodic reseeding
55
* @param reseed_interval specifies a limit of how many times
56
* the RNG will be called before automatic reseeding is performed
57
*/
58
AutoSeeded_RNG
(
RandomNumberGenerator
& underlying_rng,
size_t
reseed_interval =
BOTAN_RNG_DEFAULT_RESEED_INTERVAL
);
59
60
/**
61
* Create an AutoSeeded_RNG which will get seed material from a set of
62
* entropy sources.
63
*
64
* @param entropy_sources will be polled to perform reseeding periodically
65
* @param reseed_interval specifies a limit of how many times
66
* the RNG will be called before automatic reseeding is performed
67
*/
68
AutoSeeded_RNG
(
Entropy_Sources
& entropy_sources,
size_t
reseed_interval =
BOTAN_RNG_DEFAULT_RESEED_INTERVAL
);
69
70
/**
71
* Create an AutoSeeded_RNG which will get seed material from both an
72
* underlying RNG and a set of entropy sources.
73
*
74
* @param underlying_rng is a reference to some RNG which will be used
75
* to perform the periodic reseeding
76
* @param entropy_sources will be polled to perform reseeding periodically
77
* @param reseed_interval specifies a limit of how many times
78
* the RNG will be called before automatic reseeding is performed
79
*/
80
AutoSeeded_RNG
(
RandomNumberGenerator
& underlying_rng,
81
Entropy_Sources
& entropy_sources,
82
size_t
reseed_interval =
BOTAN_RNG_DEFAULT_RESEED_INTERVAL
);
83
84
~AutoSeeded_RNG
()
override
;
85
86
private
:
87
void
fill_bytes_with_input(std::span<uint8_t> out, std::span<const uint8_t> in)
override
;
88
89
private
:
90
std::unique_ptr<Stateful_RNG> m_rng;
91
};
20
class
BOTAN_PUBLIC_API
(2, 0)
AutoSeeded_RNG
final
:
public
RandomNumberGenerator
{
…
};
92
93
}
// namespace Botan
94
95
#endif
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition
api.h:19
Botan::AutoSeeded_RNG
Definition
auto_rng.h:20
Botan::AutoSeeded_RNG::~AutoSeeded_RNG
~AutoSeeded_RNG() override
Botan::AutoSeeded_RNG::accepts_input
bool accepts_input() const override
Definition
auto_rng.h:24
Botan::Entropy_Sources
Definition
entropy_src.h:55
Botan::RandomNumberGenerator
Definition
rng.h:31
name
std::string name
Definition
commoncrypto_hash.cpp:24
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
BOTAN_RNG_DEFAULT_RESEED_INTERVAL
#define BOTAN_RNG_DEFAULT_RESEED_INTERVAL
Definition
build.h:514
BOTAN_RNG_RESEED_DEFAULT_TIMEOUT
#define BOTAN_RNG_RESEED_DEFAULT_TIMEOUT
Definition
build.h:519
BOTAN_RNG_RESEED_POLL_BITS
#define BOTAN_RNG_RESEED_POLL_BITS
Definition
build.h:517
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0