From 37438ca202a9a1f4e782f1d1803686fc6b65e918 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 12 Nov 2008 23:25:26 +0000 Subject: 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 --- idea.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'idea.c') diff --git a/idea.c b/idea.c index 464dc74..54881f8 100644 --- a/idea.c +++ b/idea.c @@ -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 ** ************ -- cgit v1.2.3