A lot of cypher modes need multiplications in GF(2^128). LRW, ABL, GCM...
I use functions from this library in my LRW implementation and I will
also use them in my ABL (Arbitrary Block Length, an unencumbered (correct
me if I am wrong, wide block cipher mode).
Elements of GF(2^128) must be presented as u128 *, it encourages automatic
and proper alignment.
The library contains support for two different representations of GF(2^128),
see the comment in gf128mul.h. There different levels of optimization
The code is based on work by Dr Brian Gladman. Notable changes:
- deletion of two optimization modes
- change from u32 to u64 for faster handling on 64bit machines
- support for 'bbe' representation in addition to the, already implemented,
- move 'inline void' functions from header to 'static void' in the
- update to use the linux coding style conventions
The original can be found at:
The copyright (and GPL statement) of the original author is preserved.
Signed-off-by: Rik Snel <firstname.lastname@example.org>
Signed-off-by: Herbert Xu <email@example.com>