D. J. Bernstein
Authenticators and signatures
hash127

Choices for conf-opt

The hash127 library includes a variety of machine-specific optimizations. You can change the first line of conf-opt to control which optimizations it uses.

conf-opt=auto

This is the default. One of the possibilities listed below is chosen automatically.

conf-opt=idea

idea works with any C compiler where double is a reasonable implementation of IEEE double-precision (53-bit) floating-point arithmetic.

idea does not work on Linux x86 systems under gcc. Floating-point operations on the x86 architecture are affected by a hidden global variable called ``precision control,'' which normally specifies either 53-bit rounding or 64-bit rounding. Linux sets 64-bit rounding by default; gcc does not set 53-bit rounding before double floating-point operations. (gcc does, however, use 53-bit rounding for double spills to memory. The result is a mishmash of 53-bit rounding and 64-bit rounding, depending on which numbers are stored in registers, which in turn depends on the compiler optimization level.)

conf-opt=sparc

sparc is designed for the SPARC processor family. It may not compile on non-SPARC processors in future versions of hash127.

In hash127 0.70, sparc is idea plus some instruction scheduling for the UltraSPARC. hash127_little has not been optimized; in principle it can run at the same speed as hash127.

conf-opt=x86-idea

x86-idea is just like idea, except that it uses 5 64-bit accumulators instead of 8 53-bit accumulators. It won't compile on non-x86 processors.

x86-idea, with gcc -O6, is almost six times slower than pentium on a Pentium. Feel free to point this out to anyone who claims that manual optimization is useless. I would be interested in hearing results from other compilers.

conf-opt=pentium-idea

pentium-idea is x86-idea with manual register assignment and instruction scheduling for the Pentium.

pentium-idea will probably not work with any compiler other than gcc -O1. In particular, it labels its variables as double rather than long double; this avoids some instruction selection flaws in gcc, but will not work if the double variables are ever spilled to memory.

conf-opt=pentium

pentium is an asm version of pentium-idea. It comes close to the theoretical limit of 3.75 cycles per input byte.

conf-opt=ppro

ppro is better than pentium for the Pentium Pro, Pentium II, and Pentium III. It has different instruction scheduling.