Lines Matching defs:p
138 #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */
252 one. If we call the above polynomial p, and represent a byte as the
254 byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p,
259 incoming bit, x^32 is added mod p to the register if the bit is a one (where
260 x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x
261 (which is shifting right by one and adding x^32 mod p if the bit shifted out
273 z_crc_t p;
277 p = i;
279 p = p & 1 ? (p >> 1) ^ POLY : p >> 1;
280 crc_table[i] = p;
282 crc_big_table[i] = byte_swap(p);
286 /* initialize the x^2^n mod p(x) table */
287 p = (z_crc_t)1 << 30; /* x^1 */
288 x2n_table[0] = p;
290 x2n_table[n] = p = multmodp(p, p);
509 z_crc_t i, p, q;
511 p = x2nmodp((n * w + 3 - k) << 3, 0);
515 ltl[k][i] = q = multmodp(i << 24, p);
536 Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
541 z_crc_t m, p;
544 p = 0;
547 p ^= b;
554 return p;
558 Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
563 z_crc_t p;
565 p = (z_crc_t)1 << 31; /* x^0 == 1 */
568 p = multmodp(x2n_table[k & 31], p);
572 return p;