[Cryptography] Computing the speed of a cipher or hash

Pierre Abbat phma at bezitopo.org
Mon Aug 25 04:14:09 EDT 2025


Speeds of ciphers and hash functions are expressed in cycles per byte. I can 
measure the time it takes to process many bytes with the @time macro, but how 
do I convert that to cycles? I can look at /proc/cpuinfo while the code is 
running, but it shows that some cores are running much faster than others, and 
the clock speed varies:

$ grep MHz /proc/cpuinfo 
cpu MHz         : 1010.306
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 5507.770
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.245
cpu MHz         : 1091.559
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 1349.525
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 800.000
cpu MHz         : 851.999
cpu MHz         : 800.000
cpu MHz         : 800.000

Pierre
-- 
ve ka'a ro klaji la .romas. se jmaji





More information about the cryptography mailing list