Linux: make install and test vectors

62 views
Skip to first unread message

Jeffrey Walton

unread,
Apr 27, 2009, 1:58:42 PM4/27/09
to Crypto++ Users
Hi All/Wei,

Running 'cryptest v' after an install results in a
CryptoPP::Exception. This makes sense since TestVectors and TestData
are not not copied to $(PREFIX)/bin.

How can the test vectors be copied for use without polluting the
$(PREFIX)/bin directory? Should 'make install' should copy TestVectors
and TestData to <somewhere> and then provide a link to the directory
(the X11 strategy)?

Jeff

Jens Peter Secher

unread,
Apr 28, 2009, 5:56:49 PM4/28/09
to Crypto++ Users
2009/4/27 Jeffrey Walton <nolo...@gmail.com>:

In the Debian package, I have patched cryptest in the following way:

--- libcrypto++.orig/bench2.cpp 2009-04-07 03:08:36.000000000 +0200
+++ libcrypto++/bench2.cpp 2009-04-07 03:23:43.000000000 +0200
@@ -245,44 +245,44 @@
cout << "<THEAD><TR><TH>Operation<TH>Milliseconds/Operation" <<
(g_hertz ? "<TH>Megacycles/Operation" : "") << endl;

cout << "\n<TBODY style=\"background: yellow\">";
- BenchMarkCrypto<RSAES<OAEP<SHA> > >("TestData/rsa1024.dat", "RSA 1024", t);
- BenchMarkCrypto<LUCES<OAEP<SHA> > >("TestData/luc1024.dat", "LUC 1024", t);
- BenchMarkCrypto<DLIES<> >("TestData/dlie1024.dat", "DLIES 1024", t);
- BenchMarkCrypto<LUC_IES<> >("TestData/lucc512.dat", "LUCELG 512", t);
+ BenchMarkCrypto<RSAES<OAEP<SHA> > >(PACKAGE_DATA_DIR
"TestData/rsa1024.dat", "RSA 1024", t);
+ BenchMarkCrypto<LUCES<OAEP<SHA> > >(PACKAGE_DATA_DIR
"TestData/luc1024.dat", "LUC 1024", t);
+ BenchMarkCrypto<DLIES<> >(PACKAGE_DATA_DIR "TestData/dlie1024.dat",
"DLIES 1024", t);
+ BenchMarkCrypto<LUC_IES<> >(PACKAGE_DATA_DIR "TestData/lucc512.dat",
"LUCELG 512", t);
...

That is, the TestData directory is prefixed with a compile-time
constant PACKAGE_DATA_DIR. That way I can put the test data in a
separate location. In fact, I build two versions of cryptest: one
that is installed with the Debian package
(PACKAGE_DATA_DIR="/usr/share/crypto++"), and one that is run as part
of the building process (PACKAGE_DATA_DIR="") to test that the build
went fine (and discarded afterwards).

Cheers,
--
Jens Peter Secher.
_DD6A 05B0 174E BFB2 D4D9 B52E 0EE5 978A FE63 E8A1 jpsecher gmail com_.
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?

Reply all
Reply to author
Forward
0 new messages