Add CLMUL implementations for CRC32 and CRC64.

This commit is contained in:
2021-09-22 23:49:10 +01:00
parent 886d613f6e
commit 186f57d7cb
7 changed files with 736 additions and 3 deletions

View File

@@ -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)