eSTREAM in Linux: Salsa20 (i586)

While I am at it, I decided to resubmit the Salsa20 i586 implementation.

The previous submission did not make it as the assembly code was not indented properly. The original assembly code came from http://cr.yp.to/snuffle/salsa20/x86-pm/salsa20.s and I did not change it initially as I was worried about introducing bugs. Since it is important that the indentation is correct, I eventually wrote a script to automate the process.

This salsa20-i586 version is pretty fast. Under UML on my laptop, it is nearly 1.8 times as fast as the salsa20-generic implementation:

testing speed of salsa20-generic encryption
test 0 (128 bit key, 16 byte blocks): 930563 operations in 1 seconds (14889008 bytes)
test 1 (128 bit key, 64 byte blocks): 966858 operations in 1 seconds (61878912 bytes)
test 2 (128 bit key, 256 byte blocks): 289514 operations in 1 seconds (74115584 bytes)
test 3 (128 bit key, 1024 byte blocks): 75999 operations in 1 seconds (77822976 bytes)
test 4 (128 bit key, 8192 byte blocks): 9273 operations in 1 seconds (75964416 bytes)
test 5 (256 bit key, 16 byte blocks): 1003746 operations in 1 seconds (16059936 bytes)
test 6 (256 bit key, 64 byte blocks): 966838 operations in 1 seconds (61877632 bytes)
test 7 (256 bit key, 256 byte blocks): 288998 operations in 1 seconds (73983488 bytes)
test 8 (256 bit key, 1024 byte blocks): 75048 operations in 1 seconds (76849152 bytes)
test 9 (256 bit key, 8192 byte blocks): 9267 operations in 1 seconds (75915264 bytes)
testing speed of salsa20-i586 encryption
test 0 (128 bit key, 16 byte blocks): 1210840 operations in 1 seconds (19373440 bytes)
test 1 (128 bit key, 64 byte blocks): 1464200 operations in 1 seconds (93708800 bytes)
test 2 (128 bit key, 256 byte blocks): 486000 operations in 1 seconds (124416000 bytes)
test 3 (128 bit key, 1024 byte blocks): 132620 operations in 1 seconds (135802880 bytes)
test 4 (128 bit key, 8192 byte blocks): 16395 operations in 1 seconds (134307840 bytes)
test 5 (256 bit key, 16 byte blocks): 1371696 operations in 1 seconds (21947136 bytes)
test 6 (256 bit key, 64 byte blocks): 1457508 operations in 1 seconds (93280512 bytes)
test 7 (256 bit key, 256 byte blocks): 491316 operations in 1 seconds (125776896 bytes)
test 8 (256 bit key, 1024 byte blocks): 133732 operations in 1 seconds (136941568 bytes)
test 9 (256 bit key, 8192 byte blocks): 16186 operations in 1 seconds (132595712 bytes)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: