[Botan-devel] Small file ciphering speed

Jack Lloyd lloyd at randombit.net
Fri Sep 26 14:10:45 EDT 2008

On Fri, Sep 26, 2008 at 04:30:30PM +0800, Mr Diggilin wrote:
> The data creation being changed to be the current "i" value, I
> calculated the total data to be 2,044,480 bytes (10 * 1 byte, 90 * 2
> bytes, 900 * 3 bytes, 9000 * 4 bytes, 5000 * 5 bytes, multiplied by 32).
> If I got that right, that would be 15.6 megabits or almost 2 megabytes.
> Considering that the encryption and decryption are both almost 1 second,
> that's about 2 megabytes per second, or about 16 megabits per second.
> Since the input data is different than last time (I believe it's more),
> I would be interested to know what the difference is between my 2.5
> second runtime and the slower test machine you used on the previous
> row_encryptor. 

Keep in mind that EAX does have a significant amount of fixed
per-message overhead (in terms of dealing with the MAC computation,
padding, etc) in addition to the normal processing, of 4 block
encryptions (plus other function call overhead, etc). So very small
(especially <1 block) messages take a huge cost for that, because it
doubles or triples the total number of block cipher operations needed
per message. (Versus even a 4 block/64 byte message, where the
per-message overhead drops to only 1/3 of the total encryptions
needed; at 512 bytes == 32 blocks, EAX per-message overhead is only

> I also ran your large file (210 MB) test case and got:
> real    0m39.214s
> user    0m36.578s
> sys     0m2.160s
> What that means to me is about 5.35 megabytes per second or 42.8
> megabits.
> 220,200,960 bytes / 39.214 seconds = 5,615,365.94 bytes per second.
> 5,615,365.94 bytes is ~5.35 megabytes, or 42.8 megabits.

OK, this seems plausible though a bit slow.

> At this point in writing this email, it struck me that despite your
> writing Mb/s, you meant MB/s, which means that my computer is indeed as
> slow as I thought.

I'm sorry yes all numbers were in mebibytes (2^20 bytes) per second.


More information about the botan-devel mailing list