diff options
Diffstat (limited to 'idea.c')
-rw-r--r-- | idea.c | 28 |
1 files changed, 13 insertions, 15 deletions
@@ -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 |