1

Can someone help me how can I run in Crypto++ benchmarks test?

I have to make some tests. I found Crypto++ but I don't know how use benchmarks test in Crypto++. I also want to run them after installing the library.

Thanks for help.

jww
  • 97,681
  • 90
  • 411
  • 885
pnk
  • 293
  • 2
  • 14
  • Also see [Benchmarks](https://www.cryptopp.com/wiki/Benchmarks) on the Crypto++ wiki and [Calculate time encryption of AES/CCM in Visual Studio 2017](https://stackoverflow.com/q/47956337/608639) on Stack Overflow. – jww Dec 25 '17 at 07:36

1 Answers1

1

Can someone help me how can I run in Crypto++ benchmarks test?

$ cd cryptopp-src
$ make static cryptest.exe
$ ./cryptest.exe b 3 2.76566 > benchmarks.html

cryptest.exe takes three arguments: (1) b for benchmarks, (2) time for the length of each test, in seconds, and (3) freq for CPU frequency in GiHz. The example above, each test is run for 3 seconds. And the CPU is 2.8 GHz, which works out to be about 2.76566 GiHz.

You can also do this little trick. It will produce a well-formed HTML page:

$ CRYPTOPP_CPU_FREQ=2.76566 make bench

IF you are using Crypto++ 5.6.5 or earlier, then use CRYPTOPP_CPU_SPEED. If you are using Crypto++ 6.0 or later, then use CRYPTOPP_CPU_FREQ.

The output of the tests will look similar to Crypto++ 5.6.0 Benchmarks. It takes 5 or 10 minutes to produce the results.

The source files of interest are test.cpp (handles the b option of cryptest.exe), bench1.cpp and bench2.cpp (implements the benchmarking based on algorithm).


We recently added a wiki page covering Benchmarks. It discusses the basic stuff like how to run the benchmark suite. It also discusses how that portion of the library operates, like the way algorithms register themselves and how the benchmarks are timed. Also see Benchmarks on the Crypto++ wiki.

jww
  • 97,681
  • 90
  • 411
  • 885
  • I tried Crypto++ benchmark and I have few questions. 1. I dont know why Cycles Per Byte benchmark did not work ("CPU frequency of the test platform was not provided"). 2. In benchmark MiB/s I have weird SHA3 values (3, 3 ,4). Its some bug or it is so slow? – pnk Apr 11 '15 at 20:01
  • @pnk - Did the validation suite run and produce expected results? Run it with `cryptest.exe v`. – jww Apr 11 '15 at 20:02
  • ye.. I tried it now and I have problem "Can not open file TestVectors/sha.txt for reading" – pnk Apr 11 '15 at 21:27
  • I dont know what am I doing wrong. I downloaded and install again Crypto++ 5.6.2 after this I downloaded and copy DataDir patch and built it in VS. But still Benchmark tests are without Cycles per Byte test and SHA3 still wierd values. Valiadation still can not read sha.txt... – pnk Apr 12 '15 at 08:40
  • @pnk - *"or can you for me do benchmark test and give me result"* - I think Wei Dai (author of the library) posts them at [Crypto++ Benchmarks](http://www.cryptopp.com/benchmarks.html). – jww Apr 12 '15 at 17:43
  • I'm running cryptest.exe from Win32\Output\... I tried both debug and release. uh I did not set CRYPTOPP_DATA_DIR.. I'm dowloaded DataDir and copied it to Cryptopp folder. Yes Wei Dai posts benchmarks but its old without SHA3 and etc. – pnk Apr 12 '15 at 18:02
  • now cryptest.exe v "All tests passed" but benchmark still same... Cyckles per byte ("CPU frequency of the test platform was not provided") and SHA3 values like 7/6/6/5 its still weird. – pnk Apr 12 '15 at 18:10
  • @pnk - here are my results: [Crypto++ 5.6.1 benchmark on MacBook Pro, Quad Core 2.4 GHz](http://pastebin.com/LCLR44c9) – jww Apr 12 '15 at 18:17
  • I have few questions again. Why is Crypto++ Benchmark in MiB/s instead of Mb/s? It is any special reason? And when I'm using crypto librabry for hash how I can hash biger file then 16kB (string size)? I think file like 1Mb atleast. Thanks for answer and thanks for ur benchmarks. – pnk Apr 15 '15 at 18:39
  • *"Why is Crypto++ Benchmark in MiB/s instead of Mb/s"* - MiB = Mebibyte = 1024 KiB; MB = Megabyte = 1,000 KB. And the ***big B*** means byte; while the ***little b*** means bit. – jww Apr 15 '15 at 19:03
  • ok I did it.. http://meta.stackexchange.com/questions/253508/crypto-how-can-i-hash-bigger-text-file-then-16kb – pnk Apr 15 '15 at 19:39