From 0471fe267719869fbb5908caf2877344d6f14e74 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 10 Dec 2006 15:51:31 +0000 Subject: Removal of AES, this is no longer required. (This also eliminates code that isnt ours, and was some public domain crap) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5915 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/aes.h | 209 ---------------------------------------------------------- 1 file changed, 209 deletions(-) delete mode 100644 include/aes.h (limited to 'include') diff --git a/include/aes.h b/include/aes.h deleted file mode 100644 index 05f947084..000000000 --- a/include/aes.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef __AES_H__ -#define __AES_H__ - -#include -#include "inspircd_config.h" -#include "base.h" - -using namespace std; - -/** The AES class is a utility class for use in modules and the core for encryption of data. - */ -class AES : public classbase -{ -public: - enum { ECB=0, CBC=1, CFB=2 }; - -private: - enum { DEFAULT_BLOCK_SIZE=16 }; - enum { MAX_BLOCK_SIZE=32, MAX_ROUNDS=14, MAX_KC=8, MAX_BC=8 }; - - static int Mul(int a, int b) - { - return (a != 0 && b != 0) ? sm_alog[(sm_log[a & 0xFF] + sm_log[b & 0xFF]) % 255] : 0; - } - - /** Convenience method used in generating Transposition Boxes - */ - static int Mul4(int a, char b[]) - { - if(a == 0) - return 0; - a = sm_log[a & 0xFF]; - int a0 = (b[0] != 0) ? sm_alog[(a + sm_log[b[0] & 0xFF]) % 255] & 0xFF : 0; - int a1 = (b[1] != 0) ? sm_alog[(a + sm_log[b[1] & 0xFF]) % 255] & 0xFF : 0; - int a2 = (b[2] != 0) ? sm_alog[(a + sm_log[b[2] & 0xFF]) % 255] & 0xFF : 0; - int a3 = (b[3] != 0) ? sm_alog[(a + sm_log[b[3] & 0xFF]) % 255] & 0xFF : 0; - return a0 << 24 | a1 << 16 | a2 << 8 | a3; - } - -public: - AES(); - - virtual ~AES(); - - /** Expand a user-supplied key material into a session key. - * - * @param key The 128/192/256-bit user-key to use. - * @param chain Initial chain block for CBC and CFB modes. - * @param keylength 16, 24 or 32 bytes - * @param blockSize The block size in bytes of this Rijndael (16, 24 or 32 bytes). - */ - void MakeKey(char const* key, char const* chain, int keylength=DEFAULT_BLOCK_SIZE, int blockSize=DEFAULT_BLOCK_SIZE); - -private: - /** Auxiliary Function - */ - void Xor(char* buff, char const* chain) - { - if(false==m_bKeyInit) - return; - for(int i=0; i