Botan
2.19.1
Crypto and TLS for C++11
|
#include <zfec.h>
Public Types | |
typedef std::function< void(size_t, const uint8_t[], size_t)> | output_cb_t |
Public Member Functions | |
void | decode_shares (const std::map< size_t, const uint8_t * > &shares, size_t share_size, output_cb_t output_cb) const |
void | encode (const uint8_t input[], size_t size, output_cb_t output_cb) const |
void | encode_shares (const std::vector< const uint8_t * > &shares, size_t share_size, output_cb_t output_cb) const |
size_t | generated_shares () const |
std::string | provider () const |
size_t | recovery_threshold () const |
ZFEC (size_t K, size_t n) | |
A forward error correction code compatible with the zfec library (https://github.com/tahoe-lafs/zfec)
This algorithm is not constant time and is likely succeptible to side channels. Do not use this class to encode information that should be kept secret. (If nothing else, because the first K shares are simply the original input!)
typedef std::function<void (size_t, const uint8_t[], size_t)> Botan::ZFEC::output_cb_t |
Botan::ZFEC::ZFEC | ( | size_t | K, |
size_t | n | ||
) |
void Botan::ZFEC::decode_shares | ( | const std::map< size_t, const uint8_t * > & | shares, |
size_t | share_size, | ||
output_cb_t | output_cb | ||
) | const |
shares | map of share id to share contents |
share_size | size in bytes of each share |
output_cb | the output callback |
Definition at line 500 of file zfec.cpp.
References BOTAN_ASSERT_NOMSG.
void Botan::ZFEC::encode | ( | const uint8_t | input[], |
size_t | size, | ||
output_cb_t | output_cb | ||
) | const |
input | the data to FEC |
size | the length in bytes of input |
output_cb | the output callback |
Definition at line 451 of file zfec.cpp.
References encode_shares().
void Botan::ZFEC::encode_shares | ( | const std::vector< const uint8_t * > & | shares, |
size_t | share_size, | ||
output_cb_t | output_cb | ||
) | const |
shares | exactly K shares of data to FEC |
share_size | the length in bytes of each share |
output_cb | the output callback |
Definition at line 468 of file zfec.cpp.
References Botan::clear_mem().
Referenced by encode().
|
inline |
std::string Botan::ZFEC::provider | ( | ) | const |
|
inline |