8#include <botan/internal/ffi_util.h>
20 if(
hash ==
nullptr || hash_name ==
nullptr || *hash_name == 0)
29 *
hash =
new botan_hash_struct(std::move(h));
79 *dest =
new botan_hash_struct(src.copy_state()); });
84 if(name_len ==
nullptr)
static std::unique_ptr< HashFunction > create(const std::string &algo_spec, const std::string &provider="")
@ BOTAN_FFI_ERROR_NOT_IMPLEMENTED
@ BOTAN_FFI_ERROR_BAD_FLAG
@ BOTAN_FFI_ERROR_NULL_POINTER
struct botan_hash_struct * botan_hash_t
int botan_hash_output_length(botan_hash_t hash, size_t *out)
int botan_hash_name(botan_hash_t hash, char *name, size_t *name_len)
int botan_hash_block_size(botan_hash_t hash, size_t *out)
int botan_hash_destroy(botan_hash_t hash)
int botan_hash_clear(botan_hash_t hash)
BOTAN_FFI_DECLARE_STRUCT(botan_hash_struct, Botan::HashFunction, 0x1F0A4F84)
int botan_hash_copy_state(botan_hash_t *dest, const botan_hash_t source)
int botan_hash_final(botan_hash_t hash, uint8_t out[])
int botan_hash_init(botan_hash_t *hash, const char *hash_name, uint32_t flags)
int botan_hash_update(botan_hash_t hash, const uint8_t *buf, size_t len)
#define BOTAN_FFI_DO(T, obj, param, block)
#define BOTAN_FFI_CHECKED_DELETE(o)
int write_str_output(uint8_t out[], size_t *out_len, const std::string &str)
int ffi_guard_thunk(const char *func_name, const std::function< int()> &thunk)