source: packages/libs/libcrypto++/patches/002-cryptest_data_files_location.patch @ 17771

Last change on this file since 17771 was 17771, checked in by florian, 7 years ago

[package] add libcrypto++, required for the new amule version

File size: 23.5 KB
  • bench2.cpp

    ## cryptest-data-files-location.diff by Jens Peter Secher <jps@debian.org>
    ##
    ## Prefix data file names by PACKAGE_DATA_DIR which is set during build.
    
    old new  
    245245        cout << "<THEAD><TR><TH>Operation<TH>Milliseconds/Operation" << (g_hertz ? "<TH>Megacycles/Operation" : "") << endl; 
    246246 
    247247        cout << "\n<TBODY style=\"background: yellow\">"; 
    248         BenchMarkCrypto<RSAES<OAEP<SHA> > >("TestData/rsa1024.dat", "RSA 1024", t); 
    249         BenchMarkCrypto<LUCES<OAEP<SHA> > >("TestData/luc1024.dat", "LUC 1024", t); 
    250         BenchMarkCrypto<DLIES<> >("TestData/dlie1024.dat", "DLIES 1024", t); 
    251         BenchMarkCrypto<LUC_IES<> >("TestData/lucc512.dat", "LUCELG 512", t); 
     248        BenchMarkCrypto<RSAES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t); 
     249        BenchMarkCrypto<LUCES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t); 
     250        BenchMarkCrypto<DLIES<> >(PACKAGE_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t); 
     251        BenchMarkCrypto<LUC_IES<> >(PACKAGE_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t); 
    252252 
    253253        cout << "\n<TBODY style=\"background: white\">"; 
    254         BenchMarkCrypto<RSAES<OAEP<SHA> > >("TestData/rsa2048.dat", "RSA 2048", t); 
    255         BenchMarkCrypto<LUCES<OAEP<SHA> > >("TestData/luc2048.dat", "LUC 2048", t); 
    256         BenchMarkCrypto<DLIES<> >("TestData/dlie2048.dat", "DLIES 2048", t); 
    257         BenchMarkCrypto<LUC_IES<> >("TestData/lucc1024.dat", "LUCELG 1024", t); 
     254        BenchMarkCrypto<RSAES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t); 
     255        BenchMarkCrypto<LUCES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t); 
     256        BenchMarkCrypto<DLIES<> >(PACKAGE_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t); 
     257        BenchMarkCrypto<LUC_IES<> >(PACKAGE_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t); 
    258258 
    259259        cout << "\n<TBODY style=\"background: yellow\">"; 
    260         BenchMarkSignature<RSASS<PSSR, SHA> >("TestData/rsa1024.dat", "RSA 1024", t); 
    261         BenchMarkSignature<RWSS<PSSR, SHA> >("TestData/rw1024.dat", "RW 1024", t); 
    262         BenchMarkSignature<LUCSS<PSSR, SHA> >("TestData/luc1024.dat", "LUC 1024", t); 
    263         BenchMarkSignature<NR<SHA> >("TestData/nr1024.dat", "NR 1024", t); 
    264         BenchMarkSignature<DSA>("TestData/dsa1024.dat", "DSA 1024", t); 
    265         BenchMarkSignature<LUC_HMP<SHA> >("TestData/lucs512.dat", "LUC-HMP 512", t); 
    266         BenchMarkSignature<ESIGN<SHA> >("TestData/esig1023.dat", "ESIGN 1023", t); 
    267         BenchMarkSignature<ESIGN<SHA> >("TestData/esig1536.dat", "ESIGN 1536", t); 
     260        BenchMarkSignature<RSASS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t); 
     261        BenchMarkSignature<RWSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rw1024.dat", "RW 1024", t); 
     262        BenchMarkSignature<LUCSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t); 
     263        BenchMarkSignature<NR<SHA> >(PACKAGE_DATA_DIR "TestData/nr1024.dat", "NR 1024", t); 
     264        BenchMarkSignature<DSA>(PACKAGE_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t); 
     265        BenchMarkSignature<LUC_HMP<SHA> >(PACKAGE_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t); 
     266        BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t); 
     267        BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t); 
    268268 
    269269        cout << "\n<TBODY style=\"background: white\">"; 
    270         BenchMarkSignature<RSASS<PSSR, SHA> >("TestData/rsa2048.dat", "RSA 2048", t); 
    271         BenchMarkSignature<RWSS<PSSR, SHA> >("TestData/rw2048.dat", "RW 2048", t); 
    272         BenchMarkSignature<LUCSS<PSSR, SHA> >("TestData/luc2048.dat", "LUC 2048", t); 
    273         BenchMarkSignature<NR<SHA> >("TestData/nr2048.dat", "NR 2048", t); 
    274         BenchMarkSignature<LUC_HMP<SHA> >("TestData/lucs1024.dat", "LUC-HMP 1024", t); 
    275         BenchMarkSignature<ESIGN<SHA> >("TestData/esig2046.dat", "ESIGN 2046", t); 
     270        BenchMarkSignature<RSASS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t); 
     271        BenchMarkSignature<RWSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rw2048.dat", "RW 2048", t); 
     272        BenchMarkSignature<LUCSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t); 
     273        BenchMarkSignature<NR<SHA> >(PACKAGE_DATA_DIR "TestData/nr2048.dat", "NR 2048", t); 
     274        BenchMarkSignature<LUC_HMP<SHA> >(PACKAGE_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t); 
     275        BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t); 
    276276 
    277277        cout << "\n<TBODY style=\"background: yellow\">"; 
    278         BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh171.dat", "XTR-DH 171", t); 
    279         BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh342.dat", "XTR-DH 342", t); 
    280         BenchMarkKeyAgreement<DH>("TestData/dh1024.dat", "DH 1024", t); 
    281         BenchMarkKeyAgreement<DH>("TestData/dh2048.dat", "DH 2048", t); 
    282         BenchMarkKeyAgreement<LUC_DH>("TestData/lucd512.dat", "LUCDIF 512", t); 
    283         BenchMarkKeyAgreement<LUC_DH>("TestData/lucd1024.dat", "LUCDIF 1024", t); 
    284         BenchMarkKeyAgreement<MQV>("TestData/mqv1024.dat", "MQV 1024", t); 
    285         BenchMarkKeyAgreement<MQV>("TestData/mqv2048.dat", "MQV 2048", t); 
     278        BenchMarkKeyAgreement<XTR_DH>(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t); 
     279        BenchMarkKeyAgreement<XTR_DH>(PACKAGE_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t); 
     280        BenchMarkKeyAgreement<DH>(PACKAGE_DATA_DIR "TestData/dh1024.dat", "DH 1024", t); 
     281        BenchMarkKeyAgreement<DH>(PACKAGE_DATA_DIR "TestData/dh2048.dat", "DH 2048", t); 
     282        BenchMarkKeyAgreement<LUC_DH>(PACKAGE_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t); 
     283        BenchMarkKeyAgreement<LUC_DH>(PACKAGE_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t); 
     284        BenchMarkKeyAgreement<MQV>(PACKAGE_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t); 
     285        BenchMarkKeyAgreement<MQV>(PACKAGE_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t); 
    286286 
    287287        cout << "\n<TBODY style=\"background: white\">"; 
    288288        { 
  • libcrypto++

    old new  
    337337                        AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]); 
    338338                else if (command == "h") 
    339339                { 
    340                         FileSource usage("TestData/usage.dat", true, new FileSink(cout)); 
     340                        FileSource usage(PACKAGE_DATA_DIR "TestData/usage.dat", true, new FileSink(cout)); 
    341341                        return 1; 
    342342                } 
    343343                else if (command == "V") 
  • validat1.cpp

    old new  
    508508{ 
    509509        cout << "\nDES validation suite running...\n\n"; 
    510510 
    511         FileSource valdata("TestData/descert.dat", true, new HexDecoder); 
     511        FileSource valdata(PACKAGE_DATA_DIR "TestData/descert.dat", true, new HexDecoder); 
    512512        bool pass = BlockTransformationTest(FixedRoundsCipherFactory<DESEncryption, DESDecryption>(), valdata); 
    513513 
    514514        cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n"; 
    515515 
    516         FileSource valdata1("TestData/3desval.dat", true, new HexDecoder); 
     516        FileSource valdata1(PACKAGE_DATA_DIR "TestData/3desval.dat", true, new HexDecoder); 
    517517        pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE2_Encryption, DES_EDE2_Decryption>(), valdata1, 1) && pass; 
    518518        pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE3_Encryption, DES_EDE3_Decryption>(), valdata1, 1) && pass; 
    519519        pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_XEX3_Encryption, DES_XEX3_Decryption>(), valdata1, 1) && pass; 
     
    855855{ 
    856856        cout << "\nIDEA validation suite running...\n\n"; 
    857857 
    858         FileSource valdata("TestData/ideaval.dat", true, new HexDecoder); 
     858        FileSource valdata(PACKAGE_DATA_DIR "TestData/ideaval.dat", true, new HexDecoder); 
    859859        return BlockTransformationTest(FixedRoundsCipherFactory<IDEAEncryption, IDEADecryption>(), valdata); 
    860860} 
    861861 
     
    863863{ 
    864864        cout << "\nSAFER validation suite running...\n\n"; 
    865865 
    866         FileSource valdata("TestData/saferval.dat", true, new HexDecoder); 
     866        FileSource valdata(PACKAGE_DATA_DIR "TestData/saferval.dat", true, new HexDecoder); 
    867867        bool pass = true; 
    868868        pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(8,6), valdata, 4) && pass; 
    869869        pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(16,12), valdata, 4) && pass; 
     
    876876{ 
    877877        cout << "\nRC2 validation suite running...\n\n"; 
    878878 
    879         FileSource valdata("TestData/rc2val.dat", true, new HexDecoder); 
     879        FileSource valdata(PACKAGE_DATA_DIR "TestData/rc2val.dat", true, new HexDecoder); 
    880880        HexEncoder output(new FileSink(cout)); 
    881881        SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE); 
    882882        SecByteBlock key(128); 
     
    10861086{ 
    10871087        cout << "\nRC5 validation suite running...\n\n"; 
    10881088 
    1089         FileSource valdata("TestData/rc5val.dat", true, new HexDecoder); 
     1089        FileSource valdata(PACKAGE_DATA_DIR "TestData/rc5val.dat", true, new HexDecoder); 
    10901090        return BlockTransformationTest(VariableRoundsCipherFactory<RC5Encryption, RC5Decryption>(16, 12), valdata); 
    10911091} 
    10921092 
     
    10941094{ 
    10951095        cout << "\nRC6 validation suite running...\n\n"; 
    10961096 
    1097         FileSource valdata("TestData/rc6val.dat", true, new HexDecoder); 
     1097        FileSource valdata(PACKAGE_DATA_DIR "TestData/rc6val.dat", true, new HexDecoder); 
    10981098        bool pass = true; 
    10991099        pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(16), valdata, 2) && pass; 
    11001100        pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(24), valdata, 2) && pass; 
     
    11061106{ 
    11071107        cout << "\nMARS validation suite running...\n\n"; 
    11081108 
    1109         FileSource valdata("TestData/marsval.dat", true, new HexDecoder); 
     1109        FileSource valdata(PACKAGE_DATA_DIR "TestData/marsval.dat", true, new HexDecoder); 
    11101110        bool pass = true; 
    11111111        pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(16), valdata, 4) && pass; 
    11121112        pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(24), valdata, 3) && pass; 
     
    11181118{ 
    11191119        cout << "\nRijndael (AES) validation suite running...\n\n"; 
    11201120 
    1121         FileSource valdata("TestData/rijndael.dat", true, new HexDecoder); 
     1121        FileSource valdata(PACKAGE_DATA_DIR "TestData/rijndael.dat", true, new HexDecoder); 
    11221122        bool pass = true; 
    11231123        pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(16), valdata, 4) && pass; 
    11241124        pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(24), valdata, 3) && pass; 
     
    11311131{ 
    11321132        cout << "\nTwofish validation suite running...\n\n"; 
    11331133 
    1134         FileSource valdata("TestData/twofishv.dat", true, new HexDecoder); 
     1134        FileSource valdata(PACKAGE_DATA_DIR "TestData/twofishv.dat", true, new HexDecoder); 
    11351135        bool pass = true; 
    11361136        pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(16), valdata, 4) && pass; 
    11371137        pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(24), valdata, 3) && pass; 
     
    11431143{ 
    11441144        cout << "\nSerpent validation suite running...\n\n"; 
    11451145 
    1146         FileSource valdata("TestData/serpentv.dat", true, new HexDecoder); 
     1146        FileSource valdata(PACKAGE_DATA_DIR "TestData/serpentv.dat", true, new HexDecoder); 
    11471147        bool pass = true; 
    11481148        pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(16), valdata, 4) && pass; 
    11491149        pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(24), valdata, 3) && pass; 
     
    11891189{ 
    11901190        cout << "\n3-WAY validation suite running...\n\n"; 
    11911191 
    1192         FileSource valdata("TestData/3wayval.dat", true, new HexDecoder); 
     1192        FileSource valdata(PACKAGE_DATA_DIR "TestData/3wayval.dat", true, new HexDecoder); 
    11931193        return BlockTransformationTest(FixedRoundsCipherFactory<ThreeWayEncryption, ThreeWayDecryption>(), valdata); 
    11941194} 
    11951195 
     
    11971197{ 
    11981198        cout << "\nGOST validation suite running...\n\n"; 
    11991199 
    1200         FileSource valdata("TestData/gostval.dat", true, new HexDecoder); 
     1200        FileSource valdata(PACKAGE_DATA_DIR "TestData/gostval.dat", true, new HexDecoder); 
    12011201        return BlockTransformationTest(FixedRoundsCipherFactory<GOSTEncryption, GOSTDecryption>(), valdata); 
    12021202} 
    12031203 
     
    12051205{ 
    12061206        cout << "\nSHARK validation suite running...\n\n"; 
    12071207 
    1208         FileSource valdata("TestData/sharkval.dat", true, new HexDecoder); 
     1208        FileSource valdata(PACKAGE_DATA_DIR "TestData/sharkval.dat", true, new HexDecoder); 
    12091209        return BlockTransformationTest(FixedRoundsCipherFactory<SHARKEncryption, SHARKDecryption>(), valdata); 
    12101210} 
    12111211 
     
    12151215 
    12161216        cout << "\nCAST-128 validation suite running...\n\n"; 
    12171217 
    1218         FileSource val128("TestData/cast128v.dat", true, new HexDecoder); 
     1218        FileSource val128(PACKAGE_DATA_DIR "TestData/cast128v.dat", true, new HexDecoder); 
    12191219        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(16), val128, 1) && pass; 
    12201220        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(10), val128, 1) && pass; 
    12211221        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(5), val128, 1) && pass; 
    12221222 
    12231223        cout << "\nCAST-256 validation suite running...\n\n"; 
    12241224 
    1225         FileSource val256("TestData/cast256v.dat", true, new HexDecoder); 
     1225        FileSource val256(PACKAGE_DATA_DIR "TestData/cast256v.dat", true, new HexDecoder); 
    12261226        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(16), val256, 1) && pass; 
    12271227        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(24), val256, 1) && pass; 
    12281228        pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(32), val256, 1) && pass; 
     
    12341234{ 
    12351235        cout << "\nSquare validation suite running...\n\n"; 
    12361236 
    1237         FileSource valdata("TestData/squareva.dat", true, new HexDecoder); 
     1237        FileSource valdata(PACKAGE_DATA_DIR "TestData/squareva.dat", true, new HexDecoder); 
    12381238        return BlockTransformationTest(FixedRoundsCipherFactory<SquareEncryption, SquareDecryption>(), valdata); 
    12391239} 
    12401240 
     
    12421242{ 
    12431243        cout << "\nSKIPJACK validation suite running...\n\n"; 
    12441244 
    1245         FileSource valdata("TestData/skipjack.dat", true, new HexDecoder); 
     1245        FileSource valdata(PACKAGE_DATA_DIR "TestData/skipjack.dat", true, new HexDecoder); 
    12461246        return BlockTransformationTest(FixedRoundsCipherFactory<SKIPJACKEncryption, SKIPJACKDecryption>(), valdata); 
    12471247} 
    12481248 
     
    13461346        cout << "\nSHACAL-2 validation suite running...\n\n"; 
    13471347 
    13481348        bool pass = true; 
    1349         FileSource valdata("TestData/shacal2v.dat", true, new HexDecoder); 
     1349        FileSource valdata(PACKAGE_DATA_DIR "TestData/shacal2v.dat", true, new HexDecoder); 
    13501350        pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(16), valdata, 4) && pass; 
    13511351        pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(64), valdata, 10) && pass; 
    13521352        return pass; 
     
    13571357        cout << "\nCamellia validation suite running...\n\n"; 
    13581358 
    13591359        bool pass = true; 
    1360         FileSource valdata("TestData/camellia.dat", true, new HexDecoder); 
     1360        FileSource valdata(PACKAGE_DATA_DIR "TestData/camellia.dat", true, new HexDecoder); 
    13611361        pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(16), valdata, 15) && pass; 
    13621362        pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(24), valdata, 15) && pass; 
    13631363        pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(32), valdata, 15) && pass; 
     
    13681368{ 
    13691369        cout << "\nSalsa validation suite running...\n"; 
    13701370 
    1371         return RunTestDataFile("TestVectors/salsa.txt"); 
     1371        return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/salsa.txt"); 
    13721372} 
    13731373 
    13741374bool ValidateSosemanuk() 
    13751375{ 
    13761376        cout << "\nSosemanuk validation suite running...\n"; 
    1377         return RunTestDataFile("TestVectors/sosemanuk.txt"); 
     1377        return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/sosemanuk.txt"); 
    13781378} 
    13791379 
    13801380bool ValidateVMAC() 
    13811381{ 
    13821382        cout << "\nVMAC validation suite running...\n"; 
    1383         return RunTestDataFile("TestVectors/vmac.txt"); 
     1383        return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/vmac.txt"); 
    13841384} 
    13851385 
    13861386bool ValidateCCM() 
  • validat2.cpp

    old new  
    268268                        "\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b" 
    269269                        "\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1"; 
    270270 
    271                 FileSource keys("TestData/rsa512a.dat", true, new HexDecoder); 
     271                FileSource keys(PACKAGE_DATA_DIR "TestData/rsa512a.dat", true, new HexDecoder); 
    272272                Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys); 
    273273                Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv); 
    274274 
     
    293293                cout << "invalid signature verification\n"; 
    294294        } 
    295295        { 
    296                 FileSource keys("TestData/rsa1024.dat", true, new HexDecoder); 
     296                FileSource keys(PACKAGE_DATA_DIR "TestData/rsa1024.dat", true, new HexDecoder); 
    297297                RSAES_PKCS1v15_Decryptor rsaPriv(keys); 
    298298                RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv); 
    299299 
     
    320320                bq.Put(oaepSeed, 20); 
    321321                FixedRNG rng(bq); 
    322322 
    323                 FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder); 
    324                 FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder); 
     323                FileSource privFile(PACKAGE_DATA_DIR "TestData/rsa400pv.dat", true, new HexDecoder); 
     324                FileSource pubFile(PACKAGE_DATA_DIR "TestData/rsa400pb.dat", true, new HexDecoder); 
    325325                RSAES_OAEP_SHA_Decryptor rsaPriv; 
    326326                rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0); 
    327327                RSAES_OAEP_SHA_Encryptor rsaPub(pubFile); 
     
    344344{ 
    345345        cout << "\nDH validation suite running...\n\n"; 
    346346 
    347         FileSource f("TestData/dh1024.dat", true, new HexDecoder()); 
     347        FileSource f(PACKAGE_DATA_DIR "TestData/dh1024.dat", true, new HexDecoder()); 
    348348        DH dh(f); 
    349349        return SimpleKeyAgreementValidate(dh); 
    350350} 
     
    353353{ 
    354354        cout << "\nMQV validation suite running...\n\n"; 
    355355 
    356         FileSource f("TestData/mqv1024.dat", true, new HexDecoder()); 
     356        FileSource f(PACKAGE_DATA_DIR "TestData/mqv1024.dat", true, new HexDecoder()); 
    357357        MQV mqv(f); 
    358358        return AuthenticatedKeyAgreementValidate(mqv); 
    359359} 
     
    362362{ 
    363363        cout << "\nLUC-DH validation suite running...\n\n"; 
    364364 
    365         FileSource f("TestData/lucd512.dat", true, new HexDecoder()); 
     365        FileSource f(PACKAGE_DATA_DIR "TestData/lucd512.dat", true, new HexDecoder()); 
    366366        LUC_DH dh(f); 
    367367        return SimpleKeyAgreementValidate(dh); 
    368368} 
     
    371371{ 
    372372        cout << "\nXTR-DH validation suite running...\n\n"; 
    373373 
    374         FileSource f("TestData/xtrdh171.dat", true, new HexDecoder()); 
     374        FileSource f(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", true, new HexDecoder()); 
    375375        XTR_DH dh(f); 
    376376        return SimpleKeyAgreementValidate(dh); 
    377377} 
     
    381381        cout << "\nElGamal validation suite running...\n\n"; 
    382382        bool pass = true; 
    383383        { 
    384                 FileSource fc("TestData/elgc1024.dat", true, new HexDecoder); 
     384                FileSource fc(PACKAGE_DATA_DIR "TestData/elgc1024.dat", true, new HexDecoder); 
    385385                ElGamalDecryptor privC(fc); 
    386386                ElGamalEncryptor pubC(privC); 
    387387                privC.AccessKey().Precompute(); 
     
    399399        cout << "\nDLIES validation suite running...\n\n"; 
    400400        bool pass = true; 
    401401        { 
    402                 FileSource fc("TestData/dlie1024.dat", true, new HexDecoder); 
     402                FileSource fc(PACKAGE_DATA_DIR "TestData/dlie1024.dat", true, new HexDecoder); 
    403403                DLIES<>::Decryptor privC(fc); 
    404404                DLIES<>::Encryptor pubC(privC); 
    405405                pass = CryptoSystemValidate(privC, pubC) && pass; 
     
    422422        cout << "\nNR validation suite running...\n\n"; 
    423423        bool pass = true; 
    424424        { 
    425                 FileSource f("TestData/nr2048.dat", true, new HexDecoder); 
     425                FileSource f(PACKAGE_DATA_DIR "TestData/nr2048.dat", true, new HexDecoder); 
    426426                NR<SHA>::Signer privS(f); 
    427427                privS.AccessKey().Precompute(); 
    428428                NR<SHA>::Verifier pubS(privS); 
     
    445445 
    446446        bool pass = true, fail; 
    447447        { 
    448         FileSource fs("TestData/dsa512.dat", true, new HexDecoder()); 
     448        FileSource fs(PACKAGE_DATA_DIR "TestData/dsa512.dat", true, new HexDecoder()); 
    449449        GDSA<SHA>::Signer priv(fs); 
    450450        priv.AccessKey().Precompute(16); 
    451451        GDSA<SHA>::Verifier pub(priv); 
     
    487487        fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig)); 
    488488        pass = pass && !fail; 
    489489        } 
    490         FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder()); 
     490        FileSource fs1(PACKAGE_DATA_DIR "TestData/dsa1024.dat", true, new HexDecoder()); 
    491491        DSA::Signer priv(fs1); 
    492492        DSA::Verifier pub(priv); 
    493         FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder()); 
     493        FileSource fs2(PACKAGE_DATA_DIR "TestData/dsa1024b.dat", true, new HexDecoder()); 
    494494        DSA::Verifier pub1(fs2); 
    495495        assert(pub.GetKey() == pub1.GetKey()); 
    496496        pass = SignatureValidate(priv, pub, thorough) && pass; 
     
    503503        bool pass=true; 
    504504 
    505505        { 
    506                 FileSource f("TestData/luc1024.dat", true, new HexDecoder); 
     506                FileSource f(PACKAGE_DATA_DIR "TestData/luc1024.dat", true, new HexDecoder); 
    507507                LUCSSA_PKCS1v15_SHA_Signer priv(f); 
    508508                LUCSSA_PKCS1v15_SHA_Verifier pub(priv); 
    509509                pass = SignatureValidate(priv, pub) && pass; 
     
    520520{ 
    521521        cout << "\nLUC-HMP validation suite running...\n\n"; 
    522522 
    523         FileSource f("TestData/lucs512.dat", true, new HexDecoder); 
     523        FileSource f(PACKAGE_DATA_DIR "TestData/lucs512.dat", true, new HexDecoder); 
    524524        LUC_HMP<SHA>::Signer privS(f); 
    525525        LUC_HMP<SHA>::Verifier pubS(privS); 
    526526        bool pass = SignatureValidate(privS, pubS); 
    527527 
    528528        cout << "\nLUC-IES validation suite running...\n\n"; 
    529529 
    530         FileSource fc("TestData/lucc512.dat", true, new HexDecoder); 
     530        FileSource fc(PACKAGE_DATA_DIR "TestData/lucc512.dat", true, new HexDecoder); 
    531531        LUC_IES<>::Decryptor privC(fc); 
    532532        LUC_IES<>::Encryptor pubC(privC); 
    533533        pass = CryptoSystemValidate(privC, pubC) && pass; 
     
    541541        bool pass=true; 
    542542 
    543543        { 
    544                 FileSource f("TestData/rabi1024.dat", true, new HexDecoder); 
     544                FileSource f(PACKAGE_DATA_DIR "TestData/rabi1024.dat", true, new HexDecoder); 
    545545                RabinSS<PSSR, SHA>::Signer priv(f); 
    546546                RabinSS<PSSR, SHA>::Verifier pub(priv); 
    547547                pass = SignatureValidate(priv, pub) && pass; 
     
    558558{ 
    559559        cout << "\nRW validation suite running...\n\n"; 
    560560 
    561         FileSource f("TestData/rw1024.dat", true, new HexDecoder); 
     561        FileSource f(PACKAGE_DATA_DIR "TestData/rw1024.dat", true, new HexDecoder); 
    562562        RWSS<PSSR, SHA>::Signer priv(f); 
    563563        RWSS<PSSR, SHA>::Verifier pub(priv); 
    564564 
     
    570570{ 
    571571        cout << "\nBlumGoldwasser validation suite running...\n\n"; 
    572572 
    573         FileSource f("TestData/blum512.dat", true, new HexDecoder); 
     573        FileSource f(PACKAGE_DATA_DIR "TestData/blum512.dat", true, new HexDecoder); 
    574574        BlumGoldwasserPrivateKey priv(f); 
    575575        BlumGoldwasserPublicKey pub(priv); 
    576576 
     
    740740                "\x74\x02\x37\x0E\xED\x0A\x06\xAD\xF4\x15\x65\xB8\xE1\xD1\x45\xAE\x39\x19\xB4\xFF\x5D\xF1\x45\x7B\xE0\xFE\x72\xED\x11\x92\x8F\x61\x41\x4F\x02\x00\xF2\x76\x6F\x7C" 
    741741                "\x79\xA2\xE5\x52\x20\x5D\x97\x5E\xFE\x39\xAE\x21\x10\xFB\x35\xF4\x80\x81\x41\x13\xDD\xE8\x5F\xCA\x1E\x4F\xF8\x9B\xB2\x68\xFB\x28"; 
    742742 
    743         FileSource keys("TestData/esig1536.dat", true, new HexDecoder); 
     743        FileSource keys(PACKAGE_DATA_DIR "TestData/esig1536.dat", true, new HexDecoder); 
    744744        ESIGN<SHA>::Signer signer(keys); 
    745745        ESIGN<SHA>::Verifier verifier(signer); 
    746746 
  • validat3.cpp

    old new  
    365365{ 
    366366        cout << "\nPanama validation suite running...\n"; 
    367367 
    368         return RunTestDataFile("TestVectors/panama.txt"); 
     368        return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/panama.txt"); 
    369369} 
    370370 
    371371bool ValidateWhirlpool() 
    372372{ 
    373373        cout << "\nWhirlpool Hash Function validation suite running...\n"; 
    374374 
    375         return RunTestDataFile("TestVectors/whrlpool.txt"); 
     375        return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/whrlpool.txt"); 
    376376} 
    377377 
    378378#ifdef CRYPTOPP_REMOVED 
Note: See TracBrowser for help on using the repository browser.