Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 28 Mar 2011 21:19:20 +0200
From: magnum <rawsmooth@...dband.net>
To: john-dev@...ts.openwall.com
Subject: Re: john scalability

On 2011-03-27 01:13, magnum wrote:
> Maybe this was all moot but I learned a lot. The format that needs this
> most (apart from NT) is probably raw-sha1, and this is taken care of by
> intrinsics-2.

After testing with some real-life data I take that back. I got a very 
significant boost even for some sets of salted hashes I had archived. I 
am amazed how some people manage to misuse a perfectly good sized salt.

So here it is, suggested for the Jumbo. This patches all formats that 
had only three sizes (except AFS), extending them to have five.

The bunch of formats that does not have *any* hash functions, are not 
fixed here. I suppose some of them should be looked at - especially 
unsalted ones like mysql. But that is an ancient type of mysql, isn't it?

Many of the formats in this patch will not likely ever benfit from the 
larger sizes but I can't see how this would ever do any harm either.

magnum

diff -urpN john-1.7.6-jumbo-12/src/MD5_apache_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/MD5_apache_fmt.c
--- john-1.7.6-jumbo-12/src/MD5_apache_fmt.c	2009-10-29 03:53:54.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/MD5_apache_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -90,6 +90,16 @@ static int binary_hash_2(void *binary)
 	return *(MD5_word *)binary & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return *(MD5_word *)binary & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return *(MD5_word *)binary & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return MD5_out[index][0] & 0xF;
@@ -105,6 +115,16 @@ static int get_hash_2(int index)
 	return MD5_out[index][0] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return MD5_out[index][0] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return MD5_out[index][0] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return
@@ -179,8 +199,8 @@ struct fmt_main fmt_MD5_apache = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		(void (*)(void *))MD5_std_set_salt,
@@ -192,8 +212,8 @@ struct fmt_main fmt_MD5_apache = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_all,
diff -urpN john-1.7.6-jumbo-12/src/mscash2_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/mscash2_fmt.c
--- john-1.7.6-jumbo-12/src/mscash2_fmt.c	2011-02-17 02:05:49.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/mscash2_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -286,6 +286,18 @@ static int binary_hash_2(void *binary)
 }
 
 
+static int binary_hash_3(void *binary)
+{
+	return ((unsigned int*)binary)[3] & 0x0FFFF;
+}
+
+
+static int binary_hash_4(void *binary)
+{
+	return ((unsigned int*)binary)[3] & 0x0FFFFF;
+}
+
+
 static int get_hash_0(int index)
 {
 	return output1x_dcc2[4 * index + 3] & 0x0F;
@@ -304,6 +316,18 @@ static int get_hash_2(int index)
 }
 
 
+static int get_hash_3(int index)
+{
+	return output1x_dcc2[4 * index + 3] & 0x0FFFF;
+}
+
+
+static int get_hash_4(int index)
+{
+	return output1x_dcc2[4 * index + 3] & 0x0FFFFF;
+}
+
+
 static void nt_hash(int count)
 {
 	int i;
@@ -1349,8 +1373,8 @@ struct fmt_main fmt_mscash2 = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		set_salt,
@@ -1362,8 +1386,8 @@ struct fmt_main fmt_mscash2 = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/mscash_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/mscash_fmt.c
--- john-1.7.6-jumbo-12/src/mscash_fmt.c	2011-02-17 01:57:39.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/mscash_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -256,6 +256,16 @@ static int binary_hash_2(void *binary)
 	return ((unsigned int*)binary)[3] & 0x0FFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((unsigned int*)binary)[3] & 0x0FFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((unsigned int*)binary)[3] & 0x0FFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return output1x[4*index+3] & 0x0F;
@@ -271,6 +281,16 @@ static int get_hash_2(int index)
 	return output1x[4*index+3] & 0x0FFF;
 }
 
+static int get_hash_3(int index)
+{
+	return output1x[4*index+3] & 0x0FFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return output1x[4*index+3] & 0x0FFFFF;
+}
+
 void nt_hash(int count)
 {
 	int i;
@@ -573,8 +593,8 @@ struct fmt_main fmt_mscash = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		set_salt,
@@ -586,8 +606,8 @@ struct fmt_main fmt_mscash = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/mssql05_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/mssql05_fmt.c
--- john-1.7.6-jumbo-12/src/mssql05_fmt.c	2010-08-22 16:35:32.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/mssql05_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -261,6 +261,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -276,6 +286,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 struct fmt_main fmt_mssql05 = {
 	{
 		FORMAT_LABEL,
@@ -300,8 +320,8 @@ struct fmt_main fmt_mssql05 = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		fmt_default_salt_hash,
 		mssql05_set_salt,
@@ -313,8 +333,8 @@ struct fmt_main fmt_mssql05 = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		mssql05_cmp_all,
 		mssql05_cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/mssql_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/mssql_fmt.c
--- john-1.7.6-jumbo-12/src/mssql_fmt.c	2010-08-22 16:35:32.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/mssql_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -269,6 +269,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -284,6 +294,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return *((ARCH_WORD_32 *)salt) & (SALT_HASH_SIZE - 1);
@@ -313,8 +333,8 @@ struct fmt_main fmt_mssql = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		mssql_set_salt,
@@ -326,8 +346,8 @@ struct fmt_main fmt_mssql = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		mssql_cmp_all,
 		mssql_cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/MYSQL_fast_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/MYSQL_fast_fmt.c
--- john-1.7.6-jumbo-12/src/MYSQL_fast_fmt.c	2009-10-29 03:53:54.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/MYSQL_fast_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -184,6 +184,16 @@ int mysql_binary_hash_2(void *binary)
 	return *(ARCH_WORD_32 *)binary & 0xFFF;
 }
 
+int mysql_binary_hash_3(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xFFFF;
+}
+
+int mysql_binary_hash_4(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xFFFFF;
+}
+
 int mysql_get_hash_0(int index)
 {
 	return crypt_key[index][0] & 0xF;
@@ -199,6 +209,16 @@ int mysql_get_hash_2(int index)
 	return crypt_key[index][0] & 0xFFF;
 }
 
+int mysql_get_hash_3(int index)
+{
+	return crypt_key[index][0] & 0xFFFF;
+}
+
+int mysql_get_hash_4(int index)
+{
+	return crypt_key[index][0] & 0xFFFFF;
+}
+
 struct fmt_main fmt_MYSQL_fast =
 {
 	{
@@ -224,8 +244,8 @@ struct fmt_main fmt_MYSQL_fast =
 			mysql_binary_hash_0,
 			mysql_binary_hash_1,
 			mysql_binary_hash_2,
-			NULL,
-			NULL
+			mysql_binary_hash_3,
+			mysql_binary_hash_4
 		},
 		fmt_default_salt_hash,
 		mysql_set_salt,
@@ -237,8 +257,8 @@ struct fmt_main fmt_MYSQL_fast =
 			mysql_get_hash_0,
 			mysql_get_hash_1,
 			mysql_get_hash_2,
-			NULL,
-			NULL
+			mysql_get_hash_3,
+			mysql_get_hash_4
 		},
 		mysql_cmp_all,
 		mysql_cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/mysqlSHA1_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/mysqlSHA1_fmt.c
--- john-1.7.6-jumbo-12/src/mysqlSHA1_fmt.c	2010-08-22 16:35:32.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/mysqlSHA1_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -294,6 +294,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -309,6 +319,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 struct fmt_main fmt_mysqlSHA1 = {
     {
         FORMAT_LABEL,
@@ -333,8 +353,8 @@ struct fmt_main fmt_mysqlSHA1 = {
             binary_hash_0,
             binary_hash_1,
             binary_hash_2,
-			NULL,
-			NULL
+            binary_hash_3,
+            binary_hash_4
         },
         fmt_default_salt_hash,
         mysqlsha1_set_salt,
@@ -346,8 +366,8 @@ struct fmt_main fmt_mysqlSHA1 = {
             get_hash_0,
             get_hash_1,
             get_hash_2,
-			NULL,
-			NULL
+            get_hash_3,
+            get_hash_4
         },
         mysqlsha1_cmp_all,
         mysqlsha1_cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/NS_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/NS_fmt.c
--- john-1.7.6-jumbo-12/src/NS_fmt.c	2009-10-29 03:53:54.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/NS_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -170,6 +170,16 @@ static int binary_hash_2(void *binary)
 	return *(ARCH_WORD_32 *)binary & 0xfff;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xffff;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xfffff;
+}
+
 static int get_hash_0(int index)
 {
 	return crypted[0] & 0xf;
@@ -185,6 +195,16 @@ static int get_hash_2(int index)
 	return crypted[0] & 0xfff;
 }
 
+static int get_hash_3(int index)
+{
+	return crypted[0] & 0xffff;
+}
+
+static int get_hash_4(int index)
+{
+	return crypted[0] & 0xfffff;
+}
+
 char *NS_std_get_salt(char *ciphertext)
 {
 	static char out[SALT_SIZE + 1];
@@ -263,8 +283,8 @@ struct fmt_main fmt_NS = {
                     binary_hash_0,
                     binary_hash_1,
                     binary_hash_2,
-					NULL,
-					NULL
+                    binary_hash_3,
+                    binary_hash_4
 		},
 		fmt_default_salt_hash,
 		NS_std_set_salt,
@@ -276,8 +296,8 @@ struct fmt_main fmt_NS = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		NS_cmp_all,
 		NS_cmp_all,
diff -urpN john-1.7.6-jumbo-12/src/NSLDAP_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/NSLDAP_fmt.c
--- john-1.7.6-jumbo-12/src/NSLDAP_fmt.c	2009-10-29 04:49:11.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/NSLDAP_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -99,6 +99,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -114,6 +124,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 static void set_key(char *key, int index)
 {
 #ifdef MMX_COEF
@@ -237,8 +257,8 @@ struct fmt_main fmt_NSLDAP = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		fmt_default_salt_hash,
 		set_salt,
@@ -250,8 +270,8 @@ struct fmt_main fmt_NSLDAP = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/NSLDAPS_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/NSLDAPS_fmt.c
--- john-1.7.6-jumbo-12/src/NSLDAPS_fmt.c	2010-06-15 03:00:05.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/NSLDAPS_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -120,6 +120,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -135,6 +145,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return *((ARCH_WORD_32 *)salt) & (SALT_HASH_SIZE - 1);
@@ -278,8 +298,8 @@ struct fmt_main fmt_NSLDAPS = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		set_salt,
@@ -291,8 +311,8 @@ struct fmt_main fmt_NSLDAPS = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/OPENLDAPS_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/OPENLDAPS_fmt.c
--- john-1.7.6-jumbo-12/src/OPENLDAPS_fmt.c	2009-10-29 03:53:54.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/OPENLDAPS_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -123,6 +123,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xF;
@@ -138,6 +148,16 @@ static int get_hash_2(int index)
 	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return ((ARCH_WORD_32 *)crypt_key)[index] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return *((ARCH_WORD_32 *)salt) & (SALT_HASH_SIZE - 1);
@@ -277,8 +297,8 @@ struct fmt_main fmt_OPENLDAPS = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		set_salt,
@@ -290,8 +310,8 @@ struct fmt_main fmt_OPENLDAPS = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/PO_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/PO_fmt.c
--- john-1.7.6-jumbo-12/src/PO_fmt.c	2009-09-22 15:16:45.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/PO_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -95,6 +95,16 @@ static int binary_hash_2(void *binary)
 	return *(MD5_word *)binary & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return *(MD5_word *)binary & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return *(MD5_word *)binary & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return MD5_out[0] & 0xF;
@@ -110,6 +120,16 @@ static int get_hash_2(int index)
 	return MD5_out[0] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return MD5_out[0] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return MD5_out[0] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return
@@ -202,8 +222,8 @@ struct fmt_main fmt_PO = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		(void (*)(void *))set_salt,
@@ -215,8 +235,8 @@ struct fmt_main fmt_PO = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_all,
diff -urpN john-1.7.6-jumbo-12/src/sapG_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/sapG_fmt.c
--- john-1.7.6-jumbo-12/src/sapG_fmt.c	2009-10-29 03:53:55.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/sapG_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -312,6 +312,16 @@ static int binary_hash_2(void *binary)
 	return ((ARCH_WORD_32 *)binary)[0] & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return ((ARCH_WORD_32 *)binary)[0] & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return crypt_key[0] & 0xF;
@@ -327,6 +337,16 @@ static int get_hash_2(int index)
 	return crypt_key[0] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return crypt_key[0] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return crypt_key[0] & 0xFFFFF;
+}
+
 
 char *sapcodvng_split(char *ciphertext, int index)
 {
@@ -362,8 +382,8 @@ struct fmt_main fmt_sapG = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		fmt_default_salt_hash,
 		sapcodvng_set_salt,
@@ -375,8 +395,8 @@ struct fmt_main fmt_sapG = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		sapcodvng_cmp_all,
 		sapcodvng_cmp_one,
diff -urpN john-1.7.6-jumbo-12/src/XSHA_fmt.c john-1.7.6-jumbo-12-hash_sizes/src/XSHA_fmt.c
--- john-1.7.6-jumbo-12/src/XSHA_fmt.c	2009-10-29 03:53:54.000000000 +0000
+++ john-1.7.6-jumbo-12-hash_sizes/src/XSHA_fmt.c	2011-03-26 22:26:00.000000000 +0000
@@ -103,6 +103,16 @@ static int binary_hash_2(void *binary)
 	return *(ARCH_WORD_32 *)binary & 0xFFF;
 }
 
+static int binary_hash_3(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xFFFF;
+}
+
+static int binary_hash_4(void *binary)
+{
+	return *(ARCH_WORD_32 *)binary & 0xFFFFF;
+}
+
 static int get_hash_0(int index)
 {
 	return crypt_out[0] & 0xF;
@@ -118,6 +128,16 @@ static int get_hash_2(int index)
 	return crypt_out[0] & 0xFFF;
 }
 
+static int get_hash_3(int index)
+{
+	return crypt_out[0] & 0xFFFF;
+}
+
+static int get_hash_4(int index)
+{
+	return crypt_out[0] & 0xFFFFF;
+}
+
 static int salt_hash(void *salt)
 {
 	return *(ARCH_WORD_32 *)salt & 0x3FF;
@@ -184,8 +204,8 @@ struct fmt_main fmt_XSHA = {
 			binary_hash_0,
 			binary_hash_1,
 			binary_hash_2,
-			NULL,
-			NULL
+			binary_hash_3,
+			binary_hash_4
 		},
 		salt_hash,
 		set_salt,
@@ -197,8 +217,8 @@ struct fmt_main fmt_XSHA = {
 			get_hash_0,
 			get_hash_1,
 			get_hash_2,
-			NULL,
-			NULL
+			get_hash_3,
+			get_hash_4
 		},
 		cmp_all,
 		cmp_all,

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ