Botan
2.19.3
Crypto and TLS for C&
src
lib
entropy
proc_walk
proc_walk.h
Go to the documentation of this file.
1
/*
2
* File Tree Walking EntropySource
3
* (C) 1999-2008 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_ENTROPY_SRC_PROC_WALK_H_
9
#define BOTAN_ENTROPY_SRC_PROC_WALK_H_
10
11
#include <botan/entropy_src.h>
12
#include <botan/mutex.h>
13
14
namespace
Botan
{
15
16
class
File_Descriptor_Source
17
{
18
public
:
19
virtual
int
next_fd
() = 0;
20
virtual
~File_Descriptor_Source
() =
default
;
21
};
22
23
/**
24
* File Tree Walking Entropy Source
25
*/
26
class
ProcWalking_EntropySource
final
:
public
Entropy_Source
27
{
28
public
:
29
std::string
name
()
const override
{
return
"proc_walk"
; }
30
31
size_t
poll
(
RandomNumberGenerator
& rng)
override
;
32
33
explicit
ProcWalking_EntropySource
(
const
std::string& root_dir) :
34
m_path(root_dir), m_dir(nullptr) {}
35
36
private
:
37
const
std::string m_path;
38
mutex_type
m_mutex;
39
std::unique_ptr<File_Descriptor_Source> m_dir;
40
secure_vector<uint8_t>
m_buf;
41
};
42
43
}
44
45
#endif
Botan::Entropy_Source
Definition
entropy_src.h:26
Botan::File_Descriptor_Source
Definition
proc_walk.h:17
Botan::File_Descriptor_Source::~File_Descriptor_Source
virtual ~File_Descriptor_Source()=default
Botan::File_Descriptor_Source::next_fd
virtual int next_fd()=0
Botan::ProcWalking_EntropySource
Definition
proc_walk.h:27
Botan::ProcWalking_EntropySource::poll
size_t poll(RandomNumberGenerator &rng) override
Definition
proc_walk.cpp:112
Botan::ProcWalking_EntropySource::name
std::string name() const override
Definition
proc_walk.h:29
Botan::ProcWalking_EntropySource::ProcWalking_EntropySource
ProcWalking_EntropySource(const std::string &root_dir)
Definition
proc_walk.h:33
Botan::RandomNumberGenerator
Definition
rng.h:26
Botan::noop_mutex
Definition
mutex.h:46
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
Botan
Definition
alg_id.cpp:13
Botan::secure_vector
std::vector< T, secure_allocator< T > > secure_vector
Definition
secmem.h:65
Generated by
1.9.8