1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00
hashcat/OpenCL/inc_truecrypt_crc32.cl

35 lines
540 B
Common Lisp

/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#include "inc_vendor.h"
#include "inc_types.h"
#include "inc_common.h"
#include "inc_truecrypt_crc32.h"
DECLSPEC u32 round_crc32 (u32 a, const u32 v)
{
const u32 k = (a ^ v) & 0xff;
const u32 s = a >> 8;
a = crc32tab[k];
a ^= s;
return a;
}
DECLSPEC u32 round_crc32_4 (const u32 w, const u32 iv)
{
u32 a = iv;
a = round_crc32 (a, w >> 0);
a = round_crc32 (a, w >> 8);
a = round_crc32 (a, w >> 16);
a = round_crc32 (a, w >> 24);
return a;
}