MCPcopy Create free account
hub / github.com/LUX-Core/lux / InformationRecoverFile

Function InformationRecoverFile

src/cryptopp/test.cpp:729–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729void InformationRecoverFile(int threshold, const char *outFilename, char *const *inFilenames)
730{
731 CRYPTOPP_ASSERT(threshold<=1000);
732 if (threshold < 1 || threshold > 1000)
733 throw InvalidArgument("InformationRecoverFile: " + IntToString(threshold) + " is not in range [1, 1000]");
734
735 InformationRecovery recovery(threshold, new FileSink(outFilename));
736
737 vector_member_ptrs<FileSource> fileSources(threshold);
738 SecByteBlock channel(4);
739 int i;
740 for (i=0; i<threshold; i++)
741 {
742 fileSources[i].reset(new FileSource(inFilenames[i], false));
743 fileSources[i]->Pump(4);
744 fileSources[i]->Get(channel, 4);
745 fileSources[i]->Attach(new ChannelSwitch(recovery, string((char *)channel.begin(), 4)));
746 }
747
748 while (fileSources[0]->Pump(256))
749 for (i=1; i<threshold; i++)
750 fileSources[i]->Pump(256);
751
752 for (i=0; i<threshold; i++)
753 fileSources[i]->PumpAll();
754}
755
756void GzipFile(const char *in, const char *out, int deflate_level)
757{

Callers 1

CRYPTOPP_API mainFunction · 0.85

Calls 5

IntToStringFunction · 0.85
AttachMethod · 0.80
resetMethod · 0.45
GetMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected