Lines Matching defs:sum
141 uint32_t sum = 0;
145 /* calculate the sum of all 16 bit words */
148 sum += word16;
154 sum += word16;
158 sum += word16;
162 sum += (uint16_t) OPENVPN_IPPROTO_UDP + (uint16_t) len_udp;
164 /* keep only the last 16 bits of the 32 bit calculated sum and add the carries */
165 while (sum >> 16)
166 sum = (sum & 0xFFFF) + (sum >> 16);
168 /* Take the one's complement of sum */
169 return ((uint16_t) ~sum);