3 #define CRYPTOPP_DEFAULT_NO_DLL 4 #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 35 #ifdef CRYPTOPP_WIN32_AVAILABLE 39 #if defined(USE_BERKELEY_STYLE_SOCKETS) && !defined(macintosh) 40 #include <netinet/in.h> 41 #include <netinet/tcp.h> 44 #if (_MSC_VER >= 1000) 48 #if defined(__MWERKS__) && defined(macintosh) 57 #pragma comment(lib, "cryptlib_bds.lib") 58 #pragma comment(lib, "ws2_32.lib") 62 #if (CRYPTOPP_MSC_VERSION >= 1410) 63 # pragma strict_gs_check (on) 69 const
int MAX_PHRASE_LENGTH=250;
71 void RegisterFactories();
72 void PrintSeedAndThreads(const
std::
string& seed);
74 void GenerateRSAKey(
unsigned int keyLength, const
char *privFilename, const
char *pubFilename, const
char *seed);
75 string RSAEncryptString(const
char *pubFilename, const
char *seed, const
char *message);
76 string RSADecryptString(const
char *privFilename, const
char *ciphertext);
77 void RSASignFile(const
char *privFilename, const
char *messageFilename, const
char *signatureFilename);
78 bool RSAVerifyFile(const
char *pubFilename, const
char *messageFilename, const
char *signatureFilename);
80 void DigestFile(const
char *file);
81 void HmacFile(const
char *hexKey, const
char *file);
83 void AES_CTR_Encrypt(const
char *hexKey, const
char *hexIV, const
char *infile, const
char *outfile);
85 string EncryptString(const
char *plaintext, const
char *passPhrase);
86 string DecryptString(const
char *ciphertext, const
char *passPhrase);
88 void EncryptFile(const
char *in, const
char *out, const
char *passPhrase);
89 void DecryptFile(const
char *in, const
char *out, const
char *passPhrase);
91 void SecretShareFile(
int threshold,
int nShares, const
char *filename, const
char *seed);
92 void SecretRecoverFile(
int threshold, const
char *outFilename,
char *const *inFilenames);
94 void InformationDisperseFile(
int threshold,
int nShares, const
char *filename);
95 void InformationRecoverFile(
int threshold, const
char *outFilename,
char *const *inFilenames);
97 void GzipFile(const
char *in, const
char *out,
int deflate_level);
98 void GunzipFile(const
char *in, const
char *out);
100 void Base64Encode(const
char *infile, const
char *outfile);
101 void Base64Decode(const
char *infile, const
char *outfile);
102 void HexEncode(const
char *infile, const
char *outfile);
103 void HexDecode(const
char *infile, const
char *outfile);
105 void ForwardTcpPort(const
char *sourcePort, const
char *destinationHost, const
char *destinationPort);
107 void FIPS140_SampleApplication();
108 void FIPS140_GenerateRandomFiles();
110 bool Validate(
int,
bool, const
char *);
111 void PrintSeedAndThreads(const
std::
string& seed);
113 int (*AdhocTest)(
int argc,
char *argv[]) = NULL;
121 int CRYPTOPP_API main(
int argc,
char *argv[])
123 #ifdef _CRTDBG_LEAK_CHECK_DF 125 int tempflag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
126 tempflag |= _CRTDBG_LEAK_CHECK_DF;
127 _CrtSetDbgFlag( tempflag );
130 #if defined(__MWERKS__) && defined(macintosh) 131 argc = ccommand(&argv);
140 seed.resize(16,
' ');
143 prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data());
145 std::string command, executableName, macFilename;
154 char thisSeed[1024], privFilename[128], pubFilename[128];
155 unsigned int keyLength;
157 cout <<
"Key length in bits: ";
160 cout <<
"\nSave private key to file: ";
163 cout <<
"\nSave public key to file: ";
166 cout <<
"\nRandom Seed: ";
168 cin.getline(thisSeed, 1024);
170 GenerateRSAKey(keyLength, privFilename, pubFilename, thisSeed);
172 else if (command ==
"rs")
173 RSASignFile(argv[2], argv[3], argv[4]);
174 else if (command ==
"rv")
176 bool verified = RSAVerifyFile(argv[2], argv[3], argv[4]);
177 cout << (verified ?
"valid signature" :
"invalid signature") << endl;
179 else if (command ==
"r")
181 char privFilename[128], pubFilename[128];
182 char thisSeed[1024], message[1024];
184 cout <<
"Private key file: ";
187 cout <<
"\nPublic key file: ";
190 cout <<
"\nRandom Seed: ";
192 cin.getline(thisSeed, 1024);
194 cout <<
"\nMessage: ";
195 cin.getline(message, 1024);
197 string ciphertext = RSAEncryptString(pubFilename, thisSeed, message);
198 cout <<
"\nCiphertext: " << ciphertext << endl;
200 string decrypted = RSADecryptString(privFilename, ciphertext.c_str());
201 cout <<
"\nDecrypted: " << decrypted << endl;
203 else if (command ==
"mt")
207 fs.TransferAllTo(mt);
208 cout <<
"Maurer Test Value: " << mt.GetTestValue() << endl;
210 else if (command ==
"mac_dll")
212 std::string fname(argv[2] ? argv[2] :
"");
215 std::fstream dllFile(fname.c_str(), ios::in | ios::out | ios::binary);
218 cerr <<
"Failed to open file \"" << fname <<
"\"\n";
222 std::ifstream::pos_type fileEnd = dllFile.seekg(0, std::ios_base::end).tellg();
223 if (fileEnd > 20*1000*1000)
225 cerr <<
"Input file " << fname <<
" is too large";
226 cerr <<
"(size is " << fileEnd <<
").\n";
231 unsigned int fileSize = (
unsigned int)fileEnd;
233 dllFile.seekg(0, std::ios_base::beg);
234 dllFile.read((
char *)buf.begin(), fileSize);
237 word32 coffPos = *(word16 *)(buf+0x3c);
238 word32 optionalHeaderPos = coffPos + 24;
239 word16 optionalHeaderMagic = *(word16 *)(buf+optionalHeaderPos);
240 if (optionalHeaderMagic != 0x10b && optionalHeaderMagic != 0x20b)
242 cerr <<
"Target file is not a PE32 or PE32+ image.\n";
245 word32 checksumPos = optionalHeaderPos + 64;
246 word32 certificateTableDirectoryPos = optionalHeaderPos + (optionalHeaderMagic == 0x10b ? 128 : 144);
247 word32 certificateTablePos = *(word32 *)(buf+certificateTableDirectoryPos);
248 word32 certificateTableSize = *(word32 *)(buf+certificateTableDirectoryPos+4);
249 if (certificateTableSize != 0)
250 cerr <<
"Warning: certificate table (IMAGE_DIRECTORY_ENTRY_SECURITY) of target image is not empty.\n";
254 byte *found = std::search(buf.begin(), buf.end(), mac+0, mac+
sizeof(mac));
255 if (found == buf.end())
257 cerr <<
"MAC placeholder not found. The MAC may already be placed.\n";
260 word32 macPos = (
unsigned int)(found-buf.begin());
264 assert(pMac->DigestSize() ==
sizeof(mac));
266 f.AddRangeToSkip(0, checksumPos, 4);
267 f.AddRangeToSkip(0, certificateTableDirectoryPos, 8);
268 f.AddRangeToSkip(0, macPos,
sizeof(mac));
269 f.AddRangeToSkip(0, certificateTablePos, certificateTableSize);
270 f.PutMessageEnd(buf.begin(), buf.size());
273 cout <<
"Placing MAC in file " << fname <<
", location " << macPos;
274 cout <<
" (0x" << std::hex << macPos << std::dec <<
").\n";
275 dllFile.seekg(macPos, std::ios_base::beg);
276 dllFile.write((
char *)mac,
sizeof(mac));
278 else if (command ==
"m")
280 else if (command ==
"tv")
282 std::string fname = (argv[2] ? argv[2] :
"all");
283 if (fname.find(
".txt") == std::string::npos)
284 fname = PACKAGE_DATA_DIR
"TestVectors/" + fname +
".txt";
286 PrintSeedAndThreads(seed);
287 return !RunTestDataFile(fname.c_str());
289 else if (command ==
"t")
292 char passPhrase[MAX_PHRASE_LENGTH], plaintext[1024];
294 cout <<
"Passphrase: ";
295 cin.getline(passPhrase, MAX_PHRASE_LENGTH);
297 cout <<
"\nPlaintext: ";
298 cin.getline(plaintext, 1024);
300 string ciphertext = EncryptString(plaintext, passPhrase);
301 cout <<
"\nCiphertext: " << ciphertext << endl;
303 string decrypted = DecryptString(ciphertext.c_str(), passPhrase);
304 cout <<
"\nDecrypted: " << decrypted << endl;
308 else if (command ==
"e64")
309 Base64Encode(argv[2], argv[3]);
310 else if (command ==
"d64")
311 Base64Decode(argv[2], argv[3]);
312 else if (command ==
"e16")
313 HexEncode(argv[2], argv[3]);
314 else if (command ==
"d16")
315 HexDecode(argv[2], argv[3]);
316 else if (command ==
"e" || command ==
"d")
318 char passPhrase[MAX_PHRASE_LENGTH];
319 cout <<
"Passphrase: ";
320 cin.getline(passPhrase, MAX_PHRASE_LENGTH);
322 EncryptFile(argv[2], argv[3], passPhrase);
324 DecryptFile(argv[2], argv[3], passPhrase);
326 else if (command ==
"ss")
329 cout <<
"\nRandom Seed: ";
331 cin.getline(thisSeed, 1024);
332 SecretShareFile(StringToValue<int, true>(argv[2]), StringToValue<int, true>(argv[3]), argv[4], thisSeed);
334 else if (command ==
"sr")
335 SecretRecoverFile(argc-3, argv[2], argv+3);
336 else if (command ==
"id")
337 InformationDisperseFile(StringToValue<int, true>(argv[2]), StringToValue<int, true>(argv[3]), argv[4]);
338 else if (command ==
"ir")
339 InformationRecoverFile(argc-3, argv[2], argv+3);
340 else if (command ==
"v" || command ==
"vv")
341 return !Validate(argc>2 ? StringToValue<int, true>(argv[2]) : 0, argv[1][1] ==
'v', argc>3 ? argv[3] : NULL);
342 else if (command ==
"b")
343 BenchmarkAll(argc<3 ? 1 : StringToValue<float, true>(argv[2]), argc<4 ? 0 : StringToValue<float, true>(argv[3])*1e9);
344 else if (command ==
"b2")
345 BenchmarkAll2(argc<3 ? 1 : StringToValue<float, true>(argv[2]), argc<4 ? 0 : StringToValue<float, true>(argv[3])*1e9);
346 else if (command ==
"z")
347 GzipFile(argv[3], argv[4], argv[2][0]-
'0');
348 else if (command ==
"u")
349 GunzipFile(argv[2], argv[3]);
350 else if (command ==
"fips")
351 FIPS140_SampleApplication();
352 else if (command ==
"fips-rand")
353 FIPS140_GenerateRandomFiles();
354 else if (command ==
"ft")
355 ForwardTcpPort(argv[2], argv[3], argv[4]);
356 else if (command ==
"a")
359 return (*AdhocTest)(argc, argv);
362 cerr <<
"AdhocTest not defined.\n";
366 else if (command ==
"hmac")
367 HmacFile(argv[2], argv[3]);
368 else if (command ==
"ae")
369 AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]);
370 else if (command ==
"h")
375 else if (command ==
"V")
377 cout << CRYPTOPP_VERSION / 100 <<
'.' << (CRYPTOPP_VERSION % 100) / 10 <<
'.' << CRYPTOPP_VERSION % 10 << endl;
381 cerr <<
"Unrecognized command. Run \"cryptest h\" to obtain usage information.\n";
386 catch(
const CryptoPP::Exception &e)
388 cout <<
"\nCryptoPP::Exception caught: " << e.what() << endl;
391 catch(
const std::exception &e)
393 cout <<
"\nstd::exception caught: " << e.what() << endl;
398 void FIPS140_GenerateRandomFiles()
400 #ifdef OS_RNG_AVAILABLE 404 for (
unsigned int i=0; i<100000; i++)
407 cout <<
"OS provided RNG not available.\n";
412 template <
class T,
bool NON_NEGATIVE>
413 T StringToValue(
const std::string& str) {
414 std::istringstream iss(str);
431 int StringToValue<int, true>(
const std::string& str)
438 throw InvalidArgument(
"cryptest.exe: '" + str +
"' is not an integer value");
443 void PrintSeedAndThreads(
const std::string& seed)
445 cout <<
"Using seed: " << seed << endl;
451 tc = omp_get_num_threads();
454 std::cout <<
"Using " << tc <<
" OMP " << (tc == 1 ?
"thread" :
"threads") << std::endl;
462 ss.Get(result, result.size());
466 void GenerateRSAKey(
unsigned int keyLength,
const char *privFilename,
const char *pubFilename,
const char *seed)
473 priv.DEREncode(privFile);
474 privFile.MessageEnd();
478 pub.DEREncode(pubFile);
479 pubFile.MessageEnd();
482 string RSAEncryptString(
const char *pubFilename,
const char *seed,
const char *message)
495 string RSADecryptString(
const char *privFilename,
const char *ciphertext)
505 void RSASignFile(
const char *privFilename,
const char *messageFilename,
const char *signatureFilename)
512 bool RSAVerifyFile(
const char *pubFilename,
const char *messageFilename,
const char *signatureFilename)
518 if (signatureFile.MaxRetrievable() != pub.SignatureLength())
521 signatureFile.Get(signature, signature.size());
524 verifierFilter->
Put(signature, pub.SignatureLength());
525 FileSource f(messageFilename,
true, verifierFilter);
527 return verifierFilter->GetLastResult();
530 void DigestFile(
const char *filename)
548 for (i=0; i<filters.size(); i++)
549 channelSwitch->AddDefaultRoute(*filters[i]);
550 FileSource(filename,
true, channelSwitch.release());
553 for (i=0; i<filters.size(); i++)
555 cout << filters[i]->AlgorithmName() <<
": ";
556 filters[i]->TransferTo(encoder);
561 void HmacFile(
const char *hexKey,
const char *file)
564 if (strcmp(hexKey,
"selftest") == 0)
566 cerr <<
"Computing HMAC/SHA1 value for self test.\n";
571 std::string decodedKey;
573 mac.reset(
new HMAC<SHA1>((
const byte *)decodedKey.data(), decodedKey.size()));
578 void AES_CTR_Encrypt(
const char *hexKey,
const char *hexIV,
const char *infile,
const char *outfile)
586 string EncryptString(
const char *instr,
const char *passPhrase)
591 encryptor.Put((byte *)instr, strlen(instr));
592 encryptor.MessageEnd();
597 string DecryptString(
const char *instr,
const char *passPhrase)
602 decryptor.Put((byte *)instr, strlen(instr));
603 decryptor.MessageEnd();
608 void EncryptFile(
const char *in,
const char *out,
const char *passPhrase)
613 void DecryptFile(
const char *in,
const char *out,
const char *passPhrase)
618 void SecretShareFile(
int threshold,
int nShares,
const char *filename,
const char *seed)
620 assert(nShares >= 1 && nShares<=1000);
621 if (nShares < 1 || nShares > 1000)
632 for (
int i=0; i<nShares; i++)
634 char extension[5] =
".000";
635 extension[1]=
'0'+byte(i/100);
636 extension[2]=
'0'+byte((i/10)%10);
637 extension[3]=
'0'+byte(i%10);
638 fileSinks[i].reset(
new FileSink((
string(filename)+extension).c_str()));
640 channel = WordToString<word32>(i);
641 fileSinks[i]->Put((
const byte *)channel.data(), 4);
648 void SecretRecoverFile(
int threshold,
const char *outFilename,
char *
const *inFilenames)
650 assert(threshold >= 1 && threshold <=1000);
651 if (threshold < 1 || threshold > 1000)
659 for (i=0; i<threshold; i++)
661 fileSources[i].reset(
new FileSource(inFilenames[i],
false));
662 fileSources[i]->Pump(4);
663 fileSources[i]->Get(channel, 4);
664 fileSources[i]->Attach(
new ChannelSwitch(recovery,
string((
char *)channel.begin(), 4)));
667 while (fileSources[0]->Pump(256))
668 for (i=1; i<threshold; i++)
669 fileSources[i]->Pump(256);
671 for (i=0; i<threshold; i++)
672 fileSources[i]->PumpAll();
675 void InformationDisperseFile(
int threshold,
int nShares,
const char *filename)
677 assert(threshold >= 1 && threshold <=1000);
678 if (threshold < 1 || threshold > 1000)
686 for (
int i=0; i<nShares; i++)
688 char extension[5] =
".000";
689 extension[1]=
'0'+byte(i/100);
690 extension[2]=
'0'+byte((i/10)%10);
691 extension[3]=
'0'+byte(i%10);
692 fileSinks[i].reset(
new FileSink((
string(filename)+extension).c_str()));
694 channel = WordToString<word32>(i);
695 fileSinks[i]->Put((
const byte *)channel.data(), 4);
702 void InformationRecoverFile(
int threshold,
const char *outFilename,
char *
const *inFilenames)
704 assert(threshold<=1000);
705 if (threshold < 1 || threshold > 1000)
713 for (i=0; i<threshold; i++)
715 fileSources[i].reset(
new FileSource(inFilenames[i],
false));
716 fileSources[i]->Pump(4);
717 fileSources[i]->Get(channel, 4);
718 fileSources[i]->Attach(
new ChannelSwitch(recovery,
string((
char *)channel.begin(), 4)));
721 while (fileSources[0]->Pump(256))
722 for (i=1; i<threshold; i++)
723 fileSources[i]->Pump(256);
725 for (i=0; i<threshold; i++)
726 fileSources[i]->PumpAll();
729 void GzipFile(
const char *in,
const char *out,
int deflate_level)
745 gunzip.SetAutoSignalPropagation(0);
751 cs->AddDefaultRoute(gunzip);
754 cs->AddDefaultRoute(comparison,
"1");
761 void GunzipFile(
const char *in,
const char *out)
766 void Base64Encode(
const char *in,
const char *out)
771 void Base64Decode(
const char *in,
const char *out)
776 void HexEncode(
const char *in,
const char *out)
781 void HexDecode(
const char *in,
const char *out)
786 void ForwardTcpPort(
const char *sourcePortName,
const char *destinationHost,
const char *destinationPortName)
788 #ifdef SOCKETS_AVAILABLE 789 SocketsInitializer sockInit;
791 Socket sockListen, sockSource, sockDestination;
793 int sourcePort = Socket::PortNameToNumber(sourcePortName);
794 int destinationPort = Socket::PortNameToNumber(destinationPortName);
797 sockListen.Bind(sourcePort);
799 int err = setsockopt(sockListen, IPPROTO_TCP, TCP_NODELAY,
"\x01", 1);
802 throw Socket::Err(sockListen,
"setsockopt", sockListen.GetLastError());
804 cout <<
"Listing on port " << sourcePort <<
".\n";
807 sockListen.Accept(sockSource);
808 cout <<
"Connection accepted on port " << sourcePort <<
".\n";
809 sockListen.CloseSocket();
811 cout <<
"Making connection to " << destinationHost <<
", port " << destinationPort <<
".\n";
812 sockDestination.Create();
813 sockDestination.Connect(destinationHost, destinationPort);
815 cout <<
"Connection made to " << destinationHost <<
", starting to forward.\n";
817 SocketSource out(sockSource,
false,
new SocketSink(sockDestination));
818 SocketSource in(sockDestination,
false,
new SocketSink(sockSource));
822 while (!(in.SourceExhausted() && out.SourceExhausted()))
826 out.GetWaitObjects(waitObjects,
CallStack(
"ForwardTcpPort - out", NULL));
827 in.GetWaitObjects(waitObjects,
CallStack(
"ForwardTcpPort - in", NULL));
831 if (!out.SourceExhausted())
833 cout <<
"o" << flush;
835 if (out.SourceExhausted())
836 cout <<
"EOF received on source socket.\n";
839 if (!in.SourceExhausted())
841 cout <<
"i" << flush;
843 if (in.SourceExhausted())
844 cout <<
"EOF received on destination socket.\n";
848 cout <<
"Socket support was not enabled at compile time.\n";
853 bool Validate(
int alg,
bool thorough,
const char *seedInput)
859 std::string seed = (seedInput ? seedInput :
IntToString(time(NULL)));
860 seed.resize(16,
' ');
863 prng.SetKeyWithIV((byte *)seed.data(), 16, (byte *)seed.data());
865 PrintSeedAndThreads(seed);
869 case 0: result = ValidateAll(thorough);
break;
870 case 1: result = TestSettings();
break;
871 case 2: result = TestOS_RNG();
break;
872 case 3: result = ValidateMD5();
break;
873 case 4: result = ValidateSHA();
break;
874 case 5: result = ValidateDES();
break;
875 case 6: result = ValidateIDEA();
break;
876 case 7: result = ValidateARC4();
break;
877 case 8: result = ValidateRC5();
break;
878 case 9: result = ValidateBlowfish();
break;
880 case 11: result = ValidateThreeWay();
break;
881 case 12: result = ValidateBBS();
break;
882 case 13: result = ValidateDH();
break;
883 case 14: result = ValidateRSA();
break;
884 case 15: result = ValidateElGamal();
break;
885 case 16: result = ValidateDSA(thorough);
break;
887 case 18: result = ValidateSAFER();
break;
888 case 19: result = ValidateLUC();
break;
889 case 20: result = ValidateRabin();
break;
891 case 22: result = ValidateECP();
break;
892 case 23: result = ValidateEC2N();
break;
894 case 25: result = ValidateGOST();
break;
895 case 26: result = ValidateTiger();
break;
896 case 27: result = ValidateRIPEMD();
break;
897 case 28: result = ValidateHMAC();
break;
899 case 30: result = ValidateSHARK();
break;
900 case 32: result = ValidateLUC_DH();
break;
901 case 33: result = ValidateLUC_DL();
break;
902 case 34: result = ValidateSEAL();
break;
903 case 35: result = ValidateCAST();
break;
904 case 36: result = ValidateSquare();
break;
905 case 37: result = ValidateRC2();
break;
906 case 38: result = ValidateRC6();
break;
907 case 39: result = ValidateMARS();
break;
908 case 40: result = ValidateRW();
break;
909 case 41: result = ValidateMD2();
break;
910 case 42: result = ValidateNR();
break;
911 case 43: result = ValidateMQV();
break;
912 case 44: result = ValidateRijndael();
break;
913 case 45: result = ValidateTwofish();
break;
914 case 46: result = ValidateSerpent();
break;
915 case 47: result = ValidateCipherModes();
break;
916 case 48: result = ValidateCRC32();
break;
917 case 49: result = ValidateECDSA();
break;
918 case 50: result = ValidateXTR_DH();
break;
919 case 51: result = ValidateSKIPJACK();
break;
920 case 52: result = ValidateSHA2();
break;
921 case 53: result = ValidatePanama();
break;
922 case 54: result = ValidateAdler32();
break;
923 case 55: result = ValidateMD4();
break;
924 case 56: result = ValidatePBKDF();
break;
925 case 57: result = ValidateESIGN();
break;
926 case 58: result = ValidateDLIES();
break;
927 case 59: result = ValidateBaseCode();
break;
928 case 60: result = ValidateSHACAL2();
break;
929 case 61: result = ValidateCamellia();
break;
930 case 62: result = ValidateWhirlpool();
break;
931 case 63: result = ValidateTTMAC();
break;
932 case 64: result = ValidateSalsa();
break;
933 case 65: result = ValidateSosemanuk();
break;
934 case 66: result = ValidateVMAC();
break;
935 case 67: result = ValidateCCM();
break;
936 case 68: result = ValidateGCM();
break;
937 case 69: result = ValidateCMAC();
break;
938 case 70: result = ValidateHKDF();
break;
939 default:
return false;
943 #if defined(CRYPTOPP_MSC_VERSION) 948 const time_t endTime = time(NULL);
949 err = localtime_s(&localTime, &endTime);
951 err = asctime_s(timeBuf,
sizeof(timeBuf), &localTime);
954 cout <<
"\nTest ended at " << timeBuf;
956 const time_t endTime = time(NULL);
957 cout <<
"\nTest ended at " << asctime(localtime(&endTime));
960 cout <<
"Seed used was: " << seed << endl;
void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
An invalid argument was detected.
container of wait objects
Filter Wrapper for PK_Verifier.
bool SafeConvert(T1 from, T2 &to)
Tests whether a conversion from → to is safe to perform.
implements the SHA-256 standard
Classes for RIPEMD message digest.
file-based implementation of Source interface
Converts given data to base 16.
GZIP Decompression (RFC 1952)
Decode base 16 data back to bytes.
Abstract base classes that provide a uniform interface to this library.
size_type size() const
Provides the count of elements in the SecBlock.
Classes for automatic resource management.
Filter Wrapper for PK_Signer.
Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC.
Interface for random number generators.
Append input to a string object.
SecByteBlock is a SecBlock<byte> typedef.
Route input to different and/or multiple channels based on channel ID.
Pointer that overloads operator→
Copy input to a memory buffer.
Filter Wrapper for HashTransformation.
RNG-based implementation of Source interface.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
signed long ConvertToLong() const
return equivalent signed long if possible, otherwise undefined
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true)
Marks the end of a series of messages on a channel.
Maurer's Universal Statistical Test for Random Bit Generators.
implements the SHA-512 standard
Class file for the AES cipher (Rijndael)
Manages resources for an array of objects.
Multiple precision integer with arithmetic operations.
proxy for the filter created by PK_Decryptor::CreateDecryptionFilter
MessageAuthenticationCode * NewIntegrityCheckingMAC()
Class object that calculates the MAC on the module.
Password-Based encryptor using TripleDES and HMAC/SHA-1.
Miscellaneous classes for RNGs.
const unsigned long INFINITE_TIME
Represents infinite time.
Implementation of BufferedTransformation's attachment interface in cryptlib.h.
file-based implementation of Store interface
proxy for the filter created by PK_Encryptor::CreateEncryptionFilter
Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder.
#define CRYPTOPP_DUMMY_DLL_MAC
The placeholder used prior to embedding the actual MAC in the module.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
measure how many byte and messages pass through, also serves as valve
Password-Based decryptor using TripleDES and HMAC/SHA-1.
A filter that checks messages on two channels for equality.
Crypto++ library namespace.
GZIP Compression (RFC 1952)
a variant of Shamir's Secret Sharing Algorithm
file-based implementation of Sink interface
Functions and definitions required for building the FIPS-140 DLL on Windows.
a variant of Shamir's Secret Sharing Algorithm
Classes for Information Dispersal Algorithm (IDA)
A template implementing constructors for public key algorithm classes.
A typedef providing a default generator.