Add unit tests for Adler-32.

This commit is contained in:
2021-10-05 02:21:51 +01:00
parent 513ef08c43
commit a9c49a64b4
9 changed files with 245 additions and 105 deletions

View File

@@ -12,7 +12,7 @@
#include "adler32.h"
#include "simd.h"
AVX2 void adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, size_t len)
AVX2 void adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf, long len)
{
uint32_t s1 = *sum1;
uint32_t s2 = *sum2;
@@ -21,7 +21,7 @@ AVX2 void adler32_avx2(uint16_t* sum1, uint16_t* sum2, const unsigned char* buf,
* Process the data in blocks.
*/
const unsigned BLOCK_SIZE = 1 << 5;
size_t blocks = len / BLOCK_SIZE;
long blocks = len / BLOCK_SIZE;
len -= blocks * BLOCK_SIZE;
while(blocks)