Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

fipstest.cpp

00001 // fipstest.cpp - written and placed in the public domain by Wei Dai
00002 
00003 #include "pch.h"
00004 
00005 #ifndef CRYPTOPP_IMPORTS
00006 
00007 #include "dll.h"
00008 #include <windows.h>
00009 
00010 NAMESPACE_BEGIN(CryptoPP)
00011 
00012 extern PowerUpSelfTestStatus g_powerUpSelfTestStatus;
00013 SecByteBlock g_actualMac;
00014 unsigned long g_macFileLocation = 0;
00015 
00016 const byte * CRYPTOPP_API GetActualMacAndLocation(unsigned int &macSize, unsigned int &fileLocation)
00017 {
00018         macSize = g_actualMac.size();
00019         fileLocation = g_macFileLocation;
00020         return g_actualMac;
00021 }
00022 
00023 void KnownAnswerTest(RandomNumberGenerator &rng, const char *output)
00024 {
00025         EqualityComparisonFilter comparison;
00026 
00027         RandomNumberStore(rng, strlen(output)/2).TransferAllTo(comparison, "0");
00028         StringSource(output, true, new HexDecoder(new ChannelSwitch(comparison, "1")));
00029 
00030         comparison.ChannelMessageSeriesEnd("0");
00031         comparison.ChannelMessageSeriesEnd("1");
00032 }
00033 
00034 template <class CIPHER>
00035 void X917RNG_KnownAnswerTest(
00036         const char *key, 
00037         const char *seed, 
00038         const char *output,
00039         unsigned int deterministicTimeVector,
00040         CIPHER *dummy = NULL)
00041 {
00042         std::string decodedKey, decodedSeed;
00043         StringSource(key, true, new HexDecoder(new StringSink(decodedKey)));
00044         StringSource(seed, true, new HexDecoder(new StringSink(decodedSeed)));
00045 
00046         AutoSeededX917RNG<CIPHER> rng;
00047         rng.Reseed((const byte *)decodedKey.data(), decodedKey.size(), (const byte *)decodedSeed.data(), deterministicTimeVector);
00048         KnownAnswerTest(rng, output);
00049 }
00050 
00051 void KnownAnswerTest(StreamTransformation &encryption, StreamTransformation &decryption, const char *plaintext, const char *ciphertext)
00052 {
00053         EqualityComparisonFilter comparison;
00054 
00055         StringSource(plaintext, true, new HexDecoder(new StreamTransformationFilter(encryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING)));
00056         StringSource(ciphertext, true, new HexDecoder(new ChannelSwitch(comparison, "1")));
00057 
00058         StringSource(ciphertext, true, new HexDecoder(new StreamTransformationFilter(decryption, new ChannelSwitch(comparison, "0"), StreamTransformationFilter::NO_PADDING)));
00059         StringSource(plaintext, true, new HexDecoder(new ChannelSwitch(comparison, "1")));
00060 
00061         comparison.ChannelMessageSeriesEnd("0");
00062         comparison.ChannelMessageSeriesEnd("1");
00063 }
00064 
00065 template <class CIPHER>
00066 void SymmetricEncryptionKnownAnswerTest(
00067         const char *key, 
00068         const char *hexIV, 
00069         const char *plaintext, 
00070         const char *ecb,
00071         const char *cbc,
00072         const char *cfb,
00073         const char *ofb,
00074         const char *ctr,
00075         CIPHER *dummy = NULL)
00076 {
00077         std::string decodedKey;
00078         StringSource(key, true, new HexDecoder(new StringSink(decodedKey)));
00079 
00080         typename CIPHER::Encryption encryption((const byte *)decodedKey.data(), decodedKey.size());
00081         typename CIPHER::Decryption decryption((const byte *)decodedKey.data(), decodedKey.size());
00082 
00083         SecByteBlock iv(encryption.BlockSize());
00084         StringSource(hexIV, true, new HexDecoder(new ArraySink(iv, iv.size())));
00085 
00086         if (ecb)
00087                 KnownAnswerTest(ECB_Mode_ExternalCipher::Encryption(encryption).Ref(), ECB_Mode_ExternalCipher::Decryption(decryption).Ref(), plaintext, ecb);
00088         if (cbc)
00089                 KnownAnswerTest(CBC_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CBC_Mode_ExternalCipher::Decryption(decryption, iv).Ref(), plaintext, cbc);
00090         if (cfb)
00091                 KnownAnswerTest(CFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, cfb);
00092         if (ofb)
00093                 KnownAnswerTest(OFB_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), OFB_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ofb);
00094         if (ctr)
00095                 KnownAnswerTest(CTR_Mode_ExternalCipher::Encryption(encryption, iv).Ref(), CTR_Mode_ExternalCipher::Decryption(encryption, iv).Ref(), plaintext, ctr);
00096 }
00097 
00098 void KnownAnswerTest(HashTransformation &hash, const char *message, const char *digest)
00099 {
00100         EqualityComparisonFilter comparison;
00101         StringSource(digest, true, new HexDecoder(new ChannelSwitch(comparison, "1")));
00102         StringSource(message, true, new HashFilter(hash, new ChannelSwitch(comparison, "0")));
00103 
00104         comparison.ChannelMessageSeriesEnd("0");
00105         comparison.ChannelMessageSeriesEnd("1");
00106 }
00107 
00108 template <class HASH>
00109 void SecureHashKnownAnswerTest(const char *message, const char *digest, HASH *dummy = NULL)
00110 {
00111         HASH hash;
00112         KnownAnswerTest(hash, message, digest);
00113 }
00114 
00115 template <class MAC>
00116 void MAC_KnownAnswerTest(const char *key, const char *message, const char *digest, MAC *dummy = NULL)
00117 {
00118         std::string decodedKey;
00119         StringSource(key, true, new HexDecoder(new StringSink(decodedKey)));
00120 
00121         MAC mac((const byte *)decodedKey.data(), decodedKey.size());
00122         KnownAnswerTest(mac, message, digest);
00123 }
00124 
00125 template <class SCHEME>
00126 void SignatureKnownAnswerTest(const char *key, const char *message, const char *signature, SCHEME *dummy = NULL)
00127 {
00128         typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref());
00129         typename SCHEME::Verifier verifier(signer);
00130 
00131         EqualityComparisonFilter comparison;
00132 
00133         StringSource(message, true, new SignerFilter(NullRNG(), signer, new ChannelSwitch(comparison, "0")));
00134         StringSource(signature, true, new HexDecoder(new ChannelSwitch(comparison, "1")));
00135 
00136         comparison.ChannelMessageSeriesEnd("0");
00137         comparison.ChannelMessageSeriesEnd("1");
00138 
00139         VerifierFilter verifierFilter(verifier, NULL, VerifierFilter::SIGNATURE_AT_BEGIN | VerifierFilter::THROW_EXCEPTION);
00140         StringSource(signature, true, new HexDecoder(new Redirector(verifierFilter, false)));
00141         StringSource(message, true, new Redirector(verifierFilter));
00142 }
00143 
00144 void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor)
00145 {
00146         try
00147         {
00148 #ifdef OS_RNG_AVAILABLE
00149                 AutoSeededX917RNG<DES_EDE3> rng;
00150 #else
00151                 RandomNumberGenerator &rng = NullRNG();
00152 #endif
00153                 const char *testMessage ="test message";
00154 
00155                 EqualityComparisonFilter comparison;
00156                 comparison.ChannelPutMessageEnd("0", (const byte *)testMessage, strlen(testMessage));
00157 
00158                 StringSource(
00159                         testMessage, 
00160                         true, 
00161                         new PK_EncryptorFilter(
00162                                 rng, 
00163                                 encryptor, 
00164                                 new PK_DecryptorFilter(decryptor, new ChannelSwitch(comparison, "1"))));
00165 
00166                 comparison.ChannelMessageSeriesEnd("0");
00167                 comparison.ChannelMessageSeriesEnd("1");
00168         }
00169         catch (...)
00170         {
00171                 throw SelfTestFailure(encryptor.AlgorithmName() + ": pairwise consistency test failed");
00172         }
00173 }
00174 
00175 void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier)
00176 {
00177         try
00178         {
00179 #ifdef OS_RNG_AVAILABLE
00180                 AutoSeededX917RNG<DES_EDE3> rng;
00181 #else
00182                 RandomNumberGenerator &rng = NullRNG();
00183 #endif
00184 
00185                 StringSource(
00186                         "test message", 
00187                         true, 
00188                         new SignerFilter(
00189                                 rng, 
00190                                 signer, 
00191                                 new VerifierFilter(verifier, NULL, VerifierFilter::THROW_EXCEPTION),
00192                                 true));
00193         }
00194         catch (...)
00195         {
00196                 throw SelfTestFailure(signer.AlgorithmName() + ": pairwise consistency test failed");
00197         }
00198 }
00199 
00200 template <class SCHEME>
00201 void SignaturePairwiseConsistencyTest(const char *key, SCHEME *dummy = NULL)
00202 {
00203         typename SCHEME::Signer signer(StringSource(key, true, new HexDecoder).Ref());
00204         typename SCHEME::Verifier verifier(signer);
00205 
00206         SignaturePairwiseConsistencyTest(signer, verifier);
00207 }
00208 
00209 static MessageAuthenticationCode * NewIntegrityCheckingMAC()
00210 {
00211         byte key[] = {0x47, 0x1E, 0x33, 0x96, 0x65, 0xB1, 0x6A, 0xED, 0x0B, 0xF8, 0x6B, 0xFD, 0x01, 0x65, 0x05, 0xCC};
00212         return new HMAC<SHA1>(key, sizeof(key));
00213 }
00214 
00215 void DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac)
00216 {
00217         g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE;
00218         SetPowerUpSelfTestInProgressOnThisThread(true);
00219 
00220         try
00221         {
00222                 if (FIPS_140_2_ComplianceEnabled() || moduleFilename != NULL)
00223                 {
00224                         // integrity test
00225                         std::auto_ptr<MessageAuthenticationCode> mac(NewIntegrityCheckingMAC());
00226                         unsigned int macSize = mac->DigestSize();
00227                         g_actualMac.resize(macSize);
00228                         HashFilter verifier(*mac, new ArraySink(g_actualMac, g_actualMac.size()));
00229                         FileStore file(moduleFilename);
00230 
00231 #ifdef CRYPTOPP_WIN32_AVAILABLE
00232                         // try to hash from memory first
00233                         HMODULE h = GetModuleHandle(moduleFilename);
00234                         IMAGE_DOS_HEADER *ph = (IMAGE_DOS_HEADER *)h;
00235                         IMAGE_NT_HEADERS *phnt = (IMAGE_NT_HEADERS *)((byte *)h + ph->e_lfanew);
00236                         IMAGE_SECTION_HEADER *phs = IMAGE_FIRST_SECTION(phnt);
00237                         DWORD nSections = phnt->FileHeader.NumberOfSections;
00238                         DWORD currentFilePos = 0;
00239 
00240                         while (nSections--)
00241                         {
00242                                 switch (phs->Characteristics)
00243                                 {
00244                                 default:
00245                                         break;
00246                                 case IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ:
00247                                 case IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ:
00248                                         DWORD sectionSize = STDMIN(phs->SizeOfRawData, phs->Misc.VirtualSize);
00249                                         const byte *memStart = (const byte *)h + phs->VirtualAddress;
00250                                         DWORD fileStart = phs->PointerToRawData;
00251                                         if (phs->VirtualAddress == phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].VirtualAddress)
00252                                         {
00253                                                 // read IAT, which is changed during DLL loading, from disk
00254                                                 DWORD iatSize = phnt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].Size;
00255                                                 fileStart += iatSize;
00256                                                 memStart += iatSize;
00257                                                 sectionSize -= iatSize;
00258                                         }
00259                                         file.TransferTo(verifier, fileStart - currentFilePos);
00260                                         if (memStart <= expectedModuleMac && expectedModuleMac < memStart + sectionSize)
00261                                         {
00262                                                 // skip over the MAC
00263                                                 verifier.Put(memStart, expectedModuleMac - memStart);
00264                                                 verifier.Put(expectedModuleMac + macSize, sectionSize - macSize - (expectedModuleMac - memStart));
00265                                                 g_macFileLocation = fileStart + (expectedModuleMac - memStart);
00266                                         }
00267                                         else
00268                                                 verifier.Put(memStart, sectionSize);
00269                                         ::VirtualUnlock((LPVOID)memStart, sectionSize);         // release the memory from working set
00270                                         file.Skip(sectionSize);
00271                                         currentFilePos = fileStart + sectionSize;
00272                                 }
00273                                 phs++;
00274                         }
00275 #endif
00276                         file.TransferAllTo(verifier);
00277 
00278 #ifdef CRYPTOPP_WIN32_AVAILABLE
00279                         // if that fails (could be caused by debug breakpoints or DLL base relocation modifying image in memory),
00280                         // hash from disk instead
00281                         if (memcmp(expectedModuleMac, g_actualMac, macSize) != 0)
00282                         {
00283                                 OutputDebugString("In memory integrity check failed. This may be caused by debug breakpoints or DLL relocation.\n");
00284                                 file.Initialize(MakeParameters("InputFileName", moduleFilename));
00285                                 verifier.Detach(new ArraySink(g_actualMac, g_actualMac.size()));
00286                                 if (g_macFileLocation)
00287                                 {
00288                                         file.TransferTo(verifier, g_macFileLocation);
00289                                         file.Skip(macSize);
00290                                 }
00291                                 file.TransferAllTo(verifier);
00292                         }
00293 #endif
00294 
00295                         if (memcmp(expectedModuleMac, g_actualMac, macSize) != 0)
00296                         {
00297 #ifdef CRYPTOPP_WIN32_AVAILABLE
00298                                 std::string hexMac;
00299                                 HexEncoder(new StringSink(hexMac)).PutMessageEnd(g_actualMac, g_actualMac.size());
00300                                 OutputDebugString(("Crypto++ integrity check failed. Actual MAC is: " + hexMac + "\n").c_str());
00301 #endif
00302                                 throw 0;        // throw here so we break in the debugger, this will be caught right away
00303                         }
00304                 }
00305 
00306                 // algorithm tests
00307 
00308                 X917RNG_KnownAnswerTest<DES_EDE3>(
00309                         "48851090B4992453E83CDA86416534E53EA2FCE1A0B3A40C",                                             // key
00310                         "7D00BD0A79F6B0F5",                                                                                                             // seed
00311                         "22B590B08B53363AEB89AD65F81A5B6FB83F326CE06BF35751E6C41B43B729C4",             // output
00312                         1489728269);                                                                                                                    // time vector
00313 
00314 /*              SymmetricEncryptionKnownAnswerTest<DES>(
00315                         "0123456789abcdef",     // key
00316                         "1234567890abcdef",     // IV
00317                         "4e6f77206973207468652074696d6520666f7220616c6c20",     // plaintext
00318                         "3fa40e8a984d48156a271787ab8883f9893d51ec4b563b53",     // ecb
00319                         "E5C7CDDE872BF27C43E934008C389C0F683788499A7C05F6",     // cbc
00320                         "F3096249C7F46E51A69E839B1A92F78403467133898EA622", // cfb
00321                         "f3096249c7f46e5135f24a242eeb3d3f3d6d5be3255af8c3", // ofb
00322                         "F3096249C7F46E51163A8CA0FFC94C27FA2F80F480B86F75");// ctr
00323 */
00324                 SymmetricEncryptionKnownAnswerTest<DES_EDE3>(
00325                         "385D7189A5C3D485E1370AA5D408082B5CCCCB5E19F2D90E",
00326                         "C141B5FCCD28DC8A",
00327                         "6E1BD7C6120947A464A6AAB293A0F89A563D8D40D3461B68",
00328                         "64EAAD4ACBB9CEAD6C7615E7C7E4792FE587D91F20C7D2F4",
00329                         "6235A461AFD312973E3B4F7AA7D23E34E03371F8E8C376C9",
00330                         "E26BA806A59B0330DE40CA38E77A3E494BE2B212F6DD624B",
00331                         "E26BA806A59B03307DE2BCC25A08BA40A8BA335F5D604C62",
00332                         "E26BA806A59B03303C62C2EFF32D3ACDD5D5F35EBCC53371");
00333 
00334                 SymmetricEncryptionKnownAnswerTest<SKIPJACK>(
00335                         "1555E5531C3A169B2D65",
00336                         "6EC9795701F49864",
00337                         "00AFA48E9621E52E8CBDA312660184EDDB1F33D9DACDA8DA",
00338                         "DBEC73562EFCAEB56204EB8AE9557EBF77473FBB52D17CD1",
00339                         "0C7B0B74E21F99B8F2C8DF37879F6C044967F42A796DCA8B",
00340                         "79FDDA9724E36CC2E023E9A5C717A8A8A7FDA465CADCBF63",
00341                         "79FDDA9724E36CC26CACBD83C1ABC06EAF5B249BE5B1E040",
00342                         "79FDDA9724E36CC211B0AEC607B95A96BCDA318440B82F49");
00343 
00344                 SymmetricEncryptionKnownAnswerTest<AES>(
00345                         "2b7e151628aed2a6abf7158809cf4f3c",
00346                         "000102030405060708090a0b0c0d0e0f",
00347                         "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",     // plaintext
00348                         "3ad77bb40d7a3660a89ecaf32466ef97f5d3d58503b9699de785895a96fdbaaf43b1cd7f598ece23881b00e3ed0306887b0c785e27e8ad3f8223207104725dd4", // ecb
00349                         "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a7",     // cbc
00350                         "3b3fd92eb72dad20333449f8e83cfb4ac8a64537a0b3a93fcde3cdad9f1ce58b26751f67a3cbb140b1808cf187a4f4dfc04b05357c5d1c0eeac4c66f9ff7f2e6", // cfb
00351                         "3b3fd92eb72dad20333449f8e83cfb4a7789508d16918f03f53c52dac54ed8259740051e9c5fecf64344f7a82260edcc304c6528f659c77866a510d9c1d6ae5e", // ofb
00352                         NULL);
00353 
00354                 SymmetricEncryptionKnownAnswerTest<AES>(
00355                         "2b7e151628aed2a6abf7158809cf4f3c",
00356                         "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff",
00357                         "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
00358                         NULL,
00359                         NULL,
00360                         NULL,
00361                         NULL,
00362                         "874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee"); // ctr
00363 
00364 
00365                 SecureHashKnownAnswerTest<SHA>(
00366                         "abc",
00367                         "A9993E364706816ABA3E25717850C26C9CD0D89D");
00368 /*
00369                 SecureHashKnownAnswerTest<SHA256>(
00370                         "abc",
00371                         "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");
00372 
00373                 SecureHashKnownAnswerTest<SHA384>(
00374                         "abc",
00375                         "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7");
00376 
00377                 SecureHashKnownAnswerTest<SHA512>(
00378                         "abc",
00379                         "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f");
00380 */
00381                 MAC_KnownAnswerTest<HMAC<SHA> >(
00382                         "303132333435363738393a3b3c3d3e3f40414243",
00383                         "Sample #2",
00384                         "0922d3405faa3d194f82a45830737d5cc6c75d24");
00385 /*
00386                 MAC_KnownAnswerTest<HMAC<SHA256> >(
00387                         "303132333435363738393a3b3c3d3e3f40414243",
00388                         "abc",
00389                         "D28363F335B2DAE468793A38680DEA9F7FB8BE1DCEDA197CDB3B1CB59A9F6422");
00390 
00391                 MAC_KnownAnswerTest<HMAC<SHA384> >(
00392                         "303132333435363738393a3b3c3d3e3f40414243",
00393                         "abc",
00394                         "E7740C592F1414C969190EFACF51FC8BE1CB52F5DC5E686200D2CA1773D151DB19C59112371CE374165A6BF72AEF69D0");
00395 
00396                 MAC_KnownAnswerTest<HMAC<SHA512> >(
00397                         "303132333435363738393a3b3c3d3e3f40414243",
00398                         "abc",
00399                         "BF07864E733B995862F3C2D432C7FF2F5EB073FFFC4F880CD94D5D21086476B7428F27BE694A9D9CB3BB500FE1255852BAFCBAF4042390B3706CDF02421B51AC");
00400 */
00401                 SignatureKnownAnswerTest<RSASSA<PKCS1v15, SHA> >(
00402                         "30820150020100300d06092a864886f70d01010105000482013a3082013602010002400a66791dc6988168de7ab77419bb7fb0"
00403                         "c001c62710270075142942e19a8d8c51d053b3e3782a1de5dc5af4ebe99468170114a1dfe67cdc9a9af55d655620bbab0203010001"
00404                         "02400123c5b61ba36edb1d3679904199a89ea80c09b9122e1400c09adcf7784676d01d23356a7d44d6bd8bd50e94bfc723fa"
00405                         "87d8862b75177691c11d757692df8881022033d48445c859e52340de704bcdda065fbb4058d740bd1d67d29e9c146c11cf61"
00406                         "0220335e8408866b0fd38dc7002d3f972c67389a65d5d8306566d5c4f2a5aa52628b0220045ec90071525325d3d46db79695e9af"
00407                         "acc4523964360e02b119baa366316241022015eb327360c7b60d12e5e2d16bdcd97981d17fba6b70db13b20b436e24eada590220"
00408                         "2ca6366d72781dfa24d34a9a24cbc2ae927a9958af426563ff63fb11658a461d",
00409                         "Everyone gets Friday off.",
00410                         "0610761F95FFD1B8F29DA34212947EC2AA0E358866A722F03CC3C41487ADC604A48FF54F5C6BEDB9FB7BD59F82D6E55D8F3174BA361B2214B2D74E8825E04E81");
00411 
00412                 SignaturePairwiseConsistencyTest<DSA>(
00413                         "3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF");
00414 
00415                 SignaturePairwiseConsistencyTest<ECDSA<EC2N, SHA> >(
00416                         "302D020100301006072A8648CE3D020106052B8104000404163014020101040F0070337065E1E196980A9D00E37211");
00417 
00418                 SignaturePairwiseConsistencyTest<ECDSA<ECP, SHA> >(
00419                         "3039020100301306072A8648CE3D020106082A8648CE3D030101041F301D02010104182BB8A13C8B867010BD9471D9E81FDB01ABD0538C64D6249A");
00420         }
00421         catch (...)
00422         {
00423                 g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED;
00424                 goto done;
00425         }
00426 
00427         g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_PASSED;
00428 
00429 done:
00430         SetPowerUpSelfTestInProgressOnThisThread(false);
00431         return;
00432 }
00433 
00434 NAMESPACE_END
00435 
00436 #endif

Generated on Tue Jul 8 23:34:15 2003 for Crypto++ by doxygen 1.3.2