Botan 3.6.1
Crypto and TLS for C&
|
#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, const output_cb_t &output_cb) const |
void | encode (const uint8_t input[], size_t size, const output_cb_t &output_cb) const |
void | encode_shares (const std::vector< const uint8_t * > &shares, size_t share_size, const 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!)
std::function<void(size_t, const uint8_t[], size_t)> Botan::ZFEC::output_cb_t |
Botan::ZFEC::ZFEC | ( | size_t | K, |
size_t | N ) |
FEC constructor
K | the number of shares needed for recovery |
N | the number of shares generated |
Definition at line 355 of file zfec.cpp.
void Botan::ZFEC::decode_shares | ( | const std::map< size_t, const uint8_t * > & | shares, |
size_t | share_size, | ||
const 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 442 of file zfec.cpp.
References BOTAN_ASSERT_NOMSG.
Referenced by botan_zfec_decode().
void Botan::ZFEC::encode | ( | const uint8_t | input[], |
size_t | size, | ||
const 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 399 of file zfec.cpp.
References encode_shares().
Referenced by botan_zfec_encode().
void Botan::ZFEC::encode_shares | ( | const std::vector< const uint8_t * > & | shares, |
size_t | share_size, | ||
const 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 414 of file zfec.cpp.
References Botan::clear_mem().
Referenced by encode().
|
inline |
std::string Botan::ZFEC::provider | ( | ) | const |
Definition at line 528 of file zfec.cpp.
References Botan::CPUID::has_vperm().
|
inline |