cr.yp.to update

[email protected] 12 May 2005 19:09:24 -0000
Newsgroups gmane.comp.djb.announce
Message-ID <[email protected]>
New: salsa20/salsa20_word_athlon.s
diff -ru .old-crypto/salsa20.html cr.yp.to/salsa20.html
--- .old-crypto/salsa20.html	2005-05-05 21:07:26.000000000 -0400
+++ cr.yp.to/salsa20.html	2005-05-12 06:04:46.000000000 -0400
@@ -71,24 +71,23 @@
 Here <tt>in</tt> is the sequence of input words,
 and <tt>out</tt> is the sequence of output words.
 The caller handles any necessary endianness conversion and alignment.
-<h2>Athlon: 10.08 cycles/byte</h2>
-I'm not planning a separate Athlon implementation for the moment.
+<h2>Athlon: 9.27 cycles/byte</h2>
+My <tt>salsa20_word_athlon</tt> implementation of Salsa20
+is aimed at the AMD Athlon.
+It will work on any x86 CPU.
+Here's the traditional asm, slightly tweaked from
+<tt>salsa20_word_pm.s</tt>:
+<a href="salsa20/salsa20_word_athlon.s">salsa20_word_athlon.s</a>.
 <p>
-<tt>salsa20_word_pm</tt> takes 680 Athlon cycles,
-including function-call overhead and 35 cycles timing overhead;
+<tt>salsa20_word_athlon</tt> takes 604 Athlon cycles,
+including function-call overhead and 11 cycles timing overhead;
 timing overhead was subtracted from the cycles/byte figure above.
-The compiled code occupies 1248 bytes.
-<p>
-<tt>salsa20_word_pm</tt>
-actually takes 655 or 656 cycles most of the time
-but 849 cycles on every eighth call,
-presumably because of branch mispredictions.
-An average double-round takes under 59 cycles.
+An average round takes 26.75 cycles.
+The compiled code occupies 1280 bytes.
 <p>
 One could shoot for 500 Athlon cycles,
 considering the total number of instructions
-that need to be carried out;
-maybe better with PADDD etc.
+that need to be carried out.
 <h2>Pentium III: 13.08 cycles/byte</h2>
 My <tt>salsa20_word_pii</tt> implementation of Salsa20
 is aimed at the Intel Pentium II and Intel Pentium III.