Rijndael

Stephen Weeks sweeks@intertrust.com
Tue, 7 Nov 2000 16:55:50 -0800 (PST)


We definitely need an implementation.  And not just set ourselves the (low)
hurdle of being the best ML implementation, but being competitive with C.

>From comp.lang.ml.

> Rijndael requires use of true 32 bit (i.e not 31 bit) numbers
> and rotate instructions. While it is true that ANSI-C does not
> have rotate instructions and instead one uses the following
> construct instead: 
>  
>         #define rol(x) ((x)>>31 | ((x) <<1)
>  
> Some C compilers have a case-specific optimisation of this
> type of constructs to rols, and others provide a rol
> extension.
>  
> While some FP languages provide `native integer' support,
> such
> integers are usually boxed or otherwise not in the
> register-only optimisation path. Others provide only limited
> support for
> unsigned integer operations.
>  
> So while it's perfectly possible to write Rijndael code using a
> FPL the result is unlikely to match the C variant for speed, or
> elegance.
>  
> This does point out weaknesses in most FP 32 bit twiddling
> abilities, which need to be addressed before FPL's can be
> taken seriously in a number of close-to-the-metal
> problems, including implementation of big-number
> libraries, cryptographic routines, 2d graphics primitives, fft's
> etc.