9#include <botan/p11_randomgenerator.h>
22void PKCS11_RNG::fill_bytes_with_input(std::span<uint8_t> output, std::span<const uint8_t> input) {
25 const size_t chunk_max = std::numeric_limits<Ulong>::max();
27 while(!input.empty()) {
28 const size_t this_chunk = std::min(input.size(), chunk_max);
30 m_session.get().handle(),
const_cast<uint8_t*
>(input.data()),
static_cast<Ulong>(this_chunk));
31 input = input.subspan(this_chunk);
34 while(!output.empty()) {
35 const size_t this_chunk = std::min(output.size(), chunk_max);
37 output = output.subspan(this_chunk);
bool C_GenerateRandom(SessionHandle session, Byte *random_data_ptr, Ulong random_len, ReturnValue *return_value=ThrowException) const
bool C_SeedRandom(SessionHandle session, const Byte *seed_ptr, Ulong seed_len, ReturnValue *return_value=ThrowException) const
PKCS11_RNG(Session &session)
Initialize the RNG with the PKCS#11 session that provides access to the cryptoki functions.
size_t reseed_from_sources(Entropy_Sources &, size_t) override
No operation - always returns 0.
Represents a PKCS#11 session.