randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 567 forks source link

POWER cycle count numbers are wrong #1460

Closed randombit closed 6 years ago

randombit commented 6 years ago

Eg from #1459 on a POWER8 machine

AES-128 encrypt buffer size 1024 bytes: 1952.789 MiB/sec 0.25 cycles/byte (5858.37 MiB in 3000.00 ms)

The hardware AES maxes out at ~ .7 cycles/byte (and #1459 is not well optimized, it doesn't even pipeline the calls) so .25 cycles/byte is totally bogus.

randombit commented 6 years ago

Two problems, we are in fact calling the cycle counter incorrectly (failing to account for upper timebase overflowing) but also POWER8s cycle counter runs at only 512 MHz.

randombit commented 6 years ago

We need a way to specify the cycle counter rate to speed util for reporting.

randombit commented 6 years ago

Fixed