mirror of
https://github.com/aaru-dps/Aaru.Checksums.Native.git
synced 2025-12-16 19:24:29 +00:00
Expand Fletcher-16 NMAX
The limit when calculating the value of NMAX is 2^16-1 only when sum1 and sum2 are represented as 16-bit. We're representing them as 32-bit. This will be helpful for SIMD implementations of Fletcher-16, because the old limit of 22 bytes would have meant that we could only process 16 bytes at a time before having to compute modulo.
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
#define AARU_CHECKSUMS_NATIVE_FLETCHER16_H
|
||||
|
||||
#define FLETCHER16_MODULE 0xFF
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(ADLER_MODULE-1) <= 2^16-1 */
|
||||
#define NMAX 22
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(FLETCHER16_MODULE-1) <= 2^32-1 */
|
||||
#define NMAX 5802
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user