8void
Adler32::Update(const
byte *input,
size_t length)
10 const unsigned long BASE = 65521;
12 unsigned long s1 = m_s1;
13 unsigned long s2 = m_s2;
22 }
while (length % 8 != 0);
31 s1 += input[0]; s2 += s1;
32 s1 += input[1]; s2 += s1;
33 s1 += input[2]; s2 += s1;
34 s1 += input[3]; s2 += s1;
35 s1 += input[4]; s2 += s1;
36 s1 += input[5]; s2 += s1;
37 s1 += input[6]; s2 += s1;
38 s1 += input[7]; s2 += s1;
45 if (length % 0x8000 == 0)
58 ThrowIfInvalidTruncatedSize(size);
66 hash[2] =
byte(m_s1 >> 8);
72 hash[0] =
byte(m_s2 >> 8);
Class file for ADLER-32 checksum calculations.
ADLER-32 checksum calculations.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
unsigned char byte
8-bit unsigned datatype
unsigned short word16
16-bit unsigned datatype
Crypto++ library namespace.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.