aes.git
16 years agoAdd the FIPS197 document master
Ira W. Snyder [Sun, 13 Jan 2008 01:45:17 +0000 (17:45 -0800)]
Add the FIPS197 document

Add the FIPS197 document, which is what describes the AES standard.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd PDF target to Makefile turned-in
Ira W. Snyder [Sun, 13 Jan 2008 01:43:37 +0000 (17:43 -0800)]
Add PDF target to Makefile

Add the ability to generate the homework output pdf to the Makefile,
along with all other needed files.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoUpdate comments in aes.hpp optimized
Ira W. Snyder [Sat, 3 Nov 2007 23:47:50 +0000 (16:47 -0700)]
Update comments in aes.hpp

This removes some redundant information from the comments in the aes.hpp
header file. Any C++ user should know that class constants can be set by
the constructor only, and then never again at runtime.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoRemove 'using namespace std;'
Ira W. Snyder [Sat, 27 Oct 2007 21:10:53 +0000 (14:10 -0700)]
Remove 'using namespace std;'

This is a couple of little fixes so that I can remove the
'using namespace std;' from aes.hpp.

Also, remove some old debugging code from aes.cpp.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoConst-ify Nb, Nk, Nr
Ira W. Snyder [Mon, 22 Oct 2007 17:46:26 +0000 (10:46 -0700)]
Const-ify Nb, Nk, Nr

This nets a little bit (~1.5%) of performance and makes all of the routines
a little more safe by making sure that class constants cannot be changed
except in the constructor.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoOptimize ShiftRows() and InvShiftRows()
Ira W. Snyder [Sun, 21 Oct 2007 23:36:05 +0000 (16:36 -0700)]
Optimize ShiftRows() and InvShiftRows()

This switches the code so that it stores the state matrix in the same
column-wise fashion that the FIPS document specifies. This makes it
possible to optimize ShiftRows() and InvShiftRows() by accessing the bytes
inside it as words instead of as bytes. This is guaranteed to work because
the storage allocated by std::vector is guaranteed to be continuous, so
that pointer arithmetic works like normal arrays.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoAdd new testing code
Ira W. Snyder [Sun, 21 Oct 2007 23:33:44 +0000 (16:33 -0700)]
Add new testing code

Add some of the examples from the FIPS document so that we can do
step-by-step testing.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoOptimize the ShiftRows(), InvShiftRows() and RotWord() functions
Ira W. Snyder [Fri, 19 Oct 2007 18:29:10 +0000 (11:29 -0700)]
Optimize the ShiftRows(), InvShiftRows() and RotWord() functions

This switches from using self-defined circular_left_shift() and
circular_right_shift() functions to do rotation of a word to using
shifts. This is a measurable amount faster than making all of the copies
that were being made before.

Note that this can get better, I just need to figure out how to get back a
word from a byteArray.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
16 years agoInitial commit unoptimized
Ira W. Snyder [Fri, 19 Oct 2007 17:43:52 +0000 (10:43 -0700)]
Initial commit

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>