Looking for Source of AES code

Damien O'Rourke orourked at eeng.dcu.ie
Mon Sep 13 06:53:53 EDT 2004


Hi,

I have some AES code here in C and I am trying to find it's author and
source.  I can't find
it on the Internet so I figure it was taken from a book.  Now I don't want
to send the entire
code to the list for obvious reasons however I was hoping you could help me
from the following
small snippet.  Maybe the use of " _fastcall " might jog someone's memory.
If there is
code that appears similar to this but is not exactly the same I would
appreciate the source
of that also.


void _fastcall encrypt(FILE *Encryption_File, FILE *Encrypted_File, unsigned
*expkey)
{
uchar in[16], out[16];
unsigned state[NumberOfBytes], rnd, i;

while (!feof(Encryption_File))
{
  uchar k=0;
   fread(in,sizeof(uchar),16,Encryption_File);/

   *(state+0)= *(in+0)<<24 | *(in+1)<< 16  | *(in+2)<<8  | *(in+3);
   *(state+1)= *(in+4)<<24 | *(in+5)<< 16  | *(in+6)<<8  | *(in+7)  ;
   *(state+2)= *(in+8)<<24 | *(in+9)<< 16  | *(in+10)<<8 | *(in+11)  ;
   *(state+3)= *(in+1)<<24 | *(in+3)<< 16  | *(in+14)<<8 | *(in+15)  ;

   AddRoundKey (state, expkey);

 for( rnd = 1; rnd < NumberOfRounds + 1; rnd++ )
 {
  ByteSub((uchar *)state);
  ShiftRows ((uchar *)state);
  if( rnd < NumberOfRounds )
        MixColumns ((uchar *)state);
  AddRoundKey (state, expkey + rnd * NumberOfBytes);
 }


Many Thanks,
Damien.

---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at metzdowd.com



More information about the cryptography mailing list