diff options
author | Matt Turner <mattst88@gmail.com> | 2008-11-12 23:25:26 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-11-12 23:25:26 +0000 |
commit | 37438ca202a9a1f4e782f1d1803686fc6b65e918 (patch) | |
tree | 7cf856979306a32f7817b528b306539cf914e93b /idea.c | |
parent | 7a57eeccd8ded740d88aba3ea9dcb09050983dd0 (diff) |
Move static function prototypes from nbench1.h to appropriate files
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@14 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'idea.c')
-rw-r--r-- | idea.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -11,6 +11,36 @@ ** */ +/* +** DEFINES +*/ +#define IDEAKEYSIZE 16 +#define IDEABLOCKSIZE 8 +#define ROUNDS 8 +#define KEYLEN (6*ROUNDS+4) + +/* +** MACROS +*/ +#define low16(x) ((x) & 0x0FFFF) +#define MUL(x,y) (x=mul(low16(x),y)) + + +typedef uint16_t IDEAkey[KEYLEN]; + +/* +** PROTOTYPES +*/ +static unsigned long DoIDEAIteration(unsigned char *plain1, + unsigned char *crypt1, unsigned char *plain2, + unsigned long arraysize, unsigned long nloops, + IDEAkey Z, IDEAkey DK); +static uint16_t mul(register uint16_t a, register uint16_t b); +static uint16_t inv(uint16_t x); +static void en_key_idea(uint16_t userkey[8], IDEAkey Z); +static void de_key_idea(IDEAkey Z, IDEAkey DK); +static void cipher_idea(uint16_t in[4], uint16_t out[4], IDEAkey Z); + /*********** ** DoIDEA ** ************ |