crc32.c (116189) | crc32.c (139815) |
---|---|
1/*- 2 * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or 3 * code or tables extracted from it, as desired without restriction. | 1/*- 2 * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or 3 * code or tables extracted from it, as desired without restriction. |
4 * | 4 */ 5 6/* |
5 * First, the polynomial itself and its table of feedback terms. The 6 * polynomial is 7 * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 8 * 9 * Note that we take it "backwards" and put the highest-order term in 10 * the lowest-order bit. The X^32 term is "implied"; the LSB is the 11 * X^31 term, etc. The X^0 term (usually shown as "+1") results in 12 * the MSB being 1 --- 23 unchanged lines hidden (view full) --- 36 * using byte-swap instructions 37 * polynomial $edb88320 38 * 39 * 40 * CRC32 code derived from work by Gary S. Brown. 41 */ 42 43#include <sys/cdefs.h> | 7 * First, the polynomial itself and its table of feedback terms. The 8 * polynomial is 9 * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 10 * 11 * Note that we take it "backwards" and put the highest-order term in 12 * the lowest-order bit. The X^32 term is "implied"; the LSB is the 13 * X^31 term, etc. The X^0 term (usually shown as "+1") results in 14 * the MSB being 1 --- 23 unchanged lines hidden (view full) --- 38 * using byte-swap instructions 39 * polynomial $edb88320 40 * 41 * 42 * CRC32 code derived from work by Gary S. Brown. 43 */ 44 45#include <sys/cdefs.h> |
44__FBSDID("$FreeBSD: head/sys/libkern/crc32.c 116189 2003-06-11 05:37:42Z obrien $"); | 46__FBSDID("$FreeBSD: head/sys/libkern/crc32.c 139815 2005-01-07 00:24:33Z imp $"); |
45 46#include <sys/param.h> 47#include <sys/systm.h> 48 49uint32_t crc32_tab[] = { 50 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 51 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 52 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, --- 57 unchanged lines hidden --- | 47 48#include <sys/param.h> 49#include <sys/systm.h> 50 51uint32_t crc32_tab[] = { 52 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 53 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 54 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, --- 57 unchanged lines hidden --- |