2

i am currently evaluating the AES encryption and decryption speed on my laptop and my workstation.

when executing

cryptsetup benchmark -c aes --key-size 128

I get normal results of almost 200MB/s without the AESNI extension. when i load the extension with

modprobe aesni-intel

and perform the same benchmark I get completely unrealistic results

for example 68021MB/s on decrypt

any suggestions what might be the problem causing these unrealistic results?

BTW: OS on laptop is Ubuntu, Workstation is Gentoo

Uninstalled predefined ubuntu package installed from source with

make check

the make scripts performs a single test and these results are fine but when i install it via

make install

i again get these weird results

user3694354
  • 105
  • 8

1 Answers1

1

Unrealistic benchmark results are usually caused by wrong (as in totally invalid) approach to benchmarking.

Judging from their benchmark source, the benchmark core is (in horrendous pseudo-code)

totalTime = 0
totalSize = 0
while ( totalTime < 1000 ) {
    (sampleTime, sampleSize) = processSingleSample
    totalTime += sampleTime
    totalSize += sampleSize
}
speed = totalSize / totalTime 

Imagine a situation when the execution time of processSingleSample is close to zero - each iteration steadily increases the totalSize but on some iteration the total time will not increase at all. In the end the totalTime is 1000 and the totalSize is arbitrary large, hence the resulting "speed" is arbitrary large.

This benchmarking approach can still be useful when each individual iteration takes a significant amount of time but in this particular case (especially after you enable aesni which decreases the time for each individual iteration even more) it just not the right one.

Oleg Estekhin
  • 8,063
  • 5
  • 49
  • 52
  • thsi seems plausible, but how can such a difference in results exist in the same system with another OS? my laptop had more realistic results when i had my gentoo installation – user3694354 Jun 30 '14 at 14:05
  • They should take look at OpenSSL. It simply tries to run for 10 seconds or so, and then see how long it has run and how many iterations were processed. That's an issue if you do 4096 bit RSA key generation of course, but it should be OK most of the time. Actually, you may be able to test AES (-NI) performance using `openssl speed`. – Maarten Bodewes Jun 30 '14 at 15:20