CCF
Loading...
Searching...
No Matches
entropy.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include <cstdint>
6#include <cstring>
7#include <memory>
8#include <vector>
9
10namespace ccf::crypto
11{
12 class Entropy
13 {
14 public:
15 Entropy() = default;
16 virtual ~Entropy() = default;
17
21 virtual std::vector<uint8_t> random(size_t len) = 0;
22
26 virtual void random(unsigned char* data, size_t len) = 0;
27
30 virtual uint64_t random64() = 0;
31 };
32
33 using EntropyPtr = std::shared_ptr<Entropy>;
34
36}
Definition entropy.h:13
virtual void random(unsigned char *data, size_t len)=0
virtual std::vector< uint8_t > random(size_t len)=0
virtual ~Entropy()=default
virtual uint64_t random64()=0
Definition base64.h:10
EntropyPtr get_entropy()
Definition entropy.cpp:10
std::shared_ptr< Entropy > EntropyPtr
Definition entropy.h:33