mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-11 00:01:16 +00:00
Optimize some -m 780x code in kernels
This commit is contained in:
parent
189bbb2661
commit
1449e239c2
@ -191,33 +191,33 @@ KERNEL_FQ void m07800_m04 (KERN_ATTR_RULES ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -278,17 +278,21 @@ KERNEL_FQ void m07800_m04 (KERN_ATTR_RULES ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
@ -451,33 +455,33 @@ KERNEL_FQ void m07800_s04 (KERN_ATTR_RULES ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -538,17 +542,21 @@ KERNEL_FQ void m07800_s04 (KERN_ATTR_RULES ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
|
@ -249,33 +249,33 @@ KERNEL_FQ void m07800_m04 (KERN_ATTR_BASIC ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -336,17 +336,21 @@ KERNEL_FQ void m07800_m04 (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
@ -569,33 +573,33 @@ KERNEL_FQ void m07800_s04 (KERN_ATTR_BASIC ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -656,17 +660,21 @@ KERNEL_FQ void m07800_s04 (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
|
@ -165,33 +165,33 @@ DECLSPEC void m07800m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -252,17 +252,21 @@ DECLSPEC void m07800m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
@ -393,33 +397,33 @@ DECLSPEC void m07800s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -480,17 +484,21 @@ DECLSPEC void m07800s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
|
||||||
}
|
}
|
||||||
|
@ -191,33 +191,33 @@ KERNEL_FQ void m07801_m04 (KERN_ATTR_RULES ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -278,17 +278,21 @@ KERNEL_FQ void m07801_m04 (KERN_ATTR_RULES ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
@ -451,33 +455,33 @@ KERNEL_FQ void m07801_s04 (KERN_ATTR_RULES ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -538,17 +542,21 @@ KERNEL_FQ void m07801_s04 (KERN_ATTR_RULES ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
|
@ -249,33 +249,33 @@ KERNEL_FQ void m07801_m04 (KERN_ATTR_BASIC ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -336,17 +336,21 @@ KERNEL_FQ void m07801_m04 (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
@ -569,33 +573,33 @@ KERNEL_FQ void m07801_s04 (KERN_ATTR_BASIC ())
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -656,17 +660,21 @@ KERNEL_FQ void m07801_s04 (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
|
@ -165,33 +165,33 @@ DECLSPEC void m07801m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -252,17 +252,21 @@ DECLSPEC void m07801m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_M_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
@ -393,33 +397,33 @@ DECLSPEC void m07801s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
digest[3] = SHA1M_D;
|
digest[3] = SHA1M_D;
|
||||||
digest[4] = SHA1M_E;
|
digest[4] = SHA1M_E;
|
||||||
|
|
||||||
sha1_transform (&final[0], &final[4], &final[8], &final[12], digest);
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
|
||||||
// prepare magic array range
|
// prepare magic array range
|
||||||
|
|
||||||
u32 lengthMagicArray = 0x20;
|
u32 lengthMagicArray = 0x20;
|
||||||
u32 offsetMagicArray = 0;
|
u32 offsetMagicArray = 0;
|
||||||
|
|
||||||
lengthMagicArray += ((digest[0] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[0] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[0]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 8) & 0xff) % 6;
|
lengthMagicArray += unpack_v8b_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[1] >> 0) & 0xff) % 6;
|
lengthMagicArray += unpack_v8a_from_v32_S (digest[1]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 24) & 0xff) % 6;
|
lengthMagicArray += unpack_v8d_from_v32_S (digest[2]) % 6;
|
||||||
lengthMagicArray += ((digest[2] >> 16) & 0xff) % 6;
|
lengthMagicArray += unpack_v8c_from_v32_S (digest[2]) % 6;
|
||||||
offsetMagicArray += ((digest[2] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[2] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[2]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[3] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[3]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 24) & 0xff) % 8;
|
offsetMagicArray += unpack_v8d_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 16) & 0xff) % 8;
|
offsetMagicArray += unpack_v8c_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 8) & 0xff) % 8;
|
offsetMagicArray += unpack_v8b_from_v32_S (digest[4]) & 7;
|
||||||
offsetMagicArray += ((digest[4] >> 0) & 0xff) % 8;
|
offsetMagicArray += unpack_v8a_from_v32_S (digest[4]) & 7;
|
||||||
|
|
||||||
// final
|
// final
|
||||||
|
|
||||||
@ -480,17 +484,21 @@ DECLSPEC void m07801s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER
|
|||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
|
|
||||||
int left;
|
if (final_len >= 56)
|
||||||
int off;
|
|
||||||
|
|
||||||
for (left = final_len, off = 0; left >= 56; left -= 64, off += 16)
|
|
||||||
{
|
{
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
final[30] = 0;
|
||||||
|
final[31] = final_len * 8;
|
||||||
|
|
||||||
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
sha1_transform (final + 16, final + 20, final + 24, final + 28, digest);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final[14] = 0;
|
||||||
|
final[15] = final_len * 8;
|
||||||
|
|
||||||
final[off + 15] = final_len * 8;
|
sha1_transform (final + 0, final + 4, final + 8, final + 12, digest);
|
||||||
|
}
|
||||||
sha1_transform (&final[off + 0], &final[off + 4], &final[off + 8], &final[off + 12], digest);
|
|
||||||
|
|
||||||
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
COMPARE_S_SIMD (0, 0, digest[2] & 0xffff0000, digest[1]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user