mirror of
https://github.com/aaru-dps/Aaru.Checksums.Native.git
synced 2025-12-16 19:24:29 +00:00
Add CLMUL implementations for CRC32 and CRC64.
This commit is contained in:
4
crc64.c
4
crc64.c
@@ -35,6 +35,9 @@ AARU_EXPORT crc64_ctx* AARU_CALL crc64_init(void)
|
||||
|
||||
AARU_EXPORT int AARU_CALL crc64_update(crc64_ctx* ctx, const uint8_t* data, uint32_t len)
|
||||
{
|
||||
ctx->crc = ~crc64_clmul(~ctx->crc, data, len);
|
||||
return 0;
|
||||
/*
|
||||
// Unroll according to Intel slicing by uint8_t
|
||||
// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf
|
||||
// http://sourceforge.net/projects/slicing-by-8/
|
||||
@@ -70,6 +73,7 @@ AARU_EXPORT int AARU_CALL crc64_update(crc64_ctx* ctx, const uint8_t* data, uint
|
||||
|
||||
ctx->crc = crc;
|
||||
return 0;
|
||||
*/
|
||||
}
|
||||
|
||||
AARU_EXPORT int AARU_CALL crc64_final(crc64_ctx* ctx, uint64_t* crc)
|
||||
|
||||
Reference in New Issue
Block a user