8 #include <botan/adler32.h>
9 #include <botan/loadstor.h>
15 void adler32_update(
const byte input[],
size_t length,
23 S1x += input[ 0]; S2x += S1x;
24 S1x += input[ 1]; S2x += S1x;
25 S1x += input[ 2]; S2x += S1x;
26 S1x += input[ 3]; S2x += S1x;
27 S1x += input[ 4]; S2x += S1x;
28 S1x += input[ 5]; S2x += S1x;
29 S1x += input[ 6]; S2x += S1x;
30 S1x += input[ 7]; S2x += S1x;
31 S1x += input[ 8]; S2x += S1x;
32 S1x += input[ 9]; S2x += S1x;
33 S1x += input[10]; S2x += S1x;
34 S1x += input[11]; S2x += S1x;
35 S1x += input[12]; S2x += S1x;
36 S1x += input[13]; S2x += S1x;
37 S1x += input[14]; S2x += S1x;
38 S1x += input[15]; S2x += S1x;
43 for(
size_t j = 0; j != length; ++j)
58 void Adler32::add_data(
const byte input[],
size_t length)
60 const size_t PROCESS_AMOUNT = 5552;
62 while(length >= PROCESS_AMOUNT)
64 adler32_update(input, PROCESS_AMOUNT, S1, S2);
65 input += PROCESS_AMOUNT;
66 length -= PROCESS_AMOUNT;
69 adler32_update(input, length, S1, S2);
75 void Adler32::final_result(
byte output[])
void store_be(u16bit in, byte out[2])