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
prov
tpm2
tpm2_rng.h
Go to the documentation of this file.
1
/*
2
* TPM 2 RNG interface
3
* (C) 2024 Jack Lloyd
4
* (C) 2024 René Meusel, Amos Treiber - Rohde & Schwarz Cybersecurity GmbH, financed by LANCOM Systems GmbH
5
*
6
* Botan is released under the Simplified BSD License (see license.txt)
7
*/
8
9
#ifndef BOTAN_TPM2_RNG_H_
10
#define BOTAN_TPM2_RNG_H_
11
12
#include <botan/rng.h>
13
#include <botan/tpm2_context.h>
14
#include <botan/tpm2_session.h>
15
16
namespace
Botan::TPM2
{
17
18
/**
19
* This class implements a random number generator that uses the TPM 2.0 device
20
* as a source of randomness.
21
*/
22
class
BOTAN_PUBLIC_API
(3, 6)
RandomNumberGenerator
final
:
public
Hardware_RNG
{
23
public
:
24
RandomNumberGenerator
(std::shared_ptr<Context> ctx,
SessionBundle
sessions = {});
25
26
bool
accepts_input
()
const override
{
return
true
; }
27
28
std::string
name
()
const override
{
return
"TPM2_RNG"
; }
29
30
bool
is_seeded
()
const override
{
return
true
; }
31
32
private
:
33
void
fill_bytes_with_input(std::span<uint8_t> output, std::span<const uint8_t> input)
override
;
34
35
private
:
36
std::shared_ptr<Context> m_ctx;
37
SessionBundle
m_sessions;
38
39
size_t
m_max_tpm2_rng_bytes;
40
};
22
class
BOTAN_PUBLIC_API
(3, 6)
RandomNumberGenerator
final
:
public
Hardware_RNG
{
…
};
41
42
}
// namespace Botan::TPM2
43
44
#endif
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition
api.h:19
Botan::Hardware_RNG
Definition
rng.h:274
Botan::TPM2::RandomNumberGenerator
Definition
tpm2_rng.h:22
Botan::TPM2::RandomNumberGenerator::accepts_input
bool accepts_input() const override
Definition
tpm2_rng.h:26
Botan::TPM2::RandomNumberGenerator::name
std::string name() const override
Definition
tpm2_rng.h:28
Botan::TPM2::RandomNumberGenerator::is_seeded
bool is_seeded() const override
Definition
tpm2_rng.h:30
Botan::TPM2::SessionBundle
Definition
tpm2_session.h:173
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
Botan::TPM2
Definition
tpm2_algo_mappings.h:24
Generated by
1.12.0