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