diff -urpN jumbo-bleed0/src/pst_fmt_plug.c jumbo-bleeding/src/pst_fmt_plug.c --- jumbo-bleed0/src/pst_fmt_plug.c 2012-07-24 17:56:58.406250000 +0000 +++ jumbo-bleeding/src/pst_fmt_plug.c 2012-07-24 17:54:42.390625000 +0000 @@ -12,9 +12,10 @@ #include "misc.h" #include "common.h" #include "formats.h" +#include "pkzip.h" // includes the 'inline' crc table. #ifdef _OPENMP #include -#define OMP_SCALE 64 +#define OMP_SCALE 8 static int omp_t = 1; #endif @@ -29,10 +30,14 @@ static int omp_t = 1; #define BINARY_SIZE 4 #define SALT_SIZE 0 #define MIN_KEYS_PER_CRYPT 1 -#define MAX_KEYS_PER_CRYPT 1 +#define MAX_KEYS_PER_CRYPT 256 static struct fmt_tests tests[] = { {"$pst-crc32$a9290513", "openwall"}, /* "jfuck jw" works too ;) */ + {"$pst-crc32$50e099bc", "password"}, + {"$pst-crc32$00000000", ""}, + {"$pst-crc32$e3da3318", "xxx"}, + {"$pst-crc32$a655dd18", "XYz123"}, {NULL} }; @@ -85,7 +90,15 @@ static void crypt_all(int count) #pragma omp parallel for private(i) #endif for (i = 0; i < count; ++i) { + #if 0 crypt_out[i] = ComputeCRC(0, saved_key[i], strlen(saved_key[i])); + #else + ARCH_WORD_32 crc = 0; + unsigned char *p = (unsigned char*)saved_key[i]; + while (*p) + crc = pkzip_crc32(crc, *p++); + crypt_out[i] = crc; + #endif } }