Skip to content
AES algorithm
C++
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Makefile
README = command line parsing added Apr 10, 2011
aes.in
block.cc
block.h
byte.cc
byte.h
gf28.cc = command line parsing added Apr 10, 2011
gf28.h
keys.cc
keys.h
main.cc
table.cc
table.h
word.cc
word.h

README

Aaveg Mittal
aavegmit@usc.edu
Homework6

. Design
. There are total 13 files 7 source file and 6 header files.

main.cc: 
. mainly contains the general code, such as userinput parsing & then calling the appropriote function. 

Some important class definitions

class Byte{
	private:
		unsigned char c ;

	public:
		Byte(unsigned char) ;
		unsigned char to_uchar() ;
		Byte operator*(Byte other) ;
		Byte xtimes() ;
		Byte SubByte() ;
		Byte InvSubByte() ;
		Byte Inverse() ;
		void setC(unsigned char ch){ 
			c = ch ;
		}

};

class Word{
	private:
		int len ;
		unsigned char *w ;
	public:
		Word(char *str, int l);			// Length of the word in bytes, default being 4
		Word(const Word& wo) ;

		Word SubWord();				// Uses the S-box for byte-level substitution
		void SubWord1();			// Uses the S-box for byte-level substitution
		void InvSubWord1();			// Uses the S-box for byte-level substitution
		Word RotWord();				// [a0, a1, a2, a3] -> [a1, a2, a3, a0]

		Word XOR(Word);				// Performs the XOR function on two words
		void CircularLShift(int times=1);	// Performs Circular left shift, by default one time 
		virtual void display();			// Display the word in the required format
		unsigned char *to_Array();		// Returns the Word in array form
		bool compare(Word&);
		static Word Rcon(int);
		void copyW(unsigned char *);
		Word& operator=(const Word&) ;



		void setW(int, unsigned char) ;

		void WModProd(unsigned char, char *) ;

		void Divide(Word, Word&, Word&) ;

		void Inverse() ;
		unsigned char* to_print(unsigned char *) ;

		~Word() ;

};



2.      Testing
1. Please follow the instruction mentioned on homework 6 page.

Something went wrong with that request. Please try again.