lomont.org

(Also lomonster.com and clomont.com)

Created using Realsoft3D and GIF Construction Set by Chris Lomont

AES - Advanced Encryption Standard

 

NEW! June 2005

Source version 1.0. See the readme.txt file for what was changed. The older version (0.9) is available here.

Now the interface is much easier to use, and supports ECB and CBC block chaining modes. I plan to implement CFB, OFB, CTR, EAX, and GCM modes soon. Unfortunately, I do not have user defined IV (Initialization Vector) code in yet.

AES is the new US government private key encryption standard (FIPS-197), designed to replace DES. Here is some (free) source code to implement AES, and it is pretty fast.

There are two versions, a slow, direct version implemented in Rijndael.cpp and Rijndael.h, and a fast optimized version in AES.cpp and AES.h. In the fast one the setup and key expansion are not yet optimized, but the encrypt and decrypt are about as fast as I can get them. The Tables below show cycles counts needed to encrypt or decrypt one block of data for the different versions and key and block length combinations defined by the standard.

See the header files or test harness to see how to use the source. 

Testing for the 0.9 version of the source is below, and was done on a PIII 800 MHZ, 128 MB RAM, using Windows 2000, with service pack 1 applied. Code was compiled on Visual C++ 6.0, service pack 4, with default settings for release and debug builds. A 4 cycle better performance over these times can be achieved by turning off exception handling. The cycle counts are averaged from loops of 100,000 runs over each different combination.

A Zipfile with code, VC++.NET 2003 makefiles and test harness.

Legalese: I am not responsible for any damage these downloads cause, etc. Basically you should never trust people on the web.... However, I have used these programs on my system with no problems. If you have any comments, suggestions, or bugs, email me.

 

Fast Version:

(key, block)

(min, avg) encrypt 
(min, avg) decrypt 
(128,128)

(370,378)

(366,376)

(192,128)

(441,460)

(437,452)

(256,128)

(509,525)

(498,532)

(128,192)

(694,708)

(667,688)

(192,192)

(694,706)

(667,687)

(256,192)

(803,823)

(776,803)

(128,256)

(1112,1152)

(1032,1046)

(192,256)

(1108,1140)

(1034,1066)

(256,256)

(1109,1162)

(1032,1044)

 

 

Slow Version:

These cycle counts are probably inaccurate due to Windows 2000 using time slices during the run since the cycle counts are so high. But they show relative cycle counts for the unoptimized version of AES.

(key, block)

(min) encrypt 
(min, avg) decrypt 
(128,128)

(6262,6352)

(77738,78513)

(192,128)

(7546,7740)

(96112,97089)

(256,128)

(8836,9111)

(112475,113463)

(128,192)

(11100,11343)

(138488,139822)

(192,192)

(11086,11210)

(141706,143609)

(256,192)

(12869,13408)

(166671,169059)

(128,256)

(16288,16431)

(222263,225087)

(192,256)

(16288,16437)

(221232,224187)

(256,256)

(16285,16466)

(221429,224726)

 

Back to Main