EAX: provide an implementation of EAX
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:48 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:48 +0000 (18:30 +0100)
commit9018e07aec9e5a32e85b03d997a272c40ff2d915
tree6c7b002ad7fe812ccab71c76e2611ab39116c842
parent094ca922beda8a0af97cf9aeeeea3a983b59531c
EAX: provide an implementation of EAX

EAX is a reasonably well-regarded Authenticated Encryption block
cipher mode.  We intend to replace the existing CBC and CBC-MAC
transform with EAX.  EAX can be used with any block cipher, but we
will use it with Serpent.

In this patch we provide an implementation of EAX itself.

This primary consists of eax.c, the actual implementation of the EAX
mode.

To test that our implementation is correct, we use aes.[ch], which we
copied from qemu in the previous commit, to run the EAX-AES test
vectors.  These are cut-and-pasted out of the EAX paper.

(To do this we need to make aes.[ch] compile in our environment - but
the changes are minimal.  We also improve the copyright notices.)

Then for completeness we also provide EAX-Serpent and EAX-Serpent-BE
test vectors and the corresponding test code.  The EAX-Serpent test
vectors are from Mark Wooding.  The EAX-SerpentBE test vectors were
generated by this very code, so aren't independently verified.

(The implementation of what is now consttime_curious_multiply, and the
comment preeding it, was provided by Mark.  I have lightly edited it
to conform to the coding style etc. of the rest of the file.  Mark
also contributed improvements to alg_omac_t_k.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
13 files changed:
.gitignore
Makefile.in
aes.c
aes.h
eax-aes-test.c [new file with mode: 0644]
eax-aes-test.vectors [new file with mode: 0644]
eax-serpent-test.c [new file with mode: 0644]
eax-serpent-test.vectors [new file with mode: 0644]
eax-serpentbe-test.c [new file with mode: 0644]
eax-serpentbe-test.vectors [new file with mode: 0644]
eax-test.c [new file with mode: 0644]
eax-test.h [new file with mode: 0644]
eax.c [new file with mode: 0644]