9#include <botan/internal/ffi_util.h>
11#if defined(BOTAN_HAS_ZFEC)
12 #include <botan/zfec.h>
17int botan_zfec_encode(
size_t K,
size_t N,
const uint8_t* input,
size_t size, uint8_t** outputs) {
18#if defined(BOTAN_HAS_ZFEC)
21 std::copy(block, block +
blockSize, outputs[index]);
32 size_t K,
size_t N,
const size_t* indexes, uint8_t*
const*
const inputs,
size_t shareSize, uint8_t** outputs) {
33#if defined(BOTAN_HAS_ZFEC)
35 std::map<size_t, const uint8_t*> shares;
36 for(
size_t k = 0; k < K; ++k) {
37 shares.insert(std::pair<size_t, const uint8_t*>(indexes[k], inputs[k]));
40 shares, shareSize, [=](
size_t index,
const uint8_t block[],
size_t blockSize) ->
void {
41 std::copy(block, block +
blockSize, outputs[index]);
void encode(const uint8_t input[], size_t size, const output_cb_t &output_cb) const
void decode_shares(const std::map< size_t, const uint8_t * > &shares, size_t share_size, const output_cb_t &output_cb) const
@ BOTAN_FFI_ERROR_NOT_IMPLEMENTED
int botan_zfec_decode(size_t K, size_t N, const size_t *indexes, uint8_t *const *const inputs, size_t shareSize, uint8_t **outputs)
int botan_zfec_encode(size_t K, size_t N, const uint8_t *input, size_t size, uint8_t **outputs)
int ffi_guard_thunk(const char *func_name, const std::function< int()> &thunk)