[package] add libcrypto++, required for the new amule version
[openwrt/svn-archive/archive.git] / libs / libcrypto++ / patches / 002-cryptest_data_files_location.patch
1 ## cryptest-data-files-location.diff by Jens Peter Secher <jps@debian.org>
2 ##
3 ## Prefix data file names by PACKAGE_DATA_DIR which is set during build.
4
5 Index: libcrypto++/bench2.cpp
6 ===================================================================
7 --- libcrypto++.orig/bench2.cpp 2009-04-07 03:08:36.000000000 +0200
8 +++ libcrypto++/bench2.cpp 2009-04-07 03:23:43.000000000 +0200
9 @@ -245,44 +245,44 @@
10 cout << "<THEAD><TR><TH>Operation<TH>Milliseconds/Operation" << (g_hertz ? "<TH>Megacycles/Operation" : "") << endl;
11
12 cout << "\n<TBODY style=\"background: yellow\">";
13 - BenchMarkCrypto<RSAES<OAEP<SHA> > >("TestData/rsa1024.dat", "RSA 1024", t);
14 - BenchMarkCrypto<LUCES<OAEP<SHA> > >("TestData/luc1024.dat", "LUC 1024", t);
15 - BenchMarkCrypto<DLIES<> >("TestData/dlie1024.dat", "DLIES 1024", t);
16 - BenchMarkCrypto<LUC_IES<> >("TestData/lucc512.dat", "LUCELG 512", t);
17 + BenchMarkCrypto<RSAES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
18 + BenchMarkCrypto<LUCES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
19 + BenchMarkCrypto<DLIES<> >(PACKAGE_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t);
20 + BenchMarkCrypto<LUC_IES<> >(PACKAGE_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t);
21
22 cout << "\n<TBODY style=\"background: white\">";
23 - BenchMarkCrypto<RSAES<OAEP<SHA> > >("TestData/rsa2048.dat", "RSA 2048", t);
24 - BenchMarkCrypto<LUCES<OAEP<SHA> > >("TestData/luc2048.dat", "LUC 2048", t);
25 - BenchMarkCrypto<DLIES<> >("TestData/dlie2048.dat", "DLIES 2048", t);
26 - BenchMarkCrypto<LUC_IES<> >("TestData/lucc1024.dat", "LUCELG 1024", t);
27 + BenchMarkCrypto<RSAES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
28 + BenchMarkCrypto<LUCES<OAEP<SHA> > >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
29 + BenchMarkCrypto<DLIES<> >(PACKAGE_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t);
30 + BenchMarkCrypto<LUC_IES<> >(PACKAGE_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t);
31
32 cout << "\n<TBODY style=\"background: yellow\">";
33 - BenchMarkSignature<RSASS<PSSR, SHA> >("TestData/rsa1024.dat", "RSA 1024", t);
34 - BenchMarkSignature<RWSS<PSSR, SHA> >("TestData/rw1024.dat", "RW 1024", t);
35 - BenchMarkSignature<LUCSS<PSSR, SHA> >("TestData/luc1024.dat", "LUC 1024", t);
36 - BenchMarkSignature<NR<SHA> >("TestData/nr1024.dat", "NR 1024", t);
37 - BenchMarkSignature<DSA>("TestData/dsa1024.dat", "DSA 1024", t);
38 - BenchMarkSignature<LUC_HMP<SHA> >("TestData/lucs512.dat", "LUC-HMP 512", t);
39 - BenchMarkSignature<ESIGN<SHA> >("TestData/esig1023.dat", "ESIGN 1023", t);
40 - BenchMarkSignature<ESIGN<SHA> >("TestData/esig1536.dat", "ESIGN 1536", t);
41 + BenchMarkSignature<RSASS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
42 + BenchMarkSignature<RWSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rw1024.dat", "RW 1024", t);
43 + BenchMarkSignature<LUCSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
44 + BenchMarkSignature<NR<SHA> >(PACKAGE_DATA_DIR "TestData/nr1024.dat", "NR 1024", t);
45 + BenchMarkSignature<DSA>(PACKAGE_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t);
46 + BenchMarkSignature<LUC_HMP<SHA> >(PACKAGE_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t);
47 + BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t);
48 + BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t);
49
50 cout << "\n<TBODY style=\"background: white\">";
51 - BenchMarkSignature<RSASS<PSSR, SHA> >("TestData/rsa2048.dat", "RSA 2048", t);
52 - BenchMarkSignature<RWSS<PSSR, SHA> >("TestData/rw2048.dat", "RW 2048", t);
53 - BenchMarkSignature<LUCSS<PSSR, SHA> >("TestData/luc2048.dat", "LUC 2048", t);
54 - BenchMarkSignature<NR<SHA> >("TestData/nr2048.dat", "NR 2048", t);
55 - BenchMarkSignature<LUC_HMP<SHA> >("TestData/lucs1024.dat", "LUC-HMP 1024", t);
56 - BenchMarkSignature<ESIGN<SHA> >("TestData/esig2046.dat", "ESIGN 2046", t);
57 + BenchMarkSignature<RSASS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
58 + BenchMarkSignature<RWSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/rw2048.dat", "RW 2048", t);
59 + BenchMarkSignature<LUCSS<PSSR, SHA> >(PACKAGE_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
60 + BenchMarkSignature<NR<SHA> >(PACKAGE_DATA_DIR "TestData/nr2048.dat", "NR 2048", t);
61 + BenchMarkSignature<LUC_HMP<SHA> >(PACKAGE_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t);
62 + BenchMarkSignature<ESIGN<SHA> >(PACKAGE_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t);
63
64 cout << "\n<TBODY style=\"background: yellow\">";
65 - BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh171.dat", "XTR-DH 171", t);
66 - BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh342.dat", "XTR-DH 342", t);
67 - BenchMarkKeyAgreement<DH>("TestData/dh1024.dat", "DH 1024", t);
68 - BenchMarkKeyAgreement<DH>("TestData/dh2048.dat", "DH 2048", t);
69 - BenchMarkKeyAgreement<LUC_DH>("TestData/lucd512.dat", "LUCDIF 512", t);
70 - BenchMarkKeyAgreement<LUC_DH>("TestData/lucd1024.dat", "LUCDIF 1024", t);
71 - BenchMarkKeyAgreement<MQV>("TestData/mqv1024.dat", "MQV 1024", t);
72 - BenchMarkKeyAgreement<MQV>("TestData/mqv2048.dat", "MQV 2048", t);
73 + BenchMarkKeyAgreement<XTR_DH>(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t);
74 + BenchMarkKeyAgreement<XTR_DH>(PACKAGE_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t);
75 + BenchMarkKeyAgreement<DH>(PACKAGE_DATA_DIR "TestData/dh1024.dat", "DH 1024", t);
76 + BenchMarkKeyAgreement<DH>(PACKAGE_DATA_DIR "TestData/dh2048.dat", "DH 2048", t);
77 + BenchMarkKeyAgreement<LUC_DH>(PACKAGE_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t);
78 + BenchMarkKeyAgreement<LUC_DH>(PACKAGE_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t);
79 + BenchMarkKeyAgreement<MQV>(PACKAGE_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t);
80 + BenchMarkKeyAgreement<MQV>(PACKAGE_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t);
81
82 cout << "\n<TBODY style=\"background: white\">";
83 {
84 Index: libcrypto++/test.cpp
85 ===================================================================
86 --- libcrypto++.orig/test.cpp 2009-04-07 03:08:36.000000000 +0200
87 +++ libcrypto++/test.cpp 2009-04-07 03:24:04.000000000 +0200
88 @@ -337,7 +337,7 @@
89 AES_CTR_Encrypt(argv[2], argv[3], argv[4], argv[5]);
90 else if (command == "h")
91 {
92 - FileSource usage("TestData/usage.dat", true, new FileSink(cout));
93 + FileSource usage(PACKAGE_DATA_DIR "TestData/usage.dat", true, new FileSink(cout));
94 return 1;
95 }
96 else if (command == "V")
97 Index: libcrypto++/validat1.cpp
98 ===================================================================
99 --- libcrypto++.orig/validat1.cpp 2009-04-07 03:08:36.000000000 +0200
100 +++ libcrypto++/validat1.cpp 2009-04-07 03:25:57.000000000 +0200
101 @@ -508,12 +508,12 @@
102 {
103 cout << "\nDES validation suite running...\n\n";
104
105 - FileSource valdata("TestData/descert.dat", true, new HexDecoder);
106 + FileSource valdata(PACKAGE_DATA_DIR "TestData/descert.dat", true, new HexDecoder);
107 bool pass = BlockTransformationTest(FixedRoundsCipherFactory<DESEncryption, DESDecryption>(), valdata);
108
109 cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n";
110
111 - FileSource valdata1("TestData/3desval.dat", true, new HexDecoder);
112 + FileSource valdata1(PACKAGE_DATA_DIR "TestData/3desval.dat", true, new HexDecoder);
113 pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE2_Encryption, DES_EDE2_Decryption>(), valdata1, 1) && pass;
114 pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE3_Encryption, DES_EDE3_Decryption>(), valdata1, 1) && pass;
115 pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_XEX3_Encryption, DES_XEX3_Decryption>(), valdata1, 1) && pass;
116 @@ -855,7 +855,7 @@
117 {
118 cout << "\nIDEA validation suite running...\n\n";
119
120 - FileSource valdata("TestData/ideaval.dat", true, new HexDecoder);
121 + FileSource valdata(PACKAGE_DATA_DIR "TestData/ideaval.dat", true, new HexDecoder);
122 return BlockTransformationTest(FixedRoundsCipherFactory<IDEAEncryption, IDEADecryption>(), valdata);
123 }
124
125 @@ -863,7 +863,7 @@
126 {
127 cout << "\nSAFER validation suite running...\n\n";
128
129 - FileSource valdata("TestData/saferval.dat", true, new HexDecoder);
130 + FileSource valdata(PACKAGE_DATA_DIR "TestData/saferval.dat", true, new HexDecoder);
131 bool pass = true;
132 pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(8,6), valdata, 4) && pass;
133 pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(16,12), valdata, 4) && pass;
134 @@ -876,7 +876,7 @@
135 {
136 cout << "\nRC2 validation suite running...\n\n";
137
138 - FileSource valdata("TestData/rc2val.dat", true, new HexDecoder);
139 + FileSource valdata(PACKAGE_DATA_DIR "TestData/rc2val.dat", true, new HexDecoder);
140 HexEncoder output(new FileSink(cout));
141 SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE);
142 SecByteBlock key(128);
143 @@ -1086,7 +1086,7 @@
144 {
145 cout << "\nRC5 validation suite running...\n\n";
146
147 - FileSource valdata("TestData/rc5val.dat", true, new HexDecoder);
148 + FileSource valdata(PACKAGE_DATA_DIR "TestData/rc5val.dat", true, new HexDecoder);
149 return BlockTransformationTest(VariableRoundsCipherFactory<RC5Encryption, RC5Decryption>(16, 12), valdata);
150 }
151
152 @@ -1094,7 +1094,7 @@
153 {
154 cout << "\nRC6 validation suite running...\n\n";
155
156 - FileSource valdata("TestData/rc6val.dat", true, new HexDecoder);
157 + FileSource valdata(PACKAGE_DATA_DIR "TestData/rc6val.dat", true, new HexDecoder);
158 bool pass = true;
159 pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(16), valdata, 2) && pass;
160 pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(24), valdata, 2) && pass;
161 @@ -1106,7 +1106,7 @@
162 {
163 cout << "\nMARS validation suite running...\n\n";
164
165 - FileSource valdata("TestData/marsval.dat", true, new HexDecoder);
166 + FileSource valdata(PACKAGE_DATA_DIR "TestData/marsval.dat", true, new HexDecoder);
167 bool pass = true;
168 pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(16), valdata, 4) && pass;
169 pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(24), valdata, 3) && pass;
170 @@ -1118,7 +1118,7 @@
171 {
172 cout << "\nRijndael (AES) validation suite running...\n\n";
173
174 - FileSource valdata("TestData/rijndael.dat", true, new HexDecoder);
175 + FileSource valdata(PACKAGE_DATA_DIR "TestData/rijndael.dat", true, new HexDecoder);
176 bool pass = true;
177 pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(16), valdata, 4) && pass;
178 pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(24), valdata, 3) && pass;
179 @@ -1131,7 +1131,7 @@
180 {
181 cout << "\nTwofish validation suite running...\n\n";
182
183 - FileSource valdata("TestData/twofishv.dat", true, new HexDecoder);
184 + FileSource valdata(PACKAGE_DATA_DIR "TestData/twofishv.dat", true, new HexDecoder);
185 bool pass = true;
186 pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(16), valdata, 4) && pass;
187 pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(24), valdata, 3) && pass;
188 @@ -1143,7 +1143,7 @@
189 {
190 cout << "\nSerpent validation suite running...\n\n";
191
192 - FileSource valdata("TestData/serpentv.dat", true, new HexDecoder);
193 + FileSource valdata(PACKAGE_DATA_DIR "TestData/serpentv.dat", true, new HexDecoder);
194 bool pass = true;
195 pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(16), valdata, 4) && pass;
196 pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(24), valdata, 3) && pass;
197 @@ -1189,7 +1189,7 @@
198 {
199 cout << "\n3-WAY validation suite running...\n\n";
200
201 - FileSource valdata("TestData/3wayval.dat", true, new HexDecoder);
202 + FileSource valdata(PACKAGE_DATA_DIR "TestData/3wayval.dat", true, new HexDecoder);
203 return BlockTransformationTest(FixedRoundsCipherFactory<ThreeWayEncryption, ThreeWayDecryption>(), valdata);
204 }
205
206 @@ -1197,7 +1197,7 @@
207 {
208 cout << "\nGOST validation suite running...\n\n";
209
210 - FileSource valdata("TestData/gostval.dat", true, new HexDecoder);
211 + FileSource valdata(PACKAGE_DATA_DIR "TestData/gostval.dat", true, new HexDecoder);
212 return BlockTransformationTest(FixedRoundsCipherFactory<GOSTEncryption, GOSTDecryption>(), valdata);
213 }
214
215 @@ -1205,7 +1205,7 @@
216 {
217 cout << "\nSHARK validation suite running...\n\n";
218
219 - FileSource valdata("TestData/sharkval.dat", true, new HexDecoder);
220 + FileSource valdata(PACKAGE_DATA_DIR "TestData/sharkval.dat", true, new HexDecoder);
221 return BlockTransformationTest(FixedRoundsCipherFactory<SHARKEncryption, SHARKDecryption>(), valdata);
222 }
223
224 @@ -1215,14 +1215,14 @@
225
226 cout << "\nCAST-128 validation suite running...\n\n";
227
228 - FileSource val128("TestData/cast128v.dat", true, new HexDecoder);
229 + FileSource val128(PACKAGE_DATA_DIR "TestData/cast128v.dat", true, new HexDecoder);
230 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(16), val128, 1) && pass;
231 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(10), val128, 1) && pass;
232 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(5), val128, 1) && pass;
233
234 cout << "\nCAST-256 validation suite running...\n\n";
235
236 - FileSource val256("TestData/cast256v.dat", true, new HexDecoder);
237 + FileSource val256(PACKAGE_DATA_DIR "TestData/cast256v.dat", true, new HexDecoder);
238 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(16), val256, 1) && pass;
239 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(24), val256, 1) && pass;
240 pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(32), val256, 1) && pass;
241 @@ -1234,7 +1234,7 @@
242 {
243 cout << "\nSquare validation suite running...\n\n";
244
245 - FileSource valdata("TestData/squareva.dat", true, new HexDecoder);
246 + FileSource valdata(PACKAGE_DATA_DIR "TestData/squareva.dat", true, new HexDecoder);
247 return BlockTransformationTest(FixedRoundsCipherFactory<SquareEncryption, SquareDecryption>(), valdata);
248 }
249
250 @@ -1242,7 +1242,7 @@
251 {
252 cout << "\nSKIPJACK validation suite running...\n\n";
253
254 - FileSource valdata("TestData/skipjack.dat", true, new HexDecoder);
255 + FileSource valdata(PACKAGE_DATA_DIR "TestData/skipjack.dat", true, new HexDecoder);
256 return BlockTransformationTest(FixedRoundsCipherFactory<SKIPJACKEncryption, SKIPJACKDecryption>(), valdata);
257 }
258
259 @@ -1346,7 +1346,7 @@
260 cout << "\nSHACAL-2 validation suite running...\n\n";
261
262 bool pass = true;
263 - FileSource valdata("TestData/shacal2v.dat", true, new HexDecoder);
264 + FileSource valdata(PACKAGE_DATA_DIR "TestData/shacal2v.dat", true, new HexDecoder);
265 pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(16), valdata, 4) && pass;
266 pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(64), valdata, 10) && pass;
267 return pass;
268 @@ -1357,7 +1357,7 @@
269 cout << "\nCamellia validation suite running...\n\n";
270
271 bool pass = true;
272 - FileSource valdata("TestData/camellia.dat", true, new HexDecoder);
273 + FileSource valdata(PACKAGE_DATA_DIR "TestData/camellia.dat", true, new HexDecoder);
274 pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(16), valdata, 15) && pass;
275 pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(24), valdata, 15) && pass;
276 pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(32), valdata, 15) && pass;
277 @@ -1368,19 +1368,19 @@
278 {
279 cout << "\nSalsa validation suite running...\n";
280
281 - return RunTestDataFile("TestVectors/salsa.txt");
282 + return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/salsa.txt");
283 }
284
285 bool ValidateSosemanuk()
286 {
287 cout << "\nSosemanuk validation suite running...\n";
288 - return RunTestDataFile("TestVectors/sosemanuk.txt");
289 + return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/sosemanuk.txt");
290 }
291
292 bool ValidateVMAC()
293 {
294 cout << "\nVMAC validation suite running...\n";
295 - return RunTestDataFile("TestVectors/vmac.txt");
296 + return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/vmac.txt");
297 }
298
299 bool ValidateCCM()
300 Index: libcrypto++/validat2.cpp
301 ===================================================================
302 --- libcrypto++.orig/validat2.cpp 2009-04-07 03:08:36.000000000 +0200
303 +++ libcrypto++/validat2.cpp 2009-04-07 03:28:02.000000000 +0200
304 @@ -268,7 +268,7 @@
305 "\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b"
306 "\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1";
307
308 - FileSource keys("TestData/rsa512a.dat", true, new HexDecoder);
309 + FileSource keys(PACKAGE_DATA_DIR "TestData/rsa512a.dat", true, new HexDecoder);
310 Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys);
311 Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv);
312
313 @@ -293,7 +293,7 @@
314 cout << "invalid signature verification\n";
315 }
316 {
317 - FileSource keys("TestData/rsa1024.dat", true, new HexDecoder);
318 + FileSource keys(PACKAGE_DATA_DIR "TestData/rsa1024.dat", true, new HexDecoder);
319 RSAES_PKCS1v15_Decryptor rsaPriv(keys);
320 RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv);
321
322 @@ -320,8 +320,8 @@
323 bq.Put(oaepSeed, 20);
324 FixedRNG rng(bq);
325
326 - FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder);
327 - FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder);
328 + FileSource privFile(PACKAGE_DATA_DIR "TestData/rsa400pv.dat", true, new HexDecoder);
329 + FileSource pubFile(PACKAGE_DATA_DIR "TestData/rsa400pb.dat", true, new HexDecoder);
330 RSAES_OAEP_SHA_Decryptor rsaPriv;
331 rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0);
332 RSAES_OAEP_SHA_Encryptor rsaPub(pubFile);
333 @@ -344,7 +344,7 @@
334 {
335 cout << "\nDH validation suite running...\n\n";
336
337 - FileSource f("TestData/dh1024.dat", true, new HexDecoder());
338 + FileSource f(PACKAGE_DATA_DIR "TestData/dh1024.dat", true, new HexDecoder());
339 DH dh(f);
340 return SimpleKeyAgreementValidate(dh);
341 }
342 @@ -353,7 +353,7 @@
343 {
344 cout << "\nMQV validation suite running...\n\n";
345
346 - FileSource f("TestData/mqv1024.dat", true, new HexDecoder());
347 + FileSource f(PACKAGE_DATA_DIR "TestData/mqv1024.dat", true, new HexDecoder());
348 MQV mqv(f);
349 return AuthenticatedKeyAgreementValidate(mqv);
350 }
351 @@ -362,7 +362,7 @@
352 {
353 cout << "\nLUC-DH validation suite running...\n\n";
354
355 - FileSource f("TestData/lucd512.dat", true, new HexDecoder());
356 + FileSource f(PACKAGE_DATA_DIR "TestData/lucd512.dat", true, new HexDecoder());
357 LUC_DH dh(f);
358 return SimpleKeyAgreementValidate(dh);
359 }
360 @@ -371,7 +371,7 @@
361 {
362 cout << "\nXTR-DH validation suite running...\n\n";
363
364 - FileSource f("TestData/xtrdh171.dat", true, new HexDecoder());
365 + FileSource f(PACKAGE_DATA_DIR "TestData/xtrdh171.dat", true, new HexDecoder());
366 XTR_DH dh(f);
367 return SimpleKeyAgreementValidate(dh);
368 }
369 @@ -381,7 +381,7 @@
370 cout << "\nElGamal validation suite running...\n\n";
371 bool pass = true;
372 {
373 - FileSource fc("TestData/elgc1024.dat", true, new HexDecoder);
374 + FileSource fc(PACKAGE_DATA_DIR "TestData/elgc1024.dat", true, new HexDecoder);
375 ElGamalDecryptor privC(fc);
376 ElGamalEncryptor pubC(privC);
377 privC.AccessKey().Precompute();
378 @@ -399,7 +399,7 @@
379 cout << "\nDLIES validation suite running...\n\n";
380 bool pass = true;
381 {
382 - FileSource fc("TestData/dlie1024.dat", true, new HexDecoder);
383 + FileSource fc(PACKAGE_DATA_DIR "TestData/dlie1024.dat", true, new HexDecoder);
384 DLIES<>::Decryptor privC(fc);
385 DLIES<>::Encryptor pubC(privC);
386 pass = CryptoSystemValidate(privC, pubC) && pass;
387 @@ -422,7 +422,7 @@
388 cout << "\nNR validation suite running...\n\n";
389 bool pass = true;
390 {
391 - FileSource f("TestData/nr2048.dat", true, new HexDecoder);
392 + FileSource f(PACKAGE_DATA_DIR "TestData/nr2048.dat", true, new HexDecoder);
393 NR<SHA>::Signer privS(f);
394 privS.AccessKey().Precompute();
395 NR<SHA>::Verifier pubS(privS);
396 @@ -445,7 +445,7 @@
397
398 bool pass = true, fail;
399 {
400 - FileSource fs("TestData/dsa512.dat", true, new HexDecoder());
401 + FileSource fs(PACKAGE_DATA_DIR "TestData/dsa512.dat", true, new HexDecoder());
402 GDSA<SHA>::Signer priv(fs);
403 priv.AccessKey().Precompute(16);
404 GDSA<SHA>::Verifier pub(priv);
405 @@ -487,10 +487,10 @@
406 fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig));
407 pass = pass && !fail;
408 }
409 - FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder());
410 + FileSource fs1(PACKAGE_DATA_DIR "TestData/dsa1024.dat", true, new HexDecoder());
411 DSA::Signer priv(fs1);
412 DSA::Verifier pub(priv);
413 - FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder());
414 + FileSource fs2(PACKAGE_DATA_DIR "TestData/dsa1024b.dat", true, new HexDecoder());
415 DSA::Verifier pub1(fs2);
416 assert(pub.GetKey() == pub1.GetKey());
417 pass = SignatureValidate(priv, pub, thorough) && pass;
418 @@ -503,7 +503,7 @@
419 bool pass=true;
420
421 {
422 - FileSource f("TestData/luc1024.dat", true, new HexDecoder);
423 + FileSource f(PACKAGE_DATA_DIR "TestData/luc1024.dat", true, new HexDecoder);
424 LUCSSA_PKCS1v15_SHA_Signer priv(f);
425 LUCSSA_PKCS1v15_SHA_Verifier pub(priv);
426 pass = SignatureValidate(priv, pub) && pass;
427 @@ -520,14 +520,14 @@
428 {
429 cout << "\nLUC-HMP validation suite running...\n\n";
430
431 - FileSource f("TestData/lucs512.dat", true, new HexDecoder);
432 + FileSource f(PACKAGE_DATA_DIR "TestData/lucs512.dat", true, new HexDecoder);
433 LUC_HMP<SHA>::Signer privS(f);
434 LUC_HMP<SHA>::Verifier pubS(privS);
435 bool pass = SignatureValidate(privS, pubS);
436
437 cout << "\nLUC-IES validation suite running...\n\n";
438
439 - FileSource fc("TestData/lucc512.dat", true, new HexDecoder);
440 + FileSource fc(PACKAGE_DATA_DIR "TestData/lucc512.dat", true, new HexDecoder);
441 LUC_IES<>::Decryptor privC(fc);
442 LUC_IES<>::Encryptor pubC(privC);
443 pass = CryptoSystemValidate(privC, pubC) && pass;
444 @@ -541,7 +541,7 @@
445 bool pass=true;
446
447 {
448 - FileSource f("TestData/rabi1024.dat", true, new HexDecoder);
449 + FileSource f(PACKAGE_DATA_DIR "TestData/rabi1024.dat", true, new HexDecoder);
450 RabinSS<PSSR, SHA>::Signer priv(f);
451 RabinSS<PSSR, SHA>::Verifier pub(priv);
452 pass = SignatureValidate(priv, pub) && pass;
453 @@ -558,7 +558,7 @@
454 {
455 cout << "\nRW validation suite running...\n\n";
456
457 - FileSource f("TestData/rw1024.dat", true, new HexDecoder);
458 + FileSource f(PACKAGE_DATA_DIR "TestData/rw1024.dat", true, new HexDecoder);
459 RWSS<PSSR, SHA>::Signer priv(f);
460 RWSS<PSSR, SHA>::Verifier pub(priv);
461
462 @@ -570,7 +570,7 @@
463 {
464 cout << "\nBlumGoldwasser validation suite running...\n\n";
465
466 - FileSource f("TestData/blum512.dat", true, new HexDecoder);
467 + FileSource f(PACKAGE_DATA_DIR "TestData/blum512.dat", true, new HexDecoder);
468 BlumGoldwasserPrivateKey priv(f);
469 BlumGoldwasserPublicKey pub(priv);
470
471 @@ -740,7 +740,7 @@
472 "\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"
473 "\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";
474
475 - FileSource keys("TestData/esig1536.dat", true, new HexDecoder);
476 + FileSource keys(PACKAGE_DATA_DIR "TestData/esig1536.dat", true, new HexDecoder);
477 ESIGN<SHA>::Signer signer(keys);
478 ESIGN<SHA>::Verifier verifier(signer);
479
480 Index: libcrypto++/validat3.cpp
481 ===================================================================
482 --- libcrypto++.orig/validat3.cpp 2009-04-07 03:08:36.000000000 +0200
483 +++ libcrypto++/validat3.cpp 2009-04-07 03:29:42.000000000 +0200
484 @@ -365,14 +365,14 @@
485 {
486 cout << "\nPanama validation suite running...\n";
487
488 - return RunTestDataFile("TestVectors/panama.txt");
489 + return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/panama.txt");
490 }
491
492 bool ValidateWhirlpool()
493 {
494 cout << "\nWhirlpool Hash Function validation suite running...\n";
495
496 - return RunTestDataFile("TestVectors/whrlpool.txt");
497 + return RunTestDataFile(PACKAGE_DATA_DIR "TestVectors/whrlpool.txt");
498 }
499
500 #ifdef CRYPTOPP_REMOVED