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
processor_rng
processor_rng.h
Go to the documentation of this file.
1
/*
2
* (C) 2016,2019,2020 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#ifndef BOTAN_RNG_PROCESSOR_RNG_H_
8
#define BOTAN_RNG_PROCESSOR_RNG_H_
9
10
#include <botan/rng.h>
11
12
namespace
Botan
{
13
14
/**
15
* Directly invokes a CPU specific instruction to generate random numbers.
16
* On x86, the RDRAND instruction is used.
17
* on POWER, the DARN instruction is used.
18
*/
19
class
BOTAN_PUBLIC_API
(2, 15)
Processor_RNG
final
:
public
Hardware_RNG
{
20
public
:
21
/**
22
* Constructor will throw if CPU does not have RDRAND bit set
23
*/
24
Processor_RNG
();
25
26
/**
27
* Return true if RNG instruction is available on the current processor
28
*/
29
static
bool
available();
30
31
bool
accepts_input
()
const override
{
return
false
; }
32
33
bool
is_seeded
()
const override
{
return
true
; }
34
35
/*
36
* No way to reseed processor provided generator, so reseed is ignored
37
*/
38
size_t
reseed(
Entropy_Sources
&,
size_t
, std::chrono::milliseconds)
override
;
39
40
std::string
name
()
const override
;
41
42
private
:
43
void
fill_bytes_with_input(std::span<uint8_t> out, std::span<const uint8_t> in)
override
;
44
};
19
class
BOTAN_PUBLIC_API
(2, 15)
Processor_RNG
final
:
public
Hardware_RNG
{
…
};
45
46
}
// namespace Botan
47
48
#endif
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition
api.h:19
Botan::Entropy_Sources
Definition
entropy_src.h:55
Botan::Hardware_RNG
Definition
rng.h:274
Botan::Processor_RNG
Definition
processor_rng.h:19
Botan::Processor_RNG::is_seeded
bool is_seeded() const override
Definition
processor_rng.h:33
Botan::Processor_RNG::accepts_input
bool accepts_input() const override
Definition
processor_rng.h:31
name
std::string name
Definition
commoncrypto_hash.cpp:24
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0