summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-05-29 22:34:29 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-05-29 22:34:29 -0400
commit5e61c7ffbcdd706292888c14f4b5ddd65d56050d (patch)
treebbf5b20413b048fa8d89d2c684db5781b8f21d5a
parentda6193b1fcc1dfab27f4c36917864f2f2c41cf3e (diff)
Switch to 0x1edc6f41 polynomialcrc
-rw-r--r--test/affine-test.c2
-rw-r--r--test/blitters-test.c2
-rw-r--r--test/composite-traps-test.c2
-rw-r--r--test/region-contains-test.c2
-rw-r--r--test/scaling-test.c2
-rw-r--r--test/utils.c105
6 files changed, 58 insertions, 57 deletions
diff --git a/test/affine-test.c b/test/affine-test.c
index a4ceed3d..57553589 100644
--- a/test/affine-test.c
+++ b/test/affine-test.c
@@ -306,6 +306,6 @@ main (int argc, const char *argv[])
{
pixman_disable_out_of_bounds_workaround ();
- return fuzzer_test_main ("affine", 8000000, 0x1EF2175A,
+ return fuzzer_test_main ("affine", 8000000, 0x99CCFDE0,
test_composite, argc, argv);
}
diff --git a/test/blitters-test.c b/test/blitters-test.c
index feea308c..15f45e8f 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -424,6 +424,6 @@ main (int argc, const char *argv[])
}
return fuzzer_test_main("blitters", 2000000,
- 0xA364B5BF,
+ 0x7AB6BA84,
test_composite, argc, argv);
}
diff --git a/test/composite-traps-test.c b/test/composite-traps-test.c
index ff03b50d..7cfb8a75 100644
--- a/test/composite-traps-test.c
+++ b/test/composite-traps-test.c
@@ -251,6 +251,6 @@ test_composite (int testnum,
int
main (int argc, const char *argv[])
{
- return fuzzer_test_main("composite traps", 40000, 0xE3112106,
+ return fuzzer_test_main("composite traps", 40000, 0x35DBFF09,
test_composite, argc, argv);
}
diff --git a/test/region-contains-test.c b/test/region-contains-test.c
index 9524e288..5f66a97e 100644
--- a/test/region-contains-test.c
+++ b/test/region-contains-test.c
@@ -163,7 +163,7 @@ main (int argc, const char *argv[])
{
return fuzzer_test_main ("region_contains",
1000000,
- 0xD2BF8C73,
+ 0x8C02A161,
test_region_contains_rectangle,
argc, argv);
}
diff --git a/test/scaling-test.c b/test/scaling-test.c
index 6f2da143..b552285d 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -362,6 +362,6 @@ main (int argc, const char *argv[])
{
pixman_disable_out_of_bounds_workaround ();
- return fuzzer_test_main("scaling", 8000000, 0x80DF1CB2,
+ return fuzzer_test_main("scaling", 8000000, 0xF3E40B35,
test_composite, argc, argv);
}
diff --git a/test/utils.c b/test/utils.c
index c1bf6dc2..7215df07 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -35,9 +35,9 @@ uint32_t lcg_seed;
* CRC-32 version 2.0.0 by Craig Bruce, 2006-04-29.
*
* This program generates the CRC-32 values for the files named in the
- * command-line arguments. These are the same CRC-32 values used by GZIP,
- * PKZIP, and ZMODEM. The Crc32_ComputeBuf () can also be detached and
- * used independently.
+ * command-line arguments. These are the same CRC-32 values that are
+ * used in iSCSI and Btrfs, and are implemented by the crc32 instruction
+ * in the Nehalem microarchitecture.
*
* THIS PROGRAM IS PUBLIC-DOMAIN SOFTWARE.
*
@@ -50,20 +50,21 @@ uint32_t lcg_seed;
* v1.0.3: replaced CRC constant table by generator function.
* v1.0.4: reformatted code, made ANSI C. 1994-12-05.
* v2.0.0: rewrote to use memory buffer & static table, 2006-04-29.
+ * v2.0.1: Changed to use the 0x1edc6f41 polynomial, 2012-05-29
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
* NAME:
- * Crc32_ComputeBuf () - computes the CRC-32 value of a memory buffer
+ * compute_crc32 () - computes the CRC-32 value of a memory buffer
* DESCRIPTION:
* Computes or accumulates the CRC-32 value for a memory buffer.
- * The 'inCrc32' gives a previously accumulated CRC-32 value to allow
+ * The 'in_crc32' gives a previously accumulated CRC-32 value to allow
* a CRC to be generated for multiple sequential buffer-fuls of data.
- * The 'inCrc32' for the first buffer must be zero.
+ * The 'in_crc32' for the first buffer must be zero.
* ARGUMENTS:
- * inCrc32 - accumulated CRC-32 value, must be 0 on first call
- * buf - buffer to compute CRC-32 value for
- * bufLen - number of bytes in buffer
+ * in_crc32 - accumulated CRC-32 value, must be 0 on first call
+ * buf - buffer to compute CRC-32 value for
+ * buf_len - number of bytes in buffer
* RETURNS:
* crc32 - computed CRC-32 value
* ERRORS:
@@ -76,49 +77,49 @@ compute_crc32 (uint32_t in_crc32,
size_t buf_len)
{
static const uint32_t crc_table[256] = {
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F,
- 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
- 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
- 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
- 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
- 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
- 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
- 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
- 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106,
- 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D,
- 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
- 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7,
- 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
- 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA,
- 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
- 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
- 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84,
- 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
- 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
- 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
- 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55,
- 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
- 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28,
- 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F,
- 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
- 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
- 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69,
- 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
- 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC,
- 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693,
- 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+ 0x00000000, 0x1edc6f41, 0x3db8de82, 0x2364b1c3, 0x7b71bd04, 0x65add245,
+ 0x46c96386, 0x58150cc7, 0xf6e37a08, 0xe83f1549, 0xcb5ba48a, 0xd587cbcb,
+ 0x8d92c70c, 0x934ea84d, 0xb02a198e, 0xaef676cf, 0xf31a9b51, 0xedc6f410,
+ 0xcea245d3, 0xd07e2a92, 0x886b2655, 0x96b74914, 0xb5d3f8d7, 0xab0f9796,
+ 0x05f9e159, 0x1b258e18, 0x38413fdb, 0x269d509a, 0x7e885c5d, 0x6054331c,
+ 0x433082df, 0x5deced9e, 0xf8e959e3, 0xe63536a2, 0xc5518761, 0xdb8de820,
+ 0x8398e4e7, 0x9d448ba6, 0xbe203a65, 0xa0fc5524, 0x0e0a23eb, 0x10d64caa,
+ 0x33b2fd69, 0x2d6e9228, 0x757b9eef, 0x6ba7f1ae, 0x48c3406d, 0x561f2f2c,
+ 0x0bf3c2b2, 0x152fadf3, 0x364b1c30, 0x28977371, 0x70827fb6, 0x6e5e10f7,
+ 0x4d3aa134, 0x53e6ce75, 0xfd10b8ba, 0xe3ccd7fb, 0xc0a86638, 0xde740979,
+ 0x866105be, 0x98bd6aff, 0xbbd9db3c, 0xa505b47d, 0xef0edc87, 0xf1d2b3c6,
+ 0xd2b60205, 0xcc6a6d44, 0x947f6183, 0x8aa30ec2, 0xa9c7bf01, 0xb71bd040,
+ 0x19eda68f, 0x0731c9ce, 0x2455780d, 0x3a89174c, 0x629c1b8b, 0x7c4074ca,
+ 0x5f24c509, 0x41f8aa48, 0x1c1447d6, 0x02c82897, 0x21ac9954, 0x3f70f615,
+ 0x6765fad2, 0x79b99593, 0x5add2450, 0x44014b11, 0xeaf73dde, 0xf42b529f,
+ 0xd74fe35c, 0xc9938c1d, 0x918680da, 0x8f5aef9b, 0xac3e5e58, 0xb2e23119,
+ 0x17e78564, 0x093bea25, 0x2a5f5be6, 0x348334a7, 0x6c963860, 0x724a5721,
+ 0x512ee6e2, 0x4ff289a3, 0xe104ff6c, 0xffd8902d, 0xdcbc21ee, 0xc2604eaf,
+ 0x9a754268, 0x84a92d29, 0xa7cd9cea, 0xb911f3ab, 0xe4fd1e35, 0xfa217174,
+ 0xd945c0b7, 0xc799aff6, 0x9f8ca331, 0x8150cc70, 0xa2347db3, 0xbce812f2,
+ 0x121e643d, 0x0cc20b7c, 0x2fa6babf, 0x317ad5fe, 0x696fd939, 0x77b3b678,
+ 0x54d707bb, 0x4a0b68fa, 0xc0c1d64f, 0xde1db90e, 0xfd7908cd, 0xe3a5678c,
+ 0xbbb06b4b, 0xa56c040a, 0x8608b5c9, 0x98d4da88, 0x3622ac47, 0x28fec306,
+ 0x0b9a72c5, 0x15461d84, 0x4d531143, 0x538f7e02, 0x70ebcfc1, 0x6e37a080,
+ 0x33db4d1e, 0x2d07225f, 0x0e63939c, 0x10bffcdd, 0x48aaf01a, 0x56769f5b,
+ 0x75122e98, 0x6bce41d9, 0xc5383716, 0xdbe45857, 0xf880e994, 0xe65c86d5,
+ 0xbe498a12, 0xa095e553, 0x83f15490, 0x9d2d3bd1, 0x38288fac, 0x26f4e0ed,
+ 0x0590512e, 0x1b4c3e6f, 0x435932a8, 0x5d855de9, 0x7ee1ec2a, 0x603d836b,
+ 0xcecbf5a4, 0xd0179ae5, 0xf3732b26, 0xedaf4467, 0xb5ba48a0, 0xab6627e1,
+ 0x88029622, 0x96def963, 0xcb3214fd, 0xd5ee7bbc, 0xf68aca7f, 0xe856a53e,
+ 0xb043a9f9, 0xae9fc6b8, 0x8dfb777b, 0x9327183a, 0x3dd16ef5, 0x230d01b4,
+ 0x0069b077, 0x1eb5df36, 0x46a0d3f1, 0x587cbcb0, 0x7b180d73, 0x65c46232,
+ 0x2fcf0ac8, 0x31136589, 0x1277d44a, 0x0cabbb0b, 0x54beb7cc, 0x4a62d88d,
+ 0x6906694e, 0x77da060f, 0xd92c70c0, 0xc7f01f81, 0xe494ae42, 0xfa48c103,
+ 0xa25dcdc4, 0xbc81a285, 0x9fe51346, 0x81397c07, 0xdcd59199, 0xc209fed8,
+ 0xe16d4f1b, 0xffb1205a, 0xa7a42c9d, 0xb97843dc, 0x9a1cf21f, 0x84c09d5e,
+ 0x2a36eb91, 0x34ea84d0, 0x178e3513, 0x09525a52, 0x51475695, 0x4f9b39d4,
+ 0x6cff8817, 0x7223e756, 0xd726532b, 0xc9fa3c6a, 0xea9e8da9, 0xf442e2e8,
+ 0xac57ee2f, 0xb28b816e, 0x91ef30ad, 0x8f335fec, 0x21c52923, 0x3f194662,
+ 0x1c7df7a1, 0x02a198e0, 0x5ab49427, 0x4468fb66, 0x670c4aa5, 0x79d025e4,
+ 0x243cc87a, 0x3ae0a73b, 0x198416f8, 0x075879b9, 0x5f4d757e, 0x41911a3f,
+ 0x62f5abfc, 0x7c29c4bd, 0xd2dfb272, 0xcc03dd33, 0xef676cf0, 0xf1bb03b1,
+ 0xa9ae0f76, 0xb7726037, 0x9416d1f4, 0x8acabeb5,
};
uint32_t crc32;