Esempio n. 1
0
static u32 crc32_arm64_le_hw(u32 crc, const u8 *p, unsigned int len)
{
	s64 length = len;

	while ((length -= sizeof(u64)) >= 0) {
		CRC32X(crc, get_unaligned_le64(p));
		p += sizeof(u64);
	}

	/* The following is more efficient than the straight loop */
	if (length & sizeof(u32)) {
		CRC32W(crc, get_unaligned_le32(p));
		p += sizeof(u32);
	}
	if (length & sizeof(u16)) {
		CRC32H(crc, get_unaligned_le16(p));
		p += sizeof(u16);
	}
	if (length & sizeof(u8))
		CRC32B(crc, *p);

	return crc;
}
Esempio n. 2
0
void Hash::CRC32B_Generate(FILE *hashfile)
{
   CRC32B(hashfile,digest);
}