23 Checksum() : m_value(0)
29 Checksum(
const U32 value) : m_value(value)
49 this->m_value = checksum.m_value;
54 operator==(
const Checksum& checksum)
const
56 return this->m_value == checksum.m_value;
60 operator!=(
const Checksum& checksum)
const
62 return not (*
this == checksum);
81 const U32 offsetMod4 = offset % 4;
82 if (offsetMod4 != 0) {
83 const U8 wordLength =
static_cast<U8>(
min(length, 4 - offsetMod4));
84 this->addWordUnaligned(
86 static_cast<U8>(offset + index),
93 for ( ; index + 4 <= length; index += 4) {
94 addWordAligned(&data[index]);
99 const U8 wordLength =
static_cast<U8>(length - index);
100 this->addWordUnaligned(
102 static_cast<U8>(offset + index),
110 addWordAligned(
const U8 *
const word)
112 for (
U8 i = 0; i < 4; ++i) {
113 addByteAtOffset(word[i], i);
125 U8 offset = position % 4;
126 for (
U8 i = 0; i < length; ++i) {
127 addByteAtOffset(word[i], offset);
142 const U32 addend =
static_cast<U32
>(byte) << (8*(3-offset));
143 this->m_value += addend;