[Botan-devel] Small file ciphering speed

Jack Lloyd lloyd at randombit.net
Thu Sep 25 14:13:05 EDT 2008

On Thu, Sep 25, 2008 at 01:20:01PM -0400, Jack Lloyd wrote:

> With 1.6.4 does 26.5 Mb/sec sustained on my Core2 (and that is whole
> program runtime, so includes at least some of the disk transfer time,
> etc, though this box has plenty of mem).

OK, tried with with an 8 gigabyte input (twice main memory on this

$ dd if=/dev/urandom of=input bs=1G count=8
8+0 records in
8+0 records out
8589934592 bytes (8.6 GB) copied, 1644.51 s, 5.2 MB/s

$ time ./eax 
terminate called after throwing an instance of 'Botan::Stream_IO_Error'
  what():  Botan: I/O error: DataSink_Stream: Failure writing to output

real    5m29.164s
user    3m26.915s
sys     0m19.376s

$ df /home
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/md1       xfs     20G   20G  104K 100% /home

Oops! Well, of the 5.6 gigabytes written:

$ units
2411 units, 71 prefixes, 33 nonlinear units

You have: 5950279680 bytes / (5 minutes + 29.164 seconds)
You want: mebibytes / second
        * 17.239519
        / 0.05800626

So even with sustained disk transfers, Twofish/EAX could manage 17
Mb/s on my machine (which is probably completely different from yours,
of course!). For one, this was a 3-disk SATA RAID1, and overall has a
reasonably decent I/O setup for a desktop machine. The ratio of
user/clock time is 63%, so it definitely was spending some time
blocked on disk I/O even still.


More information about the botan-devel mailing list