Botan
3.8.1
Crypto and TLS for C&
src
lib
rng
jitter_rng
jitter_rng.h
Go to the documentation of this file.
1
/*
2
* CPU Jitter Random Number Generator
3
* (C) 2024 Planck Security S.A.
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_JITTER_RNG_H_
9
#define BOTAN_JITTER_RNG_H_
10
11
#include <botan/rng.h>
12
#include <memory>
13
#include <string>
14
15
namespace
Botan
{
16
17
struct
Jitter_RNG_Internal;
18
19
/*
20
* RNG using libjitterentropy (https://github.com/smuellerDD/jitterentropy-library).
21
*/
22
class
BOTAN_PUBLIC_API
(3, 6)
Jitter_RNG
final :
public
RandomNumberGenerator
{
23
public
:
24
Jitter_RNG
();
25
~Jitter_RNG
();
26
27
std::string
name
()
const override
{
return
"JitterRNG"
; }
28
29
bool
is_seeded
()
const override
{
return
true
; }
30
31
bool
accepts_input
()
const override
{
return
false
; }
32
33
void
clear()
override
;
34
35
private
:
36
void
fill_bytes_with_input(std::span<uint8_t> out, std::span<const uint8_t> in)
override
;
37
38
std::unique_ptr<Jitter_RNG_Internal> m_jitter;
39
};
40
41
}
// namespace Botan
42
43
#endif
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition
api.h:19
Botan::Jitter_RNG::name
std::string name() const override
Definition
jitter_rng.h:27
Botan::Jitter_RNG::~Jitter_RNG
~Jitter_RNG()
Botan::Jitter_RNG::is_seeded
bool is_seeded() const override
Definition
jitter_rng.h:29
Botan::Jitter_RNG::accepts_input
bool accepts_input() const override
Definition
jitter_rng.h:31
Botan::Jitter_RNG::Jitter_RNG
Jitter_RNG()
Definition
jitter_rng.cpp:85
Botan::RandomNumberGenerator::RandomNumberGenerator
RandomNumberGenerator()=default
Botan
Definition
alg_id.cpp:13
Generated by
1.13.2