Added comments on using InformationDisperseFile and SecretShareFile

This is based on feedback from https://groups.google.com/forum/#\!topic/cryptopp-users/XEKKLCEFH3Y
pull/402/head
Jeffrey Walton 2017-04-13 23:13:07 -04:00
parent bf92cb0039
commit cf160e91c4
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 4 additions and 0 deletions

View File

@ -666,6 +666,8 @@ void SecretShareFile(int threshold, int nShares, const char *filename, const cha
ChannelSwitch *channelSwitch = NULLPTR;
FileSource source(filename, false, new SecretSharing(rng, threshold, nShares, channelSwitch = new ChannelSwitch));
// Be careful of the type of Sink used. An ArraySink will stop writing data once the array
// is full. Also see http://groups.google.com/forum/#!topic/cryptopp-users/XEKKLCEFH3Y.
vector_member_ptrs<FileSink> fileSinks(nShares);
std::string channel;
for (int i=0; i<nShares; i++)
@ -720,6 +722,8 @@ void InformationDisperseFile(int threshold, int nShares, const char *filename)
ChannelSwitch *channelSwitch = NULLPTR;
FileSource source(filename, false, new InformationDispersal(threshold, nShares, channelSwitch = new ChannelSwitch));
// Be careful of the type of Sink used. An ArraySink will stop writing data once the array
// is full. Also see http://groups.google.com/forum/#!topic/cryptopp-users/XEKKLCEFH3Y.
vector_member_ptrs<FileSink> fileSinks(nShares);
std::string channel;
for (int i=0; i<nShares; i++)