diff -urp bleeding-jumbo-opt5/src/rawMD5_fmt_plug.c bleeding-jumbo-opt/src/rawMD5_fmt_plug.c --- bleeding-jumbo-opt5/src/rawMD5_fmt_plug.c 2015-09-15 00:00:46 +0000 +++ bleeding-jumbo-opt/src/rawMD5_fmt_plug.c 2015-09-16 23:12:28 +0000 @@ -121,6 +121,8 @@ static void init(struct fmt_main *self) self->params.min_keys_per_crypt *= omp_t; omp_t *= OMP_SCALE; self->params.max_keys_per_crypt *= omp_t; +#else + self->params.max_keys_per_crypt *= 10; #endif #ifndef SIMD_COEF_32 saved_len = mem_calloc(self->params.max_keys_per_crypt, @@ -151,7 +153,7 @@ static int valid(char *ciphertext, struc char *p, *q; p = ciphertext; - if (!strncmp(p, FORMAT_TAG, TAG_LENGTH)) + if (*p == '$' && !strncmp(p, FORMAT_TAG, TAG_LENGTH)) p += TAG_LENGTH; q = p; @@ -162,13 +164,14 @@ static int valid(char *ciphertext, struc static char *split(char *ciphertext, int index, struct fmt_main *self) { - static char out[TAG_LENGTH + CIPHERTEXT_LENGTH + 1]; + static char out[TAG_LENGTH + CIPHERTEXT_LENGTH + 1] = FORMAT_TAG; - if (!strncmp(ciphertext, FORMAT_TAG, TAG_LENGTH)) + if (ciphertext[0] == '$' && + !strncmp(ciphertext, FORMAT_TAG, TAG_LENGTH)) return ciphertext; - memcpy(out, FORMAT_TAG, TAG_LENGTH); - memcpy(out + TAG_LENGTH, ciphertext, CIPHERTEXT_LENGTH + 1); + memcpy(out + TAG_LENGTH, ciphertext, CIPHERTEXT_LENGTH); + return out; } @@ -329,13 +332,12 @@ static int crypt_all(int *pcount, struct const int count = *pcount; int index = 0; -#ifdef _OPENMP int loops = (count + MAX_KEYS_PER_CRYPT - 1) / MAX_KEYS_PER_CRYPT; +#ifdef _OPENMP #pragma omp parallel for - for (index = 0; index < loops; index++) #endif - { + for (index = 0; index < loops; index++) { #if SIMD_COEF_32 SIMDmd5body(saved_key[index], crypt_key[index], NULL, SSEi_REVERSE_STEPS | SSEi_MIXED_IN); #else @@ -351,7 +353,7 @@ static int crypt_all(int *pcount, struct static int cmp_all(void *binary, int count) { #ifdef SIMD_COEF_32 unsigned int x, y; -#ifdef _OPENMP +#if 1 const unsigned int c = (count + SIMD_COEF_32 - 1) / SIMD_COEF_32; #else const unsigned int c = SIMD_PARA_MD5; @@ -366,7 +368,7 @@ static int cmp_all(void *binary, int cou #else unsigned int index = 0; -#ifdef _OPENMP +#if 1 for (index = 0; index < count; index++) #endif if (!memcmp(binary, crypt_key[index], BINARY_SIZE))