1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Fix compile error caused by __add3()

This commit is contained in:
jsteube 2017-08-27 19:46:17 +02:00
parent 00e38cc2c6
commit a0be36d7b8
3 changed files with 48 additions and 53 deletions

View File

@ -34,23 +34,20 @@
#define MD4_STEP_S(f,a,b,c,d,x,K,s) \
{ \
a += K; \
const u32 t = f (b, c, d); \
a = __add3_S (a, x, t); \
a = __add3_S (a, x, f (b, c, d)); \
a = rotl32_S (a, s); \
}
#define MD4_STEP(f,a,b,c,d,x,K,s) \
{ \
a += K; \
const u32x t = f (b, c, d); \
a = __add3 (a, x, t); \
a = __add3 (a, x, f (b, c, d)); \
a = rotl32 (a, s); \
}
#define MD4_STEP0(f,a,b,c,d,K,s) \
{ \
const u32x t = f (b, c, d); \
a = __add3 (a, K, t); \
a = __add3 (a, K, f (b, c, d)); \
a = rotl32 (a, s); \
}
@ -89,8 +86,7 @@
#define MD5_STEP_S(f,a,b,c,d,x,K,s) \
{ \
a += K; \
const u32 t = f (b, c, d); \
a = __add3_S (a, x, t); \
a = __add3_S (a, x, f (b, c, d)); \
a = rotl32_S (a, s); \
a += b; \
}
@ -98,16 +94,14 @@
#define MD5_STEP(f,a,b,c,d,x,K,s) \
{ \
a += K; \
const u32x t = f (b, c, d); \
a = __add3 (a, x, t); \
a = __add3 (a, x, f (b, c, d)); \
a = rotl32 (a, s); \
a += b; \
}
#define MD5_STEP0(f,a,b,c,d,K,s) \
{ \
const u32x t = f (b, c, d); \
a = __add3 (a, K, t); \
a = __add3 (a, K, f (b, c, d)); \
a = rotl32 (a, s); \
a += b; \
}
@ -139,8 +133,7 @@
#define SHA1_STEP_S(f,a,b,c,d,e,x) \
{ \
e += K; \
const u32 t = f (b, c, d); \
e = __add3_S (e, x, t); \
e = __add3_S (e, x, f (b, c, d)); \
e += rotl32_S (a, 5u); \
b = rotl32_S (b, 30u); \
}
@ -148,24 +141,21 @@
#define SHA1_STEP(f,a,b,c,d,e,x) \
{ \
e += K; \
const u32x t = f (b, c, d); \
e = __add3 (e, x, t); \
e = __add3 (e, x, f (b, c, d)); \
e += rotl32 (a, 5u); \
b = rotl32 (b, 30u); \
}
#define SHA1_STEP0(f,a,b,c,d,e,x) \
{ \
const u32x t = f (b, c, d); \
e = __add3 (e, K, t); \
e = __add3 (e, K, f (b, c, d)); \
e += rotl32 (a, 5u); \
b = rotl32 (b, 30u); \
}
#define SHA1_STEPX(f,a,b,c,d,e,x) \
{ \
const u32x t = f (b, c, d); \
e = __add3 (e, x, t); \
e = __add3 (e, x, f (b, c, d)); \
e += rotl32 (a, 5u); \
b = rotl32 (b, 30u); \
}
@ -218,28 +208,20 @@
#define SHA256_STEP_S(F0,F1,a,b,c,d,e,f,g,h,x,K) \
{ \
const u32 t1 = SHA256_S3_S (e); \
const u32 t2 = F1 (e,f,g); \
h = __add3_S (h, K, x); \
h = __add3_S (h, t1, t2); \
h = __add3_S (h, SHA256_S3_S (e), F1 (e,f,g)); \
d += h; \
const u32 t3 = SHA256_S2_S (a); \
const u32 t4 = F0 (a,b,c); \
h = __add3_S (h, t3, t4); \
h = __add3_S (h, SHA256_S2_S (a), F0 (a,b,c)); \
}
#define SHA256_EXPAND_S(x,y,z,w) (SHA256_S1_S (x) + y + SHA256_S0_S (z) + w)
#define SHA256_STEP(F0,F1,a,b,c,d,e,f,g,h,x,K) \
{ \
const u32 t1 = SHA256_S3 (e); \
const u32 t2 = F1 (e,f,g); \
h = __add3 (h, K, x); \
h = __add3 (h, t1, t2); \
h = __add3 (h, SHA256_S3 (e), F1 (e,f,g)); \
d += h; \
const u32 t3 = SHA256_S2 (a); \
const u32 t4 = F0 (a,b,c); \
h = __add3 (h, t3, t4); \
h = __add3 (h, SHA256_S2 (a), F0 (a,b,c)); \
}
#define SHA256_EXPAND(x,y,z,w) (SHA256_S1 (x) + y + SHA256_S0 (z) + w)

View File

@ -6,6 +6,9 @@
#ifndef _BITOPS_H
#define _BITOPS_H
u32 __add3 (const u32 a, const u32 b, const u32 c);
u32 __add3_S (const u32 a, const u32 b, const u32 c);
u32 rotl32 (const u32 a, const u32 n);
u32 rotr32 (const u32 a, const u32 n);
u64 rotl64 (const u64 a, const u64 n);

View File

@ -7,6 +7,16 @@
#include "types.h"
#include "bitops.h"
u32 __add3_S (const u32 a, const u32 b, const u32 c)
{
return a + b + c;
}
u32 __add3 (const u32 a, const u32 b, const u32 c)
{
return a + b + c;
}
u32 rotl32 (const u32 a, const u32 n)
{
#if defined (_MSC_VER)