Lines Matching full:sum
52 #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
58 int sum = 0;
85 sum += s_util.s;
95 sum <<= 8;
106 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
107 sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
108 sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
109 sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
114 sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
122 sum += *w++;
126 sum <<= 8;
130 sum += s_util.s;
142 sum += s_util.s;
145 return (~sum & 0xffff);
155 in_cksum_shouldbe(uint16_t sum, uint16_t computed_sum)
165 * field from the sum of all the data in the packet, and then
168 * "sum" is the value of the checksum field, and "computed_sum"
169 * is the negative of the sum of all the data in the packets,
170 * so that's -(-computed_sum - sum), or (sum + computed_sum).
175 * and then adding the upper 16 bits of the sum, which contain
176 * the carry, to the lower 16 bits of the sum, and then do it
177 * again in case *that* sum produced a carry.
193 shouldbe = sum;