C++ doesn't define overflow on signed types, so use unsigned types instead. Luckily all right shifts were unsigned anyway. Some signed extension was happening (handling remainders after processing 8-byte chunks) but should still be there. Caught by debug build.