How to calculate cycles per byte Sometimes, websites and scientific papers that introduce and/or handle cryptographic algorithms also provide speed-analysis and tables comparing the individual performance of cryptographic implementations. I would like to do the same, but I'm not sure how to calculate the “cycles”.

I have this data:


processor clock frequency: 2,1 ghz  
message length: 16 byte  
Speed: 4,3 Mbytes/s


How can I calculate “cycles” and “cycles per byte” from that data?
$\displaystyle \text{cycles per byte} = \frac{\text{cycles per second}}{\text{bytes per second}} = \frac{2.1 ~ \text{GHz}}{4.3 ~ \text{MiB}} = \frac{2.1 \times 10^9}{4.3 \times 1024^2} \approx 466 ~ \text{cpb}$



Of course this may be way off because processors are complex beasts these days, and may not work at their full potential all the time, and the calculations may very well be reordered, optimized, or vectorized.

So it's a little better than raw speed in that it is not dependent of processor clock speed but it is still quite dependent on the underlying hardware details. It is a decent measure of cryptographic performance.