Lines Matching defs:sum
119 register Crc_t* sum;
128 if (sum = newof(0, Crc_t, 1, 0))
130 sum->method = (Method_t*)method;
131 sum->name = name;
136 sum->init=0;
137 sum->done=0xffffffff;
138 sum->xorsize=0x0;
139 sum->addsize=0x1;
140 sum->rotate=1;
143 sum->tab=posix_cksum_tab;
158 sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
160 sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
162 sum->rotate = 1;
165 sum->addsize = 1;
167 sum->xorsize = strtoul(v + 1, NiL, 0);
172 if (sum->rotate)
180 for (i = 0; i < elementsof(sum->tabdata); i++)
190 sum->tabdata[i] = t;
195 for (i = 0; i < elementsof(sum->tabdata); i++)
200 sum->tabdata[i] = x;
204 sum->tab=sum->tabdata;
207 return (Sum_t*)sum;
213 Crc_t* sum = (Crc_t*)p;
215 sum->sum = sum->init;
236 Crc_t* sum = (Crc_t*)p;
237 register Crcnum_t c = sum->sum;
244 if (sum->rotate)
251 CRCROTATE(sum, c, *b++);
259 CRCROTATE(sum, c, *b++);
269 CRC(sum, c, *b++);
277 CRC(sum, c, *b++);
281 sum->sum = c;
288 Crc_t* sum = (Crc_t*)p;
289 register Crcnum_t c = sum->sum;
293 if (sum->rotate)
295 CRCROTATE(sum, c, *b++);
298 CRC(sum, c, *b++);
299 sum->sum = c;
307 register Crc_t* sum = (Crc_t*)p;
313 c = sum->sum;
314 if (sum->addsize)
316 n = sum->size ^ sum->xorsize;
317 if (sum->rotate)
320 CRCROTATE(sum, c, n);
327 CRC(sum, c, n >> j);
330 sum->sum = c ^ sum->done;
331 sum->total_sum ^= (sum->sum &= 0xffffffff);