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
crc32.c
4
crc32.c
@@ -35,6 +35,9 @@ AARU_EXPORT crc32_ctx* AARU_CALL crc32_init(void)
|
||||
|
||||
AARU_EXPORT int AARU_CALL crc32_update(crc32_ctx* ctx, const uint8_t* data, uint32_t len)
|
||||
{
|
||||
ctx->crc = ~crc32_clmul(data, (long)len, ~ctx->crc);
|
||||
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/
|
||||
@@ -81,6 +84,7 @@ AARU_EXPORT int AARU_CALL crc32_update(crc32_ctx* ctx, const uint8_t* data, uint
|
||||
|
||||
ctx->crc = crc;
|
||||
return 0;
|
||||
*/
|
||||
}
|
||||
|
||||
AARU_EXPORT int AARU_CALL crc32_final(crc32_ctx* ctx, uint32_t* crc)
|
||||
|
||||
Reference in New Issue
Block a user