1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 06:38:11 +00:00

small fix for unknown opencl platforms

This commit is contained in:
jsteube 2016-01-04 16:13:10 +01:00
parent 3b589e3aac
commit c4b1c8e7ca
3 changed files with 18 additions and 10 deletions

View File

@ -346,14 +346,14 @@ static inline u32 rotl32 (const u32 a, const u32 n)
return rotate (a, n);
}
static inline u64 rotr64 (const u64 a, const u64 n)
static inline u64 rotr64 (const u64 a, const u32 n)
{
return rotate (a, 64 - n);
return rotate (a, (u64) 64 - n);
}
static inline u64 rotl64 (const u64 a, const u64 n)
static inline u64 rotl64 (const u64 a, const u32 n)
{
return rotate (a, n);
return rotr64 (a, (u64) 64 - n);
}
#endif
@ -368,7 +368,8 @@ static inline u32 rotr32 (const u32 a, const u32 n)
static inline u32 rotl32 (const u32 a, const u32 n)
{
return rotate (a, n);
// return rotate (a, n);
return (a << n) | (a >> (32 - n));
}
static inline u64 rotr64 (const u64 a, const u32 n)
@ -378,7 +379,7 @@ static inline u64 rotr64 (const u64 a, const u32 n)
static inline u64 rotl64 (const u64 a, const u32 n)
{
return rotr64 (a, 64 - n);
return rotr64 (a, (u64) 64 - n);
}
#endif

View File

@ -37,8 +37,8 @@
#define MD4_F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
#define MD4_G(x,y,z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
#define MD4_H(x,y,z) ((x) ^ (y) ^ (z))
#define MD4_H1(x,y,z) ((tmp2 = (x) ^ (y)) ^ (z))
#define MD4_H2(x,y,z) ((x) ^ tmp2)
#define MD5_H1(x,y,z) (MD4_H((x), (y), (z)))
#define MD5_H2(x,y,z) (MD4_H((x), (y), (z)))
#define MD4_Fo(x,y,z) (MD4_F((x), (y), (z)))
#define MD4_Go(x,y,z) (MD4_G((x), (y), (z)))
#endif
@ -97,8 +97,8 @@
#define MD5_F(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
#define MD5_G(x,y,z) ((y) ^ ((z) & ((x) ^ (y))))
#define MD5_H(x,y,z) ((x) ^ (y) ^ (z))
#define MD5_H1(x,y,z) ((tmp2 = (x) ^ (y)) ^ (z))
#define MD5_H2(x,y,z) ((x) ^ tmp2)
#define MD5_H1(x,y,z) (MD5_H((x), (y), (z)))
#define MD5_H2(x,y,z) (MD5_H((x), (y), (z)))
#define MD5_I(x,y,z) ((y) ^ ((x) | ~(z)))
#define MD5_Fo(x,y,z) (MD5_F((x), (y), (z)))
#define MD5_Go(x,y,z) (MD5_G((x), (y), (z)))

View File

@ -2536,6 +2536,13 @@ static void run_kernel_bzero (hc_device_param_t *device_param, cl_mem buf, const
myfree (tmp);
}
if (data.vendor_id == VENDOR_ID_UNKNOWN)
{
const cl_uchar zero = 0;
hc_clEnqueueFillBuffer (device_param->command_queue, buf, &zero, sizeof (cl_uchar), 0, size, 0, NULL, NULL);
}
}
static int run_rule_engine (const int rule_len, const char *rule_buf)