libcryptosec
Static Public Member Functions | List of all members
SecretSharer Class Reference

#include <SecretSharer.h>

Static Public Member Functions

static void split (std::istream *data, int parts, int threshold, std::vector< std::ostream *> *secrets) throw (SecretSharerException, RandomException)
 
static void join (std::vector< std::istream * > *secrets, unsigned int parts, unsigned int threshold, std::ostream *secret) throw (SecretSharerException)
 

Detailed Description

Sharing and recovering secrets with only static functions.

Member Function Documentation

◆ join()

void SecretSharer::join ( std::vector< std::istream * > *  secrets,
unsigned int  parts,
unsigned int  threshold,
std::ostream *  secret 
)
throw (SecretSharerException
)
static

recover the secret from pieces

Parameters
secretsvector of input stream that will be read to recover the secret
partsnumber of parts that the secret was split
thresholdvalue of threshold set on split
secretoutput stream that will be wrote the secret
Exceptions
InvalidNumberOfPartsException
InvalidNumberOfThresholdException
SecretSharerInternalErrorException

◆ split()

void SecretSharer::split ( std::istream *  data,
int  parts,
int  threshold,
std::vector< std::ostream *> *  secrets 
)
throw (SecretSharerException,
RandomException
)
static

share a secret in parts and threshold parts is necessary to recover

Parameters
datainput of data, the secret
partsnumber of parts that the secret will be shared
thresholdminimal number of parts to recover the secret
secretsvector of ostream that will be wrote the pieces of the parts
Exceptions
InvalidNumberOfPartsException
InvalidNumberOfThresholdException
InvalidRandomDataSourceException
SecretSharerInternalErrorException

The documentation for this class was generated from the following files: