8#ifndef BOTAN_BUFFERED_COMPUTATION_H_
9#define BOTAN_BUFFERED_COMPUTATION_H_
11#include <botan/concepts.h>
12#include <botan/mem_ops.h>
13#include <botan/secmem.h>
35 void update(
const uint8_t in[],
size_t length) { add_data({in, length}); }
41 void update(std::span<const uint8_t> in) { add_data(in); }
43 void update_be(uint16_t val);
44 void update_be(uint32_t val);
45 void update_be(uint64_t val);
47 void update_le(uint16_t val);
48 void update_le(uint32_t val);
49 void update_le(uint64_t val);
62 void update(uint8_t in) { add_data({&in, 1}); }
70 void final(uint8_t out[]) { final_result({out, output_length()}); }
77 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
79 T output(output_length());
86 void final(std::span<uint8_t> out) {
87 BOTAN_ARG_CHECK(out.size() >= output_length(),
"provided output buffer has insufficient capacity");
91 template <concepts::resizable_
byte_buffer T>
93 out.resize(output_length());
104 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
116 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
128 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
141 virtual void add_data(std::span<const uint8_t> input) = 0;
147 virtual void final_result(std::span<uint8_t> out) = 0;
#define BOTAN_ARG_CHECK(expr, msg)
T process(std::string_view in)
void update(const uint8_t in[], size_t length)
T process(std::span< const uint8_t > in)
void update(std::span< const uint8_t > in)
void update(std::string_view str)
virtual size_t output_length() const =0
std::vector< uint8_t > final_stdvec()
virtual ~Buffered_Computation()=default
T process(const uint8_t in[], size_t length)
int(* update)(CTX *, const void *, CC_LONG len)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
const uint8_t * cast_char_ptr_to_uint8(const char *s)