summaryrefslogtreecommitdiff
path: root/idea.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-15 03:17:35 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-15 03:17:35 +0000
commit04741fb6181f8cc1ebc6f527d8d22840d019eb7b (patch)
tree793fb68beeb2309d424c9cd20b9f54f6a9dee166 /idea.c
parentc0a8896d9a90e59429b6fecadc397ead42974f59 (diff)
-- Remove structs completely
-- results is now a static variable in each benchmark -- added get*Score routines -- finally got rid of nmglobal.h completely -- removed more useless stuff git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@53 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'idea.c')
-rw-r--r--idea.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/idea.c b/idea.c
index bd8d539..1fc0ac5 100644
--- a/idea.c
+++ b/idea.c
@@ -6,7 +6,7 @@
#include <limits.h>
#include <time.h>
-#include "nmglobal.h"
+#include "cleanbench.h"
#include "randnum.h"
@@ -52,6 +52,8 @@ 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);
+static double results;
+
/***********
** DoIDEA **
************
@@ -62,7 +64,6 @@ void
DoIDEA(void)
{
const char* context = "CPU:IDEA";
- IDEAStruct* locideastruct=&global_ideastruct; /* Loc pointer to global structure */
unsigned char* plain1 = NULL; /* First plaintext buffer */
unsigned char* crypt1 = NULL; /* Encryption buffer */
unsigned char* plain2 = NULL; /* Second plaintext buffer */
@@ -157,7 +158,7 @@ DoIDEA(void)
free(crypt1);
free(plain2);
- locideastruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time;
+ results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time;
}
/********************
@@ -379,3 +380,9 @@ MUL(x4,*Z);
*out=x4;
return;
}
+
+inline double
+getIDEAScore(void)
+{
+ return results;
+}