diff --git a/OpenCL/m18700_a1-optimized.cl b/OpenCL/m18700_a1-optimized.cl index 6e6c8d0b8..8c78f841d 100644 --- a/OpenCL/m18700_a1-optimized.cl +++ b/OpenCL/m18700_a1-optimized.cl @@ -115,7 +115,7 @@ __kernel void m18700_m04 (KERN_ATTR_BASIC ()) w[15] = wordl3[3] | wordr3[3]; /** - * djb + * hashCode() */ u32x hash = 0; @@ -260,7 +260,7 @@ __kernel void m18700_s04 (KERN_ATTR_BASIC ()) w[15] = wordl3[3] | wordr3[3]; /** - * djb + * hashCode() */ u32x hash = 0; diff --git a/docs/changes.txt b/docs/changes.txt index 42420b1c4..f42e2e63b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -7,7 +7,7 @@ - Added hash-mode 18400 (Open Document Format (ODF) 1.2 (SHA-256, AES)) - Added hash-mode 18500 sha1(md5(md5($pass))) - Added hash-mode 18600 (Open Document Format (ODF) 1.1 (SHA-1, Blowfish)) -- Added hash-mode 18700 DJB 32 +- Added hash-mode 18700 Java Object hashCode() ## ## Bugs diff --git a/docs/readme.txt b/docs/readme.txt index f96a61fc1..8c4a278fe 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -61,7 +61,7 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - GOST R 34.11-94 - GOST R 34.11-2012 (Streebog) 256-bit - GOST R 34.11-2012 (Streebog) 512-bit -- DJB 32 +- Java Object hashCode() - md5($pass.$salt) - md5($salt.$pass) - md5(utf16le($pass).$salt) diff --git a/src/modules/module_18700.c b/src/modules/module_18700.c index 9d7807f9d..523436d51 100644 --- a/src/modules/module_18700.c +++ b/src/modules/module_18700.c @@ -18,7 +18,7 @@ static const u32 DGST_POS2 = 2; static const u32 DGST_POS3 = 3; static const u32 DGST_SIZE = DGST_SIZE_4_4; static const u32 HASH_CATEGORY = HASH_CATEGORY_RAW_HASH; -static const char *HASH_NAME = "DJB 32"; +static const char *HASH_NAME = "Java Object hashCode()"; static const u64 KERN_TYPE = 18700; static const u32 OPTI_TYPE = OPTI_TYPE_RAW_HASH; static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE; diff --git a/tools/test_modules/m18700.pm b/tools/test_modules/m18700.pm index 6f10c718d..6c8c7a9ef 100644 --- a/tools/test_modules/m18700.pm +++ b/tools/test_modules/m18700.pm @@ -10,8 +10,10 @@ use warnings; sub module_constraints { [[0, 255], [-1, -1], [0, 55], [-1, -1], [-1, -1]] } -sub djb32 +sub hashCode { + use integer; + my $word = shift; my @chars = unpack ("C*", $word); @@ -20,18 +22,17 @@ sub djb32 while (my $c = shift @chars) { - $hash = ($hash * 31) & 0xffffffff; - $hash = ($hash + $c) & 0xffffffff; + $hash = ($hash * 31) + $c; } - return $hash; + return $hash & 0xffffffff; } sub module_generate_hash { my $word = shift; - my $digest = djb32 ($word); + my $digest = hashCode ($word); my $hash = sprintf ("%08x", $digest);