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,7 +20,7 @@
|
||||
#define AARU_CHECKSUMS_NATIVE_FLETCHER32_H
|
||||
|
||||
#define FLETCHER32_MODULE 0xFFFF
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(ADLER_MODULE-1) <= 2^32-1 */
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(FLETCHER32_MODULE-1) <= 2^32-1 */
|
||||
#define NMAX 5552
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user