summaryrefslogtreecommitdiff
path: root/idea.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-14 23:03:36 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-14 23:03:36 +0000
commit34edabbf495e0222c59937973ab2bfecc8e32dd6 (patch)
treecb3f1660f1fdac73e1f7281d25cb35b68a7db1aa /idea.c
parent7225b0865e8c7697fce69224640142374b22364d (diff)
Remove adjust struct member in favor of a local static variable
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@44 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'idea.c')
-rw-r--r--idea.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/idea.c b/idea.c
index 335e1e5..2bc7f9b 100644
--- a/idea.c
+++ b/idea.c
@@ -59,20 +59,18 @@ static void cipher_idea(uint16_t in[4], uint16_t out[4], IDEAkey Z);
void
DoIDEA(void)
{
- const char *context = "CPU:IDEA";
- IDEAStruct *locideastruct=&global_ideastruct; /* Loc pointer to global structure */
- clock_t total_time = 0;
- int iterations = 0;
- unsigned char *plain1 = NULL; /* First plaintext buffer */
- unsigned char *crypt1 = NULL; /* Encryption buffer */
- unsigned char *plain2 = NULL; /* Second plaintext buffer */
- IDEAkey Z,DK;
- uint16_t userkey[8];
- int i;
+ 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 */
+ clock_t total_time = 0;
+ int iterations = 0;
+ IDEAkey Z, DK;
+ uint16_t userkey[8];
+ int i;
+ static int is_adjusted = FALSE;
- /*
- ** Re-init random-number generator.
- */
randnum(3);
/*
@@ -129,8 +127,8 @@ DoIDEA(void)
/*
** See if we need to perform self adjustment loop.
*/
- if (locideastruct->adjust == FALSE) {
- locideastruct->adjust = TRUE;
+ if (is_adjusted == FALSE) {
+ is_adjusted = TRUE;
/*
** Do self-adjustment. This involves initializing the
** # of loops and increasing the loop count until we