- buf_32 = (uint32_t*)buf_64;
-
- if (len & sizeof(uint32_t)) {
- sum += *buf_32;
- if (sum < *buf_32)
- sum++;
-
- buf_32 ++;
- }
-
- buf_16 = (uint16_t*)buf_32;
-
- if (len & sizeof(uint16_t)) {
- sum += *buf_16;
- if (sum < *buf_16)
- sum ++;
-
- buf_16 ++;
- }
+ if (len % sizeof(uint64_t)) {
+ /* If the buffer is not aligned to 64-bit, we need
+ to zero-pad the last few bytes and add them in */
+ uint64_t buf_tail = 0;