• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * crc32c.c
3  *
4  * August 26, 2011 Darrick J. Wong <djwong at us.ibm.com>
5  * Reuse Bob Pearson's slice-by-8 implementation for e2fsprogs.
6  *
7  * July 20, 2011 Bob Pearson <rpearson at systemfabricworks.com>
8  * added slice by 8 algorithm to the existing conventional and
9  * slice by 4 algorithms.
10  *
11  * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell.com>
12  * Nicer crc32 functions/docs submitted by linux@horizon.com.  Thanks!
13  * Code was from the public domain, copyright abandoned.  Code was
14  * subsequently included in the kernel, thus was re-licensed under the
15  * GNU GPL v2.
16  *
17  * Oct 12, 2000 Matt Domsch <Matt_Domsch@dell.com>
18  * Same crc32 function was used in 5 other places in the kernel.
19  * I made one version, and deleted the others.
20  * There are various incantations of crc32().  Some use a seed of 0 or ~0.
21  * Some xor at the end with ~0.  The generic crc32() function takes
22  * seed as an argument, and doesn't xor at the end.  Then individual
23  * users can do whatever they need.
24  *   drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0.
25  *   fs/jffs2 uses seed 0, doesn't xor with ~0.
26  *   fs/partitions/efi.c uses seed ~0, xor's with ~0.
27  *
28  * This source code is licensed under the GNU General Public License,
29  * Version 2.  See the file COPYING for more details.
30  */
31 #include "config.h"
32 #include <stdint.h>
33 #include <stdlib.h>
34 #include <stdio.h>
35 #define min(x, y)		((x) > (y) ? (y) : (x))
36 #define __ALIGN_KERNEL_MASK(x, mask)	(((x) + (mask)) & ~(mask))
37 #define __ALIGN_KERNEL(x, a)	__ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
38 #define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
39 #define PTR_ALIGN(p, a)		((__typeof__(p))ALIGN((unsigned long)(p), (a)))
40 #include "crc32c_defs.h"
41 
42 #include "ext2fs.h"
43 #ifdef WORDS_BIGENDIAN
44 #define __constant_cpu_to_le32(x) ___constant_swab32((x))
45 #define __constant_cpu_to_be32(x) (x)
46 #define __be32_to_cpu(x) (x)
47 #define __cpu_to_be32(x) (x)
48 #define __cpu_to_le32(x) (ext2fs_cpu_to_le32((x)))
49 #define __le32_to_cpu(x) (ext2fs_le32_to_cpu((x)))
50 #else
51 #define __constant_cpu_to_le32(x) (x)
52 #define __constant_cpu_to_be32(x) ___constant_swab32((x))
53 #define __be32_to_cpu(x) (ext2fs_be32_to_cpu((x)))
54 #define __cpu_to_be32(x) (ext2fs_cpu_to_be32((x)))
55 #define __cpu_to_le32(x) (x)
56 #define __le32_to_cpu(x) (x)
57 #endif
58 
59 #if CRC_LE_BITS > 8
60 # define tole(x) __constant_cpu_to_le32(x)
61 #else
62 # define tole(x) (x)
63 #endif
64 
65 #if CRC_BE_BITS > 8
66 # define tobe(x) __constant_cpu_to_be32(x)
67 #else
68 # define tobe(x) (x)
69 #endif
70 
71 #include "crc32c_table.h"
72 
73 #if CRC_LE_BITS > 8 || CRC_BE_BITS > 8
74 
75 /* implements slicing-by-4 or slicing-by-8 algorithm */
76 static inline uint32_t
crc32_body(uint32_t crc,unsigned char const * buf,size_t len,const uint32_t (* tab)[256])77 crc32_body(uint32_t crc, unsigned char const *buf, size_t len,
78 	   const uint32_t (*tab)[256])
79 {
80 # ifndef WORDS_BIGENDIAN
81 #  define DO_CRC(x) (crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8))
82 #  define DO_CRC4 (t3[(q) & 255] ^ t2[(q >> 8) & 255] ^ \
83 		   t1[(q >> 16) & 255] ^ t0[(q >> 24) & 255])
84 #  define DO_CRC8 (t7[(q) & 255] ^ t6[(q >> 8) & 255] ^ \
85 		   t5[(q >> 16) & 255] ^ t4[(q >> 24) & 255])
86 # else
87 #  define DO_CRC(x) (crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8))
88 #  define DO_CRC4 (t0[(q) & 255] ^ t1[(q >> 8) & 255] ^ \
89 		   t2[(q >> 16) & 255] ^ t3[(q >> 24) & 255])
90 #  define DO_CRC8 (t4[(q) & 255] ^ t5[(q >> 8) & 255] ^ \
91 		   t6[(q >> 16) & 255] ^ t7[(q >> 24) & 255])
92 # endif
93 	const uint32_t *b;
94 	size_t rem_len;
95 	const uint32_t *t0 = tab[0], *t1 = tab[1], *t2 = tab[2], *t3 = tab[3];
96 	const uint32_t *t4 = tab[4], *t5 = tab[5], *t6 = tab[6], *t7 = tab[7];
97 	uint32_t q;
98 
99 	/* Align it */
100 	if (unlikely((uintptr_t)buf & 3 && len)) {
101 		do {
102 			DO_CRC(*buf++);
103 		} while ((--len) && ((uintptr_t)buf)&3);
104 	}
105 
106 # if CRC_LE_BITS == 32
107 	rem_len = len & 3;
108 	len = len >> 2;
109 # else
110 	rem_len = len & 7;
111 	len = len >> 3;
112 # endif
113 
114 	b = (const uint32_t *)buf;
115 	for (--b; len; --len) {
116 		q = crc ^ *++b; /* use pre increment for speed */
117 # if CRC_LE_BITS == 32
118 		crc = DO_CRC4;
119 # else
120 		crc = DO_CRC8;
121 		q = *++b;
122 		crc ^= DO_CRC4;
123 # endif
124 	}
125 	len = rem_len;
126 	/* And the last few bytes */
127 	if (len) {
128 		const uint8_t *p = (const uint8_t *)(b + 1) - 1;
129 		do {
130 			DO_CRC(*++p); /* use pre increment for speed */
131 		} while (--len);
132 	}
133 	return crc;
134 #undef DO_CRC
135 #undef DO_CRC4
136 #undef DO_CRC8
137 }
138 #endif
139 
140 /**
141  * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32
142  * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for
143  *	other uses, or the previous crc32 value if computing incrementally.
144  * @p: pointer to buffer over which CRC is run
145  * @len: length of buffer @p
146  */
crc32_le_generic(uint32_t crc,unsigned char const * p,size_t len,const uint32_t (* tab)[256],uint32_t polynomial EXT2FS_ATTR ((unused)))147 static inline uint32_t crc32_le_generic(uint32_t crc, unsigned char const *p,
148 					size_t len, const uint32_t (*tab)[256],
149 					uint32_t polynomial EXT2FS_ATTR((unused)))
150 {
151 #if CRC_LE_BITS == 1
152 	int i;
153 	while (len--) {
154 		crc ^= *p++;
155 		for (i = 0; i < 8; i++)
156 			crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0);
157 	}
158 # elif CRC_LE_BITS == 2
159 	while (len--) {
160 		crc ^= *p++;
161 		crc = (crc >> 2) ^ tab[0][crc & 3];
162 		crc = (crc >> 2) ^ tab[0][crc & 3];
163 		crc = (crc >> 2) ^ tab[0][crc & 3];
164 		crc = (crc >> 2) ^ tab[0][crc & 3];
165 	}
166 # elif CRC_LE_BITS == 4
167 	while (len--) {
168 		crc ^= *p++;
169 		crc = (crc >> 4) ^ tab[0][crc & 15];
170 		crc = (crc >> 4) ^ tab[0][crc & 15];
171 	}
172 # elif CRC_LE_BITS == 8
173 	/* aka Sarwate algorithm */
174 	while (len--) {
175 		crc ^= *p++;
176 		crc = (crc >> 8) ^ tab[0][crc & 255];
177 	}
178 # else
179 	crc = __cpu_to_le32(crc);
180 	crc = crc32_body(crc, p, len, tab);
181 	crc = __le32_to_cpu(crc);
182 #endif
183 	return crc;
184 }
185 
ext2fs_crc32c_le(uint32_t crc,unsigned char const * p,size_t len)186 uint32_t ext2fs_crc32c_le(uint32_t crc, unsigned char const *p, size_t len)
187 {
188 	return crc32_le_generic(crc, p, len, crc32ctable_le, CRC32C_POLY_LE);
189 }
190 
191 /**
192  * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32
193  * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for
194  *	other uses, or the previous crc32 value if computing incrementally.
195  * @p: pointer to buffer over which CRC is run
196  * @len: length of buffer @p
197  */
crc32_be_generic(uint32_t crc,unsigned char const * p,size_t len,const uint32_t (* tab)[256],uint32_t polynomial EXT2FS_ATTR ((unused)))198 static inline uint32_t crc32_be_generic(uint32_t crc, unsigned char const *p,
199 					size_t len, const uint32_t (*tab)[256],
200 					uint32_t polynomial EXT2FS_ATTR((unused)))
201 {
202 #if CRC_BE_BITS == 1
203 	int i;
204 	while (len--) {
205 		crc ^= *p++ << 24;
206 		for (i = 0; i < 8; i++)
207 			crc =
208 			    (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
209 					  0);
210 	}
211 # elif CRC_BE_BITS == 2
212 	while (len--) {
213 		crc ^= *p++ << 24;
214 		crc = (crc << 2) ^ tab[0][crc >> 30];
215 		crc = (crc << 2) ^ tab[0][crc >> 30];
216 		crc = (crc << 2) ^ tab[0][crc >> 30];
217 		crc = (crc << 2) ^ tab[0][crc >> 30];
218 	}
219 # elif CRC_BE_BITS == 4
220 	while (len--) {
221 		crc ^= *p++ << 24;
222 		crc = (crc << 4) ^ tab[0][crc >> 28];
223 		crc = (crc << 4) ^ tab[0][crc >> 28];
224 	}
225 # elif CRC_BE_BITS == 8
226 	while (len--) {
227 		crc ^= *p++ << 24;
228 		crc = (crc << 8) ^ tab[0][crc >> 24];
229 	}
230 # else
231 	crc = __cpu_to_be32(crc);
232 	crc = crc32_body(crc, p, len, tab);
233 	crc = __be32_to_cpu(crc);
234 # endif
235 	return crc;
236 }
237 
ext2fs_crc32_be(uint32_t crc,unsigned char const * p,size_t len)238 uint32_t ext2fs_crc32_be(uint32_t crc, unsigned char const *p, size_t len)
239 {
240 	return crc32_be_generic(crc, p, len, crc32table_be, CRCPOLY_BE);
241 }
242 
243 #ifdef UNITTEST
244 static uint8_t test_buf[] = {
245 	0xd9, 0xd7, 0x6a, 0x13, 0x3a, 0xb1, 0x05, 0x48,
246 	0xda, 0xad, 0x14, 0xbd, 0x03, 0x3a, 0x58, 0x5e,
247 	0x6e, 0xd1, 0x56, 0xc9, 0x2e, 0xc4, 0xcb, 0x6b,
248 	0xe8, 0x77, 0x52, 0x37, 0x4e, 0x0f, 0x55, 0xd2,
249 	0x12, 0x65, 0x90, 0xc2, 0x41, 0x49, 0x81, 0x01,
250 	0xf5, 0x01, 0xeb, 0x2d, 0x78, 0x74, 0x23, 0x5d,
251 	0x84, 0x5c, 0x81, 0x92, 0x21, 0xe9, 0x8d, 0x1d,
252 	0x89, 0xf2, 0x4a, 0xac, 0xdd, 0xf9, 0xaf, 0xee,
253 	0x44, 0xe7, 0x6e, 0xed, 0xfb, 0xd8, 0x89, 0x0e,
254 	0x96, 0x62, 0xcd, 0xa4, 0x4b, 0xa9, 0xe5, 0x45,
255 	0xb1, 0x29, 0x9b, 0x0f, 0xfc, 0xbd, 0x83, 0xab,
256 	0xa8, 0x54, 0x96, 0x44, 0x2c, 0x7f, 0xbb, 0xe7,
257 	0x52, 0x29, 0x08, 0xee, 0x14, 0xc5, 0xc2, 0xec,
258 	0x5a, 0xeb, 0x40, 0x40, 0xea, 0xd1, 0x3d, 0x15,
259 	0x73, 0xaa, 0x8c, 0x73, 0xfc, 0xf2, 0x2b, 0x49,
260 	0x0b, 0x13, 0x96, 0xd9, 0x8e, 0x4b, 0xbc, 0xe0,
261 	0xf4, 0xd2, 0xe0, 0x2e, 0x7a, 0xf0, 0x5d, 0x1f,
262 	0xd2, 0x92, 0x97, 0xe0, 0xaa, 0x59, 0xab, 0xc9,
263 	0x5c, 0xa6, 0x51, 0x1a, 0xe3, 0xd6, 0x06, 0xb9,
264 	0xae, 0xb8, 0x76, 0x36, 0x79, 0x37, 0x52, 0xf6,
265 	0x34, 0xaf, 0x27, 0x19, 0xe1, 0xc0, 0x2b, 0xdd,
266 	0x01, 0x15, 0xcd, 0xce, 0x44, 0xf6, 0x4c, 0x18,
267 	0x92, 0x69, 0xbe, 0x8a, 0x76, 0x23, 0x52, 0x13,
268 	0x3f, 0xf9, 0xe0, 0xf5, 0x06, 0x28, 0x7c, 0xc7,
269 	0xf3, 0x42, 0x0f, 0xdd, 0x40, 0x33, 0xf7, 0x99,
270 	0xe2, 0xad, 0x26, 0xd9, 0x53, 0x10, 0x72, 0x0c,
271 	0x4e, 0x43, 0x4c, 0x61, 0xfe, 0xd9, 0xc1, 0x16,
272 	0xa1, 0x93, 0xca, 0x3c, 0x75, 0x7f, 0x07, 0x7a,
273 	0x65, 0xb3, 0x53, 0x2a, 0x52, 0x00, 0xa0, 0x62,
274 	0xe0, 0xa3, 0x1f, 0xad, 0xd7, 0xbb, 0xc0, 0x83,
275 	0x5d, 0x54, 0x87, 0x5f, 0xc8, 0x2f, 0xc8, 0xbf,
276 	0x69, 0x04, 0x91, 0xc8, 0xa6, 0x1d, 0x4d, 0x46,
277 	0x91, 0xfc, 0x26, 0xf4, 0x16, 0xd1, 0xa4, 0xbf,
278 	0x5c, 0xa2, 0x6c, 0xdd, 0xb4, 0x40, 0xf2, 0x2e,
279 	0xa2, 0xad, 0xf7, 0xf4, 0xa5, 0x8a, 0x3e, 0x23,
280 	0x64, 0x08, 0xc8, 0xa1, 0xa0, 0xf0, 0x5d, 0x70,
281 	0xd2, 0x77, 0xfd, 0xc8, 0x50, 0x83, 0x0f, 0xd6,
282 	0x2b, 0xe4, 0x1f, 0x52, 0x34, 0x33, 0x68, 0xfd,
283 	0x92, 0xbe, 0x9f, 0x97, 0x6b, 0x8d, 0x81, 0x91,
284 	0x0f, 0xef, 0x65, 0xc8, 0x0d, 0x15, 0x01, 0x77,
285 	0x58, 0xb2, 0xf4, 0x1b, 0x06, 0x7e, 0xf5, 0xca,
286 	0x15, 0x2e, 0x38, 0xd8, 0x81, 0x1c, 0x1c, 0xa0,
287 	0xb6, 0x13, 0x6a, 0x2b, 0x71, 0x34, 0x52, 0xd7,
288 	0x1d, 0xbd, 0x37, 0x59, 0xbc, 0x86, 0x25, 0x2b,
289 	0xa8, 0x93, 0xce, 0x1a, 0x03, 0x16, 0xfe, 0x01,
290 	0x57, 0x99, 0x24, 0x25, 0x2c, 0xb3, 0xab, 0x1e,
291 	0x2d, 0x65, 0x20, 0x89, 0x17, 0x02, 0x0e, 0x0a,
292 	0xf5, 0x1e, 0xc7, 0xff, 0x1f, 0x61, 0xa9, 0x54,
293 	0x18, 0xd4, 0xba, 0x50, 0x57, 0x02, 0xa1, 0xab,
294 	0x22, 0x2e, 0x07, 0xea, 0xa9, 0xa3, 0x83, 0x4f,
295 	0x27, 0xf5, 0xc5, 0xee, 0x3c, 0x3b, 0x10, 0xad,
296 	0x32, 0x2b, 0x1c, 0x03, 0xcb, 0xaf, 0x98, 0x83,
297 	0x54, 0xc3, 0x68, 0x63, 0xd4, 0xe0, 0x0e, 0x3c,
298 	0x1a, 0x4e, 0xc0, 0x81, 0xd0, 0xe8, 0x6a, 0x62,
299 	0x6b, 0x3e, 0x6f, 0xc4, 0xc6, 0x33, 0x4e, 0x26,
300 	0x21, 0xf5, 0x04, 0xdf, 0xfa, 0xce, 0x45, 0xaf,
301 	0xdc, 0x5e, 0x1b, 0xad, 0x93, 0xca, 0xf5, 0xcf,
302 	0xd7, 0xee, 0x0c, 0x5c, 0x5e, 0xb4, 0xf0, 0x92,
303 	0xd2, 0xf2, 0xf0, 0xa9, 0x1e, 0xab, 0x80, 0x68,
304 	0x46, 0xef, 0xcc, 0x26, 0x0c, 0x5c, 0xdd, 0x4e,
305 	0x83, 0xb8, 0xb9, 0x53, 0x6e, 0xf8, 0x93, 0x38,
306 	0x67, 0xa4, 0x41, 0x87, 0x72, 0xe7, 0x7e, 0x86,
307 	0xc9, 0x49, 0x00, 0x33, 0xb1, 0x38, 0x6c, 0x71,
308 	0xd7, 0x1d, 0x8e, 0x61, 0x01, 0xb6, 0x57, 0xa9,
309 	0xf1, 0xac, 0x15, 0xc2, 0x83, 0x77, 0xca, 0x64,
310 	0xca, 0x7b, 0x6c, 0xa1, 0x10, 0x1b, 0x13, 0xd0,
311 	0xd3, 0x9e, 0x9e, 0x10, 0x70, 0xc8, 0x1a, 0xbb,
312 	0x3f, 0x19, 0x86, 0xab, 0x01, 0x0e, 0xea, 0x34,
313 	0x22, 0xea, 0xe2, 0x15, 0xb7, 0xed, 0x21, 0x21,
314 	0x75, 0xa5, 0xe7, 0x08, 0xa1, 0x38, 0xe0, 0x91,
315 	0x05, 0x60, 0xea, 0xa7, 0x50, 0x27, 0x18, 0x07,
316 	0x9d, 0xe0, 0x18, 0x2b, 0xd4, 0x07, 0x59, 0x00,
317 	0xe6, 0x45, 0x18, 0x2a, 0x30, 0x6e, 0xf3, 0xb4,
318 	0xd0, 0xef, 0xa6, 0x5b, 0x71, 0xa2, 0x5a, 0x3b,
319 	0x89, 0x4c, 0xaf, 0x3f, 0xcb, 0x9f, 0x03, 0xfb,
320 	0x43, 0x7c, 0x6b, 0xd3, 0x6a, 0xea, 0xce, 0x4a,
321 	0x5f, 0x64, 0xb5, 0x62, 0xda, 0x5d, 0x27, 0xb7,
322 	0xb8, 0x11, 0xca, 0x33, 0x30, 0xec, 0x70, 0xf0,
323 	0x1b, 0x03, 0x50, 0xff, 0x5e, 0xa6, 0x08, 0xde,
324 	0x37, 0x70, 0xc0, 0x81, 0x55, 0x60, 0x17, 0xa1,
325 	0x85, 0xae, 0x26, 0x44, 0xe4, 0x67, 0x3c, 0x91,
326 	0xfd, 0xc4, 0x3d, 0x97, 0x72, 0x23, 0xf3, 0x3c,
327 	0x8f, 0xe0, 0xe2, 0xf2, 0x09, 0x96, 0x10, 0x67,
328 	0xb5, 0xfe, 0xff, 0x3d, 0x4a, 0xc8, 0x62, 0x11,
329 	0xa5, 0x98, 0xc1, 0x2d, 0x40, 0x82, 0x88, 0x8b,
330 	0xe5, 0xb0, 0x75, 0xbf, 0x2f, 0xa8, 0x6a, 0x55,
331 	0x49, 0x2e, 0x9c, 0x29, 0xd2, 0x7c, 0xbf, 0xf3,
332 	0xaa, 0x3a, 0x16, 0x4a, 0xa4, 0x15, 0xf3, 0x48,
333 	0xde, 0x38, 0x13, 0x44, 0x26, 0x02, 0xe6, 0xe9,
334 	0xa8, 0x24, 0x89, 0xb5, 0x43, 0x95, 0xe4, 0x4c,
335 	0xc3, 0xa0, 0xdf, 0xcc, 0x42, 0xf8, 0x8d, 0xb0,
336 	0x3b, 0xea, 0x10, 0xb7, 0xe1, 0x40, 0x54, 0xb9,
337 	0xa3, 0x2d, 0xfb, 0xb4, 0x91, 0xc0, 0x3e, 0x94,
338 	0xf1, 0xa1, 0x3c, 0xbe, 0xef, 0xb8, 0x70, 0x55,
339 	0x0a, 0x26, 0x93, 0xbf, 0xe6, 0x21, 0x92, 0x32,
340 	0x3c, 0x39, 0x27, 0x6a, 0x23, 0x48, 0x02, 0x35,
341 	0x3c, 0xd4, 0xcc, 0x04, 0xc0, 0x4e, 0xa7, 0x02,
342 	0x63, 0x37, 0xc2, 0xb8, 0x56, 0x1d, 0x57, 0x57,
343 	0x42, 0x04, 0x8d, 0xee, 0xcf, 0x8b, 0xc9, 0xc3,
344 	0xba, 0x3b, 0x15, 0xd7, 0xaf, 0xbf, 0x9e, 0xcd,
345 	0x44, 0xcf, 0xf0, 0x00, 0xb7, 0x3a, 0xfc, 0xa8,
346 	0x12, 0xab, 0x3a, 0x62, 0x01, 0x21, 0x46, 0xe9,
347 	0x1e, 0x48, 0x37, 0xfc, 0x13, 0x4d, 0xf6, 0x2a,
348 	0x72, 0x40, 0x75, 0x38, 0x71, 0xf2, 0x17, 0x20,
349 	0x2c, 0xdd, 0xc0, 0x49, 0xbc, 0x63, 0x33, 0xea,
350 	0x06, 0x75, 0x41, 0xe7, 0x5c, 0x1f, 0xfb, 0xf9,
351 	0x68, 0x83, 0xc2, 0x5a, 0x4a, 0x1e, 0x61, 0x08,
352 	0x57, 0xf3, 0x00, 0xba, 0x77, 0x92, 0x63, 0xa5,
353 	0xb7, 0xfe, 0x97, 0x22, 0xda, 0x5e, 0xd3, 0xaf,
354 	0xbc, 0x89, 0x0d, 0x4c, 0x37, 0xa9, 0x27, 0x4a,
355 	0x7f, 0xdb, 0x81, 0x39, 0x11, 0x86, 0x12, 0xf9,
356 	0x10, 0x50, 0xe4, 0xdb, 0x72, 0xf9, 0xae, 0x10,
357 	0x7c, 0xed, 0x50, 0x5c, 0x61, 0xeb, 0x42, 0x1e,
358 	0xa4, 0xf4, 0xf0, 0xfa, 0x45, 0x4d, 0x95, 0x2b,
359 	0xd4, 0x67, 0x4a, 0xe3, 0x8a, 0x15, 0x55, 0x92,
360 	0x77, 0x64, 0x8c, 0x51, 0x38, 0xf9, 0x26, 0x3e,
361 	0x68, 0xe2, 0xac, 0xbb, 0x64, 0x77, 0xe2, 0x82,
362 	0xa4, 0x42, 0x41, 0x38, 0xa0, 0xf0, 0xc9, 0xd8,
363 	0x6c, 0xe0, 0xef, 0x4c, 0xda, 0xb4, 0x92, 0xef,
364 	0x1b, 0xe3, 0x9b, 0xc1, 0x44, 0x3c, 0xb9, 0xb7,
365 	0x39, 0xac, 0x5c, 0x32, 0x39, 0xb4, 0x21, 0x85,
366 	0x93, 0xbc, 0xf2, 0x51, 0x43, 0xb7, 0xae, 0x1e,
367 	0x61, 0x9c, 0x38, 0x9c, 0xaa, 0xff, 0xde, 0xfc,
368 	0xbf, 0x85, 0xef, 0x17, 0x34, 0x36, 0x71, 0x5f,
369 	0x04, 0x16, 0xa6, 0x9e, 0xfd, 0x3a, 0x03, 0xd8,
370 	0xbf, 0x71, 0x70, 0x20, 0x8f, 0x7c, 0xfb, 0xff,
371 	0x61, 0xe0, 0xe2, 0x60, 0xa7, 0xb1, 0xc0, 0xe0,
372 	0xd9, 0x3f, 0xdc, 0x8d, 0x4a, 0xa4, 0x52, 0x61,
373 	0xaf, 0x9d, 0xdf, 0x8a, 0x0d, 0x41, 0xc0, 0x25,
374 	0x68, 0x12, 0x7b, 0xd5, 0xc7, 0xdb, 0x68, 0x70,
375 	0x2d, 0x7d, 0x95, 0x12, 0x03, 0x23, 0x0c, 0xe8,
376 	0x14, 0x41, 0x11, 0x28, 0xec, 0x9d, 0xd3, 0x28,
377 	0x77, 0x7a, 0x3c, 0x93, 0x8e, 0x5c, 0x7e, 0xb3,
378 	0x42, 0x9a, 0x18, 0x25, 0x93, 0xc8, 0xea, 0x43,
379 	0x1b, 0xbe, 0xd5, 0x27, 0xf1, 0xd4, 0xe0, 0x1e,
380 	0xce, 0xc7, 0xc7, 0x2c, 0x25, 0x35, 0x58, 0xb8,
381 	0x6c, 0xf3, 0xa2, 0xad, 0xe7, 0x58, 0x49, 0x47,
382 	0xf7, 0xca, 0xde, 0x8b, 0x81, 0xb7, 0x75, 0xf4,
383 	0x95, 0xa7, 0x5c, 0xc3, 0x2c, 0x0e, 0x1c, 0x52,
384 	0x9a, 0xc3, 0x2a, 0x00, 0x21, 0xa7, 0x51, 0x6b,
385 	0xf0, 0x05, 0x87, 0x8c, 0x42, 0x1b, 0xc3, 0x2e,
386 	0xa3, 0x76, 0x22, 0xd5, 0x7f, 0x56, 0x10, 0xef,
387 	0x98, 0x85, 0x65, 0x86, 0x71, 0x87, 0xd2, 0x8c,
388 	0xc0, 0x47, 0x20, 0xe8, 0xb5, 0x1c, 0xe3, 0xdd,
389 	0x3c, 0x5c, 0x03, 0xbb, 0x0e, 0x97, 0x3b, 0xe1,
390 	0x56, 0x9a, 0xd5, 0x0a, 0x63, 0xd5, 0x33, 0xaf,
391 	0x36, 0xca, 0xcf, 0x8f, 0x00, 0x28, 0xa3, 0x45,
392 	0xb8, 0xcd, 0xde, 0x73, 0xd4, 0xfa, 0x2d, 0x6f,
393 	0xdb, 0x93, 0xaa, 0xdd, 0x7f, 0xd2, 0x22, 0x9c,
394 	0x96, 0x48, 0x1e, 0xa8, 0x63, 0xbe, 0xbc, 0x0d,
395 	0x14, 0x3c, 0x2e, 0x11, 0x1f, 0xd2, 0xf4, 0x57,
396 	0xb3, 0x47, 0xf8, 0xa6, 0x1b, 0xc3, 0xa7, 0x95,
397 	0x2d, 0xd4, 0xca, 0xb8, 0x0d, 0xfb, 0x06, 0x85,
398 	0xda, 0x63, 0xf0, 0x3e, 0x9d, 0x5e, 0xee, 0xce,
399 	0xed, 0x74, 0x1d, 0x2c, 0x97, 0x3f, 0x71, 0x95,
400 	0x12, 0x03, 0xc5, 0x92, 0x46, 0x84, 0x1b, 0x07,
401 	0xe6, 0xb4, 0x1d, 0x3a, 0xf1, 0x89, 0x90, 0x50,
402 	0x10, 0x29, 0x34, 0xc0, 0x90, 0xbe, 0x4a, 0xa9,
403 	0x0d, 0xb0, 0x7b, 0xfb, 0x35, 0xee, 0x4e, 0x34,
404 	0xec, 0x5a, 0x58, 0xbc, 0xb8, 0xda, 0x38, 0x88,
405 	0x8c, 0x74, 0x1e, 0xc9, 0xab, 0x78, 0x2e, 0x2a,
406 	0x17, 0x8a, 0x43, 0x3d, 0xa1, 0x2a, 0x41, 0xb5,
407 	0xd6, 0xe8, 0x5b, 0xc5, 0x4a, 0x1c, 0x3c, 0x9f,
408 	0x8d, 0x3a, 0x69, 0x88, 0xf8, 0x80, 0xd2, 0x11,
409 	0xfc, 0x7e, 0x80, 0x8e, 0x7f, 0x85, 0x64, 0x9c,
410 	0x46, 0x58, 0xc8, 0x48, 0x98, 0x4b, 0xf5, 0x73,
411 	0x3f, 0x49, 0xce, 0x53, 0x2c, 0xd5, 0xfc, 0x33,
412 	0xf1, 0x6f, 0xd8, 0xe9, 0x2e, 0x70, 0x2e, 0xdc,
413 	0xe5, 0x43, 0x80, 0x38, 0xf2, 0x87, 0xed, 0x85,
414 	0xe4, 0x3e, 0x45, 0x14, 0x20, 0xcf, 0xa0, 0x61,
415 	0x4f, 0xe8, 0xd7, 0x5b, 0xb3, 0x0d, 0x0e, 0x4e,
416 	0x4d, 0xce, 0xbe, 0xba, 0xaa, 0x90, 0x09, 0xcb,
417 	0x4b, 0x5d, 0x08, 0xff, 0x52, 0xd5, 0x23, 0xbc,
418 	0xad, 0x8d, 0xd3, 0x06, 0x4a, 0xa0, 0x51, 0x56,
419 	0xa7, 0xd8, 0x33, 0xab, 0xbc, 0xd0, 0xdf, 0x92,
420 	0x87, 0x20, 0x2d, 0x7b, 0x5e, 0xfa, 0x30, 0xa7,
421 	0x06, 0x06, 0xe5, 0x4f, 0x2c, 0xb5, 0x61, 0xd7,
422 	0x54, 0xd3, 0xdf, 0xd0, 0x0a, 0xb0, 0x06, 0xce,
423 	0xf6, 0x86, 0xb7, 0x8e, 0xaa, 0x7b, 0x78, 0xd5,
424 	0xb9, 0xeb, 0x07, 0xac, 0x5f, 0xc5, 0xd2, 0x8c,
425 	0x40, 0xe0, 0x7f, 0x98, 0xd4, 0xe5, 0x4b, 0xca,
426 	0xfb, 0x47, 0xef, 0xef, 0xb9, 0x4d, 0x6d, 0x8f,
427 	0x82, 0x68, 0x74, 0x84, 0xe0, 0x0a, 0x93, 0x0f,
428 	0xb2, 0x01, 0xa9, 0x9f, 0x68, 0x6a, 0xe8, 0xf7,
429 	0xfb, 0x0b, 0xde, 0x17, 0xe0, 0x30, 0x38, 0x51,
430 	0xbc, 0x07, 0xb8, 0x2c, 0x91, 0x0f, 0xc1, 0x0e,
431 	0xa6, 0xf9, 0xf0, 0xd5, 0x48, 0x76, 0x8a, 0xde,
432 	0x74, 0xe3, 0x30, 0x65, 0x56, 0xb3, 0x5c, 0xe2,
433 	0x89, 0x8d, 0xda, 0x80, 0xad, 0x0f, 0x22, 0xfb,
434 	0x24, 0x1d, 0x16, 0xdd, 0x34, 0x4b, 0x90, 0x58,
435 	0x4e, 0x0c, 0x13, 0x28, 0xcf, 0x1d, 0xa4, 0xaa,
436 	0xb7, 0xf3, 0xb1, 0x66, 0xad, 0x3b, 0xcf, 0x79,
437 	0x12, 0x04, 0xd7, 0x79, 0xd9, 0x5f, 0xdf, 0x89,
438 	0xb2, 0x5b, 0xa7, 0x9a, 0x26, 0x1e, 0x67, 0x46,
439 	0x7c, 0x66, 0x95, 0x67, 0xe6, 0x45, 0x8b, 0x1f,
440 	0x65, 0x79, 0x9f, 0x6d, 0x11, 0x81, 0x17, 0x0d,
441 	0x11, 0xb0, 0x5c, 0xb4, 0xc7, 0x27, 0x87, 0xab,
442 	0x5d, 0x0a, 0x18, 0xae, 0x4e, 0x06, 0xa3, 0x3d,
443 	0xc7, 0xb0, 0x22, 0xba, 0x03, 0xa4, 0x0f, 0xe5,
444 	0x1c, 0x72, 0x2a, 0x04, 0xce, 0x83, 0xe9, 0xf3,
445 	0xd7, 0xc9, 0x67, 0x6c, 0x1e, 0x6b, 0x3c, 0x9b,
446 	0x0b, 0x5e, 0x6a, 0xa6, 0x79, 0x0a, 0xf1, 0xbe,
447 	0xd7, 0xb4, 0x6f, 0x45, 0x1e, 0xfb, 0x78, 0x97,
448 	0xaf, 0x34, 0x76, 0x95, 0x52, 0xf7, 0x3d, 0x5d,
449 	0x07, 0x28, 0x57, 0x9c, 0x4a, 0x0f, 0xcf, 0x0b,
450 	0x1b, 0xc4, 0xc2, 0x72, 0xd7, 0x72, 0x38, 0x9b,
451 	0xea, 0xeb, 0xee, 0xae, 0x34, 0xc8, 0x01, 0xd7,
452 	0xa5, 0xe3, 0xce, 0x41, 0xad, 0x02, 0x60, 0x23,
453 	0x18, 0x36, 0xba, 0x17, 0xfa, 0xcf, 0xe4, 0xda,
454 	0xdc, 0xfc, 0x82, 0xdc, 0x7c, 0x11, 0xf4, 0xb8,
455 	0x52, 0x5d, 0xf7, 0x2f, 0xc8, 0xfe, 0x4a, 0xe6,
456 	0xb9, 0xaf, 0x4b, 0x17, 0x18, 0x91, 0xc2, 0xfe,
457 	0xd7, 0x3a, 0x77, 0x0c, 0xa0, 0x43, 0x9c, 0x6f,
458 	0x13, 0x06, 0xbe, 0x6e, 0xe0, 0x1a, 0x3c, 0xf3,
459 	0xf5, 0xcc, 0x78, 0xfb, 0x5d, 0xd5, 0xda, 0xb7,
460 	0x58, 0xea, 0x86, 0x42, 0x6b, 0x32, 0xff, 0xb2,
461 	0xe2, 0xee, 0x03, 0x1f, 0xf4, 0xef, 0xdb, 0x53,
462 	0x79, 0xd5, 0x4e, 0xaf, 0x60, 0x8e, 0x02, 0xc2,
463 	0xcc, 0x39, 0x97, 0x7b, 0xfd, 0xa1, 0xf8, 0x7a,
464 	0x26, 0xe8, 0x55, 0xd6, 0xa4, 0x8b, 0xa0, 0x1b,
465 	0x2d, 0x63, 0xaa, 0x73, 0x71, 0x6e, 0xbf, 0x8b,
466 	0x3b, 0xe3, 0x1b, 0x0d, 0xbb, 0x2e, 0x44, 0x09,
467 	0x64, 0xac, 0xc7, 0x9e, 0xb5, 0xc6, 0x77, 0xb0,
468 	0x79, 0xb3, 0xaa, 0xfc, 0x67, 0x57, 0x9a, 0x50,
469 	0x81, 0x37, 0x14, 0x7c, 0xd7, 0xa0, 0xd4, 0x6a,
470 	0x79, 0x84, 0x51, 0x0e, 0x95, 0x0a, 0x30, 0xa3,
471 	0x60, 0x55, 0x48, 0x05, 0x16, 0xae, 0x43, 0x90,
472 	0xdc, 0x8e, 0x09, 0xbe, 0x79, 0xf6, 0x90, 0x74,
473 	0xf8, 0x20, 0x96, 0x4d, 0xa7, 0xf5, 0x1a, 0x2b,
474 	0xc7, 0x15, 0x9d, 0x18, 0xf7, 0x94, 0x87, 0xf7,
475 	0xf4, 0xfb, 0x0d, 0x61, 0xb6, 0xd7, 0xbe, 0x10,
476 	0x8e, 0x47, 0x3c, 0x10, 0x44, 0x90, 0x52, 0x21,
477 	0x83, 0xc0, 0xf5, 0x99, 0xaa, 0xbc, 0xf6, 0x55,
478 	0xae, 0xf5, 0xb2, 0xa4, 0xcd, 0x4d, 0xb9, 0x38,
479 	0x6c, 0xbc, 0x80, 0xc3, 0xad, 0xf4, 0x46, 0x31,
480 	0x01, 0x58, 0x2d, 0x88, 0x57, 0xc3, 0x23, 0xd1,
481 	0x64, 0xc9, 0xa3, 0x21, 0x6b, 0x8b, 0x8a, 0x23,
482 	0x2c, 0x4f, 0xa9, 0xcd, 0x67, 0xfa, 0x77, 0xad,
483 	0xa3, 0x16, 0xa2, 0xe5, 0x19, 0x14, 0x70, 0x41,
484 	0x5b, 0xda, 0x14, 0xde, 0xe3, 0xe5, 0xc1, 0x15,
485 	0xb4, 0x77, 0xa4, 0x9b, 0xb8, 0xb1, 0x28, 0x51,
486 	0x30, 0xb4, 0xf1, 0xf3, 0xf8, 0x6d, 0xd0, 0xc3,
487 	0x8c, 0x4c, 0x76, 0xb0, 0x9a, 0xdf, 0xc8, 0xbe,
488 	0xf8, 0x4a, 0x61, 0x6e, 0x3e, 0xd6, 0x3c, 0xe8,
489 	0xde, 0x56, 0xa0, 0x9c, 0x25, 0xbe, 0xce, 0x93,
490 	0x1f, 0x88, 0xfb, 0x9a, 0x1a, 0xe2, 0xff, 0x88,
491 	0xad, 0x10, 0xcb, 0x6c, 0xd6, 0xe7, 0x39, 0x0b,
492 	0xe5, 0x1a, 0x06, 0x05, 0x64, 0x5b, 0x0a, 0xdf,
493 	0x22, 0x58, 0xd7, 0xfb, 0x88, 0x12, 0xdd, 0xb7,
494 	0x52, 0x3a, 0xc9, 0xbf, 0x49, 0xdf, 0x8c, 0x87,
495 	0x9f, 0x84, 0xb5, 0x0a, 0xf6, 0x00, 0x52, 0xae,
496 	0x67, 0x12, 0x1a, 0x8c, 0x71, 0x15, 0xf5, 0xa1,
497 	0x13, 0x39, 0xf0, 0x91, 0x7e, 0x88, 0x7c, 0xb3,
498 	0x95, 0x50, 0x02, 0xa6, 0x63, 0xb5, 0x64, 0xfb,
499 	0x90, 0x87, 0x61, 0xe2, 0x27, 0xaf, 0x11, 0x0c,
500 	0x73, 0x83, 0xef, 0xa9, 0x28, 0xfe, 0xc8, 0x85,
501 	0x1a, 0x3a, 0xde, 0xf2, 0xe5, 0x25, 0x64, 0x6d,
502 	0xaa, 0x41, 0x4c, 0x80, 0x2e, 0x84, 0xff, 0xc1,
503 	0xc0, 0x54, 0x0c, 0x29, 0x1b, 0xa3, 0x07, 0x7c,
504 	0x33, 0x4c, 0x10, 0xf6, 0x6f, 0x79, 0xdf, 0xd3,
505 	0xf0, 0x24, 0x57, 0xf1, 0x60, 0xe1, 0xf0, 0xbd,
506 	0xc4, 0x1f, 0xf4, 0x67, 0xd2, 0xd3, 0xcc, 0x6a,
507 	0x07, 0x72, 0x44, 0x16, 0x85, 0x46, 0xd0, 0x73,
508 	0x87, 0xa9, 0xc7, 0x2f, 0xd1, 0xf5, 0xec, 0xe3,
509 	0x28, 0xa3, 0x93, 0x4f, 0xd7, 0x76, 0xc1, 0x3c,
510 	0x0d, 0x13, 0x33, 0xcf, 0x5b, 0xbd, 0x6a, 0x52,
511 	0x4e, 0xee, 0xc8, 0x5e, 0xa1, 0x58, 0x4a, 0x08,
512 	0x81, 0xd9, 0x23, 0xcc, 0xfb, 0x1c, 0xb2, 0xd8,
513 	0xa3, 0xe4, 0x53, 0xfe, 0xf4, 0x4b, 0x48, 0xc1,
514 	0x20, 0xa4, 0x97, 0xf8, 0x38, 0xa3, 0x69, 0xc1,
515 	0x11, 0xf0, 0xa1, 0x3b, 0xa9, 0x9a, 0x12, 0x61,
516 	0xe8, 0x8d, 0x99, 0x44, 0x3f, 0x94, 0x72, 0x82,
517 	0x19, 0x96, 0x62, 0xb0, 0xa6, 0x64, 0x05, 0x19,
518 	0x8f, 0xd6, 0x5d, 0x05, 0xbf, 0x79, 0x9e, 0x9d,
519 	0xe4, 0x93, 0x4c, 0xad, 0x61, 0x8c, 0x18, 0xda,
520 	0xb6, 0x2e, 0xb3, 0xca, 0x14, 0x4d, 0x53, 0xa4,
521 	0x97, 0x27, 0x10, 0x56, 0xa2, 0x67, 0x5a, 0x5a,
522 	0x5e, 0x13, 0xc0, 0xdb, 0xa7, 0x9f, 0x45, 0x5b,
523 	0xeb, 0x1a, 0x14, 0x0c, 0x8c, 0x38, 0x5e, 0x77,
524 	0x9a, 0xec, 0x75, 0x68, 0x93, 0x65, 0x02, 0x9c,
525 	0xfb, 0x62, 0x60, 0x49, 0xdd, 0xb2, 0x2a, 0x67,
526 	0x86, 0xe3, 0x8a, 0x7d, 0x8c, 0x46, 0x78, 0x81,
527 	0x60, 0x69, 0xf2, 0x3f, 0x74, 0x11, 0x35, 0xff,
528 	0x77, 0xa3, 0x66, 0x20, 0xfc, 0x98, 0x4a, 0x35,
529 	0x7a, 0x52, 0xe4, 0x90, 0x13, 0x80, 0xb9, 0xa6,
530 	0x73, 0x7a, 0x7d, 0x66, 0x6e, 0x6b, 0xb6, 0x43,
531 	0x10, 0xd5, 0x91, 0x2b, 0x66, 0xdd, 0x89, 0x87,
532 	0xe3, 0x8c, 0x58, 0x53, 0x2f, 0x40, 0x74, 0x45,
533 	0x1b, 0x77, 0x7a, 0xa4, 0x44, 0x19, 0x78, 0xba,
534 	0x87, 0x10, 0x41, 0x31, 0x32, 0x5f, 0x87, 0x68,
535 	0xde, 0x43, 0x4a, 0xef, 0x33, 0xb3, 0x11, 0x83,
536 	0xa9, 0xc2, 0x6f, 0x8d, 0x34, 0xe2, 0x95, 0x84,
537 	0x3a, 0x4f, 0x6f, 0x8c, 0x31, 0x1d, 0xb6, 0xf5,
538 	0x95, 0x0d, 0x01, 0x11, 0x20, 0xdf, 0x72, 0xf3,
539 	0x3f, 0x9a, 0x33, 0xaa, 0xb1, 0x06, 0x6a, 0x63,
540 	0x47, 0x91, 0x01, 0xdf, 0xb3, 0x54, 0x36, 0xfd,
541 	0x06, 0x2d, 0xb8, 0x08, 0xe3, 0xd3, 0x65, 0xac,
542 	0x66, 0x03, 0xee, 0xa4, 0x63, 0xbd, 0xd4, 0xce,
543 	0xbd, 0x79, 0xa7, 0x48, 0x38, 0xc5, 0x7d, 0xb5,
544 	0x71, 0x9a, 0x3c, 0x11, 0x7c, 0x6c, 0xe2, 0x54,
545 	0x02, 0x5d, 0x42, 0xab, 0x25, 0x93, 0x66, 0x01,
546 	0x37, 0x78, 0x35, 0x4a, 0x8c, 0x19, 0x4d, 0x00,
547 	0x75, 0x4f, 0xcc, 0xc0, 0x26, 0x82, 0xc1, 0x35,
548 	0x8c, 0xc7, 0xc2, 0x59, 0x01, 0x3e, 0x98, 0x22,
549 	0x88, 0x9c, 0x90, 0x75, 0x05, 0x33, 0x07, 0xb9,
550 	0x39, 0x81, 0x38, 0x58, 0x10, 0x29, 0xcf, 0xc8,
551 	0x98, 0xb2, 0x03, 0xd7, 0x5b, 0xb3, 0x18, 0xba,
552 	0x34, 0x0c, 0x9f, 0xab, 0xd7, 0xed, 0x29, 0x82,
553 	0x41, 0xe0, 0x20, 0x97, 0x57, 0x92, 0xb2, 0xb8,
554 	0x10, 0x2d, 0x0b, 0xa2, 0xc5, 0x8f, 0x90, 0x6f,
555 	0xed, 0x12, 0x56, 0x25, 0xbe, 0xfd, 0x75, 0xf7,
556 	0xb6, 0xf8, 0x40, 0x67, 0x39, 0x11, 0xfa, 0x15,
557 	0xae, 0x6a, 0x54, 0x5f, 0x32, 0x2b, 0xf8, 0x48,
558 	0x55, 0xbe, 0x86, 0x2f, 0x69, 0x48, 0x5b, 0x5d,
559 	0x4d, 0xb7, 0x35, 0xaa, 0xb6, 0x91, 0x88, 0x19,
560 	0x96, 0x1c, 0x68, 0xf6, 0x85, 0x9e, 0xb3, 0xb2,
561 	0xa3, 0x32, 0xd4, 0x52, 0x70, 0xb7, 0x62, 0xe3,
562 	0x14, 0xb6, 0x78, 0x5f, 0x1b, 0x1d, 0x04, 0x9c,
563 	0x26, 0x0c, 0x33, 0x94, 0xb1, 0x97, 0x08, 0xdb,
564 	0x0b, 0x39, 0x29, 0xd4, 0xbc, 0x6d, 0xdf, 0x02,
565 	0xc6, 0x99, 0xab, 0x99, 0x32, 0xe5, 0xce, 0x51,
566 	0x4f, 0xae, 0xb8, 0x8b, 0xe0, 0xaf, 0x07, 0xc4,
567 	0xf9, 0x41, 0x7c, 0x59, 0xa0, 0xac, 0x74, 0x4d,
568 	0x7e, 0x43, 0x77, 0x9c, 0x06, 0x49, 0x79, 0x8a,
569 	0x14, 0x73, 0x93, 0xa8, 0x5b, 0x1b, 0x34, 0x29,
570 	0x78, 0x04, 0x2f, 0xd7, 0x1f, 0x13, 0x90, 0xe0,
571 	0xdd, 0x3b, 0x42, 0x6b, 0x79, 0x6e, 0x52, 0xc7,
572 	0x0f, 0x38, 0xda, 0x01, 0x2c, 0x8d, 0xe6, 0x94,
573 	0x5d, 0x59, 0x27, 0x1d, 0x10, 0x4e, 0x11, 0x36,
574 	0xfb, 0x53, 0x16, 0x05, 0x25, 0xf2, 0x64, 0xd8,
575 	0xf9, 0xcd, 0x5c, 0xfe, 0xb4, 0x18, 0x44, 0x80,
576 	0x10, 0xbc, 0x3d, 0xf3, 0x1d, 0x5a, 0xf0, 0xc1,
577 	0xc3, 0x55, 0xff, 0x41, 0x3e, 0xe3, 0xef, 0x44,
578 	0xb2, 0xc0, 0x01, 0x18, 0xa2, 0x49, 0x88, 0x78,
579 	0x0d, 0x4c, 0xc8, 0x73, 0xcf, 0x30, 0x85, 0x3a,
580 	0x88, 0x90, 0x01, 0xcf, 0x69, 0x53, 0xa3, 0x18,
581 	0x3f, 0xd6, 0xe7, 0x94, 0x14, 0xa7, 0xae, 0xcd,
582 	0x6f, 0x11, 0x72, 0xfe, 0x2b, 0xb0, 0x81, 0x53,
583 	0xea, 0x67, 0xd6, 0xe4, 0xca, 0x42, 0xa0, 0xf9,
584 	0xb1, 0xd4, 0xb5, 0x3b, 0xc9, 0xf0, 0x36, 0xc1,
585 	0x1c, 0xf4, 0xb1, 0xf6, 0x84, 0xd0, 0x86, 0x6c,
586 	0x76, 0x9a, 0x03, 0xc2, 0xb6, 0x2e, 0x9a, 0x46,
587 	0xf5, 0x5f, 0x2c, 0x38, 0xac, 0xad, 0x6f, 0x2e,
588 	0x7a, 0x18, 0x2d, 0x22, 0x95, 0x5e, 0x5e, 0xc9,
589 	0x7a, 0x0a, 0x56, 0xe1, 0xc7, 0x15, 0xfd, 0xbf,
590 	0xff, 0xf7, 0x7e, 0x85, 0x20, 0xa9, 0x8a, 0x9c,
591 	0xa9, 0x7d, 0xe8, 0xed, 0xfc, 0x7f, 0xbb, 0xf0,
592 	0x05, 0x3f, 0xce, 0x4f, 0x4c, 0xee, 0xa4, 0xa0,
593 	0xcc, 0x9c, 0x62, 0x1e, 0xd6, 0xd0, 0x30, 0x37,
594 	0xb8, 0x98, 0x56, 0x1d, 0xaa, 0xd6, 0x5e, 0x73,
595 	0x12, 0xe4, 0x88, 0x82, 0x48, 0x64, 0x06, 0xd7,
596 	0x2a, 0x31, 0x50, 0x7b, 0x10, 0x17, 0xb8, 0x4c,
597 	0x5a, 0x8d, 0xf1, 0xfc, 0xf1, 0x33, 0x3b, 0x98,
598 	0x42, 0x18, 0x5b, 0x35, 0x78, 0xca, 0x8e, 0x41,
599 	0x52, 0xae, 0x6d, 0xe1, 0xa2, 0x9d, 0x5b, 0xbd,
600 	0xf3, 0x5f, 0x49, 0xc1, 0x27, 0x06, 0xc1, 0xaf,
601 	0xc0, 0xa3, 0x9d, 0xf3, 0x1c, 0x8e, 0x90, 0x8a,
602 	0xb0, 0x69, 0xb0, 0xc5, 0x11, 0x0c, 0x91, 0x14,
603 	0x1f, 0x5e, 0x10, 0xe1, 0x1d, 0x14, 0x30, 0x54,
604 	0x1e, 0x17, 0x3d, 0x31, 0x7b, 0xbf, 0x2f, 0x9d,
605 	0x6d, 0x63, 0x32, 0xf0, 0x9d, 0x9f, 0x95, 0x3d,
606 	0x0b, 0xd2, 0x4d, 0x10, 0xe2, 0x3f, 0x67, 0x69,
607 	0x43, 0x9a, 0x4a, 0x2c, 0x54, 0x71, 0xa8, 0xa0,
608 	0x9e, 0x9f, 0x10, 0xaf, 0x1b, 0xce, 0x99, 0xe3,
609 	0x25, 0x32, 0x10, 0x54, 0x80, 0xfe, 0xda, 0x57,
610 	0xd0, 0xb2, 0x92, 0x7f, 0xbb, 0x5f, 0xe7, 0x4d,
611 	0x1b, 0x3d, 0x46, 0x4d, 0xe4, 0x4c, 0xd6, 0xaf,
612 	0x1a, 0x32, 0x12, 0x40, 0xb8, 0x84, 0x8e, 0xe4,
613 	0x80, 0xce, 0x7e, 0xc1, 0x13, 0x8b, 0xb0, 0xb7,
614 	0x6f, 0x24, 0xba, 0x85, 0x50, 0x83, 0xc3, 0xcf,
615 	0x19, 0xb3, 0xf0, 0xc7, 0xee, 0x68, 0xbe, 0x9e,
616 	0x6d, 0xb9, 0xfb, 0xd5, 0x29, 0xce, 0x82, 0xcd,
617 	0x69, 0x16, 0x68, 0x6b, 0x6a, 0xf4, 0x02, 0x32,
618 	0xce, 0x60, 0x37, 0x0c, 0xb9, 0x38, 0x92, 0x9c,
619 	0x42, 0xa9, 0x0b, 0x53, 0x96, 0xfe, 0x39, 0xc1,
620 	0x24, 0x65, 0x9b, 0xcd, 0xe7, 0x8d, 0x36, 0x07,
621 	0x9f, 0x1d, 0x35, 0x8e, 0xdc, 0x4c, 0xb5, 0x68,
622 	0xc5, 0xfd, 0x44, 0x19, 0xf2, 0x6c, 0x59, 0x1c,
623 	0xb1, 0x0b, 0x35, 0x48, 0x86, 0x1a, 0x05, 0x22,
624 	0x03, 0x0c, 0x0c, 0xa2, 0x92, 0x90, 0x35, 0xfb,
625 	0x37, 0x94, 0xc7, 0x15, 0x84, 0xae, 0xe8, 0x05,
626 	0xa0, 0xf7, 0x30, 0x11, 0x5c, 0xe4, 0x5d, 0x3e,
627 	0x12, 0x54, 0x80, 0x54, 0x6b, 0x09, 0x8c, 0xce,
628 	0x80, 0x5e, 0xa7, 0xc8, 0x6a, 0x0c, 0x56, 0xe1,
629 	0x18, 0x7d, 0xc9, 0x39, 0xc1, 0xef, 0xe3, 0x25,
630 	0xa0, 0x8b, 0x2f, 0x60, 0x3a, 0x43, 0x39, 0xa6,
631 	0x28, 0x28, 0x7b, 0x4c, 0x77, 0xd4, 0x49, 0x61,
632 	0x46, 0xe9, 0x1b, 0x45, 0xd6, 0xb1, 0x56, 0xe1,
633 	0x7d, 0x34, 0xcd, 0x06, 0xb6, 0x67, 0x8d, 0x7d,
634 	0x7a, 0xe2, 0xbe, 0x68, 0x35, 0xa6, 0x78, 0xe5,
635 	0x47, 0x48, 0xb7, 0xc7, 0xde, 0xcd, 0xc9, 0x05,
636 	0xb4, 0xe7, 0x50, 0x48, 0xe1, 0x4b, 0xfe, 0x76,
637 	0x77, 0xc6, 0xf7, 0x5f, 0xcb, 0xc2, 0xa8, 0xd7,
638 	0xd6, 0x8a, 0xe5, 0x49, 0xd9, 0xca, 0x45, 0xf4,
639 	0xda, 0xcd, 0x33, 0xd1, 0x59, 0x2d, 0x9e, 0xc1,
640 	0x5c, 0xe6, 0x01, 0x18, 0xb8, 0xf0, 0x5e, 0xb1,
641 	0x69, 0x95, 0x2f, 0x02, 0x2a, 0xe7, 0x4a, 0xd7,
642 	0xd1, 0xc3, 0xd5, 0x6f, 0x15, 0xc8, 0xdc, 0x29,
643 	0xde, 0xb9, 0x3f, 0x8b, 0xa6, 0xbc, 0xdd, 0x25,
644 	0x84, 0x35, 0x3c, 0x90, 0x2d, 0xc2, 0x1e, 0x98,
645 	0x8a, 0x50, 0x09, 0x77, 0x42, 0xe9, 0x35, 0x8a,
646 	0x7c, 0x97, 0xbf, 0xe8, 0xbf, 0x56, 0xd0, 0x8b,
647 	0x65, 0xd3, 0xaf, 0x1e, 0x05, 0x94, 0xfa, 0xac,
648 	0xa8, 0x2b, 0x28, 0xcb, 0x37, 0x3e, 0xe8, 0xbb,
649 	0x66, 0x3a, 0xed, 0xb2, 0x48, 0x10, 0x0f, 0x3a,
650 	0x5a, 0xc5, 0xdb, 0x26, 0x0e, 0xaa, 0x5e, 0x69,
651 	0x15, 0xd6, 0x81, 0xae, 0xbd, 0xe6, 0x03, 0xf1,
652 	0xf6, 0x37, 0xc8, 0xde, 0x70, 0x1f, 0x64, 0xb9,
653 	0x5e, 0xbf, 0x2e, 0x4f, 0xb1, 0xea, 0xa0, 0x17,
654 	0xe6, 0x7c, 0xf9, 0x2f, 0x1e, 0xd8, 0x58, 0xde,
655 	0xa7, 0xf0, 0x46, 0x52, 0x95, 0xdf, 0xa4, 0x96,
656 	0xd0, 0xc4, 0x97, 0x2b, 0x95, 0xcd, 0x5e, 0x40,
657 	0x23, 0x5c, 0x10, 0xee, 0xba, 0x72, 0x9b, 0xcf,
658 	0x0b, 0xe8, 0x18, 0x3a, 0x70, 0xd2, 0x5e, 0x07,
659 	0x68, 0x93, 0xef, 0x4a, 0x5b, 0x8d, 0x72, 0x41,
660 	0x4e, 0xea, 0x33, 0x6a, 0x0a, 0x5e, 0xfb, 0x02,
661 	0x3f, 0xd4, 0xed, 0x5b, 0xe0, 0x42, 0x84, 0xd4,
662 	0xaa, 0x85, 0xdc, 0x5b, 0x67, 0xee, 0x71, 0x67,
663 	0xba, 0x8e, 0xd2, 0xbe, 0x61, 0xdf, 0x5a, 0x26,
664 	0xb9, 0xf0, 0x77, 0x81, 0x53, 0x24, 0x16, 0xcb,
665 	0x8c, 0xb8, 0x06, 0x6e, 0x68, 0xda, 0xc8, 0x2d,
666 	0x17, 0x54, 0xdb, 0x46, 0xcb, 0xfd, 0x1f, 0x3d,
667 	0x94, 0x81, 0x09, 0x4b, 0xfa, 0xb1, 0x46, 0xd9,
668 	0x11, 0xa3, 0xb7, 0x31, 0x9c, 0xd2, 0x38, 0xd6,
669 	0xba, 0x3d, 0xa3, 0x74, 0xd8, 0xf1, 0x24, 0xe8,
670 	0x9c, 0xcb, 0x1d, 0xf9, 0x4a, 0xf7, 0xc8, 0x4b,
671 	0xfe, 0x97, 0x7c, 0xa1, 0x02, 0xeb, 0x40, 0xc3,
672 	0x89, 0x71, 0x01, 0xcd, 0x33, 0x2a, 0xc2, 0x82,
673 	0xce, 0x62, 0x8d, 0x53, 0x7c, 0xdf, 0xce, 0xd7,
674 	0xf5, 0xa8, 0x4f, 0xf2, 0xf2, 0x2e, 0xc1, 0xeb,
675 	0x97, 0x99, 0x37, 0x3c, 0x53, 0xa6, 0xb4, 0x46,
676 	0x05, 0x64, 0x92, 0x87, 0x08, 0x3c, 0x23, 0x4b,
677 	0x9d, 0x67, 0x18, 0xf9, 0xe2, 0x0b, 0x1c, 0x39,
678 	0xd3, 0x87, 0x70, 0xc0, 0xb9, 0x1e, 0x52, 0x0a,
679 	0x0f, 0x48, 0xe2, 0xe7, 0x51, 0x72, 0x94, 0xf7,
680 	0xa3, 0xdc, 0xe5, 0x66, 0x33, 0x39, 0x54, 0x06,
681 	0x55, 0x93, 0x30, 0xf9, 0x5e, 0x76, 0x8f, 0xe0,
682 	0x59, 0x4d, 0x0d, 0xa7, 0xf5, 0xbe, 0xdb, 0x20,
683 	0xad, 0x0d, 0x76, 0x88, 0x5f, 0x9c, 0x7c, 0x75,
684 	0x2f, 0x2a, 0x0b, 0x79, 0x6e, 0xd3, 0xe2, 0x66,
685 	0xf5, 0x4a, 0x2d, 0x87, 0x87, 0x49, 0x84, 0x17,
686 	0xa2, 0x62, 0x4c, 0xbb, 0xe4, 0x6e, 0x98, 0x10,
687 	0xc9, 0xfb, 0x8a, 0x04, 0x68, 0x8d, 0x22, 0x66,
688 	0xad, 0xea, 0x2a, 0xc9, 0x97, 0x2d, 0x3c, 0xbc,
689 	0xd0, 0x77, 0x5f, 0xe6, 0xb8, 0x7f, 0xe6, 0xf6,
690 	0x39, 0xbf, 0x56, 0x0e, 0x26, 0x6d, 0xc5, 0x3e,
691 	0x53, 0x19, 0xd6, 0xb4, 0x57, 0x36, 0xa3, 0xc6,
692 	0xd3, 0x3d, 0x66, 0x79, 0x30, 0x5c, 0x14, 0x0c,
693 	0x0f, 0x3e, 0x96, 0xae, 0x90, 0x97, 0xab, 0x0d,
694 	0x9f, 0xc3, 0xe7, 0x66, 0x3e, 0xe0, 0x31, 0x43,
695 	0x4b, 0x01, 0xb3, 0x0e, 0x9e, 0x8c, 0x82, 0x4a,
696 	0x8c, 0xc7, 0x79, 0x85, 0xdf, 0x75, 0x0d, 0xb4,
697 	0x2b, 0x03, 0x14, 0xef, 0x72, 0x58, 0xfd, 0x64,
698 	0xc8, 0xe3, 0x0d, 0x9a, 0x14, 0x6f, 0x76, 0xf9,
699 	0x46, 0xd1, 0xd2, 0x81, 0xb3, 0x16, 0x6e, 0xc7,
700 	0x76, 0x82, 0xce, 0xf4, 0xee, 0x33, 0x00, 0xe6,
701 	0x77, 0xc4, 0xad, 0x4f, 0x06, 0xa7, 0x48, 0x80,
702 	0x9e, 0x21, 0x66, 0xca, 0x75, 0x69, 0x57, 0xcb,
703 	0xf0, 0x67, 0x6a, 0xaa, 0x8f, 0x88, 0x14, 0xbd,
704 	0x65, 0x62, 0xe2, 0xad, 0xcc, 0x22, 0x88, 0x7b,
705 	0x94, 0xbd, 0x0e, 0xcd, 0xb6, 0x69, 0xa2, 0xcb,
706 	0x7d, 0x57, 0x5c, 0xb4, 0x92, 0x80, 0x13, 0x99,
707 	0x84, 0xf3, 0x79, 0x0a, 0x2d, 0x70, 0xa4, 0xe0,
708 	0xde, 0xc6, 0x32, 0xb0, 0x8a, 0x62, 0xb5, 0xcf,
709 	0xfa, 0x5e, 0x5a, 0x92, 0x32, 0x7d, 0x34, 0x07,
710 	0xb5, 0x52, 0x3a, 0xb5, 0x7d, 0x0f, 0xa1, 0xba,
711 	0x56, 0xd0, 0x07, 0x76, 0x11, 0xf2, 0xc3, 0x33,
712 	0x9d, 0xbd, 0x12, 0x35, 0x5e, 0xf7, 0x05, 0x88,
713 	0x76, 0x94, 0xa6, 0xbf, 0xed, 0xb8, 0xa4, 0xa2,
714 	0x0c, 0xbe, 0x0f, 0x6a, 0xaf, 0xf3, 0x1b, 0x33,
715 	0x4a, 0xb7, 0x68, 0x3f, 0xbe, 0x95, 0x13, 0x97,
716 	0x0f, 0x15, 0x17, 0x1b, 0x23, 0xaa, 0x08, 0x78,
717 	0xa6, 0x5b, 0x08, 0xa2, 0x9d, 0x03, 0xa8, 0xa7,
718 	0x39, 0xdc, 0xbc, 0x9a, 0x85, 0xf5, 0xe5, 0x55,
719 	0x59, 0x3c, 0xef, 0xf9, 0x3f, 0x22, 0x8e, 0xf8,
720 	0xd8, 0x3e, 0x02, 0x0b, 0xd8, 0x78, 0x4b, 0x15,
721 	0x7f, 0xaa, 0x2c, 0xff, 0xbe, 0x77, 0x33, 0xc7,
722 	0x6a, 0x12, 0xaa, 0xa4, 0xbe, 0xc0, 0x3b, 0xcb,
723 	0x13, 0x9d, 0x9c, 0x5a, 0x9f, 0x8a, 0x57, 0x36,
724 	0x4f, 0x02, 0x5a, 0xf8, 0x1d, 0x97, 0x77, 0x43,
725 	0xc8, 0xa5, 0xb7, 0x9b, 0x10, 0x98, 0xfd, 0x58,
726 	0xbf, 0x42, 0xf6, 0xbf, 0xff, 0x6c, 0x40, 0x18,
727 	0x18, 0xdf, 0xac, 0x57, 0x71, 0xea, 0xcc, 0x8e,
728 	0xfd, 0xfe, 0x10, 0xfb, 0xb9, 0xfe, 0xbc, 0x9a,
729 	0x9c, 0x27, 0xe4, 0x10, 0x15, 0x94, 0x41, 0xa1,
730 	0xcc, 0xf6, 0x25, 0x49, 0x4f, 0x96, 0xc1, 0x8c,
731 	0x9e, 0x3e, 0x18, 0x29, 0x49, 0x92, 0xe7, 0xfe,
732 	0x22, 0xff, 0xed, 0x02, 0x16, 0x90, 0xef, 0xac,
733 	0xec, 0x95, 0x1d, 0x5b, 0x94, 0x9c, 0xf6, 0x7c,
734 	0x1b, 0x5a, 0x9d, 0xb0, 0x9b, 0x05, 0x36, 0xbf,
735 	0xef, 0xec, 0x63, 0x35, 0x40, 0x24, 0x45, 0x40,
736 	0x30, 0x1a, 0x9b, 0x90, 0xc3, 0xc2, 0xf7, 0x37,
737 	0xfb, 0x08, 0x8e, 0x48, 0x19, 0x48, 0xed, 0xa8,
738 	0xa8, 0x04, 0x6f, 0xd0, 0x33, 0xe9, 0xb8, 0x8d,
739 	0xe7, 0x1e, 0x5c, 0x47, 0x74, 0xc0, 0x66, 0x30,
740 	0x4e, 0xa7, 0x86, 0x73, 0xf1, 0xe5, 0x78, 0xa6,
741 	0xe0, 0xc1, 0xda, 0x13, 0x72, 0x07, 0x85, 0x34,
742 	0x63, 0x95, 0x49, 0x30, 0x4b, 0x9d, 0x03, 0xf1,
743 	0x7a, 0x6b, 0x91, 0xa2, 0x85, 0x41, 0xf9, 0x4a,
744 	0xd6, 0xff, 0xff, 0x86, 0xf7, 0xf0, 0xce, 0xb9,
745 	0x07, 0xf1, 0x88, 0x04, 0x33, 0xaa, 0xeb, 0x54,
746 	0xb2, 0x1c, 0x8e, 0x2e, 0x7b, 0x04, 0xa8, 0xcc,
747 	0x2c, 0x7a, 0xb3, 0xad, 0x1a, 0x89, 0x38, 0x89,
748 	0xd7, 0x11, 0x3a, 0x8c, 0xcf, 0xe3, 0xc5, 0xba,
749 	0xb0, 0xcc, 0xc4, 0xe3, 0x33, 0xf3, 0x18, 0xba,
750 	0xec, 0x56, 0xd9, 0x1c, 0x40, 0x70, 0x0d, 0x4e,
751 	0x97, 0x01, 0x23, 0xf3, 0x5a, 0xdc, 0xbf, 0x68,
752 	0x93, 0xc2, 0x1d, 0x8a, 0x96, 0xb7, 0xac, 0x18,
753 	0x6f, 0xf7, 0x84, 0x71, 0x0d, 0x3d, 0xf8, 0xba,
754 	0xdf, 0xb6, 0x89, 0x1d, 0x78, 0x19, 0xf2, 0x59,
755 	0xe9, 0x15, 0x55, 0x29, 0x73, 0x50, 0x59, 0x14,
756 	0x02, 0x21, 0x16, 0x8f, 0x0f, 0xdf, 0xa5, 0xf0,
757 };
758 
759 static struct crc_test {
760 	uint32_t crc;		/* random starting crc */
761 	uint32_t start;		/* random offset in buf */
762 	uint32_t length;	/* random length of test */
763 	uint32_t crc32c_le;	/* expected crc32c_le result */
764 	uint32_t crc32_be;	/* expected crc32_be result */
765 } test[] = {
766 	{0xffffffff, 0x00000000, 0x00001000, 0x13934bef, 0xd8ddcdc3},
767 	{0xfe7328ea, 0x00000763, 0x00000717, 0xed2c0d70, 0xc863aef8},
768 	{0x4c40684e, 0x00000721, 0x0000011e, 0xd7f46ccc, 0x173a11c4},
769 	{0x6b487f90, 0x00000264, 0x000007bc, 0x759e9939, 0xd6307c56},
770 	{0x9f5810db, 0x00000afa, 0x00000255, 0x2685197f, 0x2e5c9201},
771 	{0xb15c4755, 0x00000d5b, 0x000002a4, 0xd8fadcb5, 0xf682c4be},
772 	{0x06518253, 0x00000ffb, 0x00000004, 0xabee2433, 0x3d8abdf9},
773 	{0xd9e71c55, 0x00000a2a, 0x00000259, 0x96682af2, 0x47b4d26c},
774 	{0x0c1ae843, 0x00000ce4, 0x0000031b, 0x7b637c43, 0x62b47e8b},
775 	{0xec3cd517, 0x000002ff, 0x00000566, 0x5d719a77, 0xff5bc5b7},
776 	{0x77828e95, 0x0000067f, 0x0000038f, 0x43ee5b6c, 0x1a0cfacd},
777 	{0xec87b4e3, 0x00000d1c, 0x000002e3, 0x2ddd2eee, 0x275118a7},
778 	{0x412158bb, 0x00000eee, 0x00000111, 0x67b38ba2, 0xa74ecff5},
779 	{0x2e52de3e, 0x00000c4a, 0x000003b5, 0xbcc5d61d, 0xbd800707},
780 	{0x6ddaae8b, 0x00000d99, 0x00000266, 0x8b535544, 0xecbde1a1},
781 	{0x049b6cb1, 0x000009c5, 0x000000b0, 0xfc22cabc, 0xfb78eb9f},
782 	{0x77d4b954, 0x0000028a, 0x000007fa, 0x71d00923, 0x8c116f85},
783 	{0x5e192355, 0x00000ac1, 0x000001fa, 0xb966b81a, 0x5aa17bbe},
784 	{0x7d80b71d, 0x00000213, 0x000001e0, 0x2bba371a, 0xb5906aa6},
785 	{0x01f6f1e4, 0x000001d6, 0x00000395, 0xb7e8a647, 0x3ad112b1},
786 	{0x1dfabb13, 0x00000e14, 0x000001eb, 0x53917fba, 0xbaee0339},
787 	{0xb00a4449, 0x00000bf6, 0x00000409, 0xedecb577, 0x6f3a3979},
788 	{0x7ecd3981, 0x0000083f, 0x0000016b, 0xefef62b9, 0xe3e52eed},
789 	{0xf8f330d2, 0x000004be, 0x00000757, 0x9357c9f3, 0x0835bc1b},
790 	{0x03c38af2, 0x00000d23, 0x000002dc, 0x360fa8c0, 0x2ca885e6},
791 	{0x687bb79b, 0x00000f3d, 0x000000c2, 0x448d3be2, 0x79be2f78},
792 	{0x6710f550, 0x000009e9, 0x00000603, 0xdbfd1998, 0x1d25f627},
793 	{0x873171d1, 0x00000787, 0x000004d5, 0xab7f1b62, 0xa76a5656},
794 	{0x373b1314, 0x00000f0f, 0x000000f0, 0x184098ab, 0xba273974},
795 	{0x90fad9cd, 0x00000ead, 0x00000152, 0x23ce52ff, 0xb7bc958c},
796 	{0x19676fe7, 0x0000007d, 0x0000070d, 0xf8a76f1e, 0xf882b644},
797 	{0x89facd45, 0x000005f3, 0x00000473, 0x4331a006, 0xe9dc1396},
798 	{0x6f173747, 0x00000fc3, 0x0000003c, 0xb012f08e, 0xc6b888ee},
799 	{0x4b44a106, 0x0000075a, 0x0000008b, 0xf6f7ac38, 0x60cd2b74},
800 	{0xb620ad06, 0x00000774, 0x0000017e, 0xd34558e6, 0x3a0a615b},
801 	{0x976f21e9, 0x000008d7, 0x0000034a, 0xe533aa3a, 0xa99e60be},
802 	{0x687628c0, 0x000006c5, 0x0000061b, 0x3a840b15, 0x9bfcaef2},
803 	{0xe24ac108, 0x00000cd0, 0x0000032f, 0x51010ae8, 0x20958672},
804 	{0x361c44a3, 0x00000304, 0x00000719, 0xfd7bd481, 0xd70ff2b2},
805 	{0xd93ff95e, 0x00000db7, 0x0000008e, 0xcfbbc304, 0xad716acd},
806 	{0xed752d12, 0x00000883, 0x00000091, 0x65a6c868, 0x95c71c7b},
807 	{0xb4ff4b54, 0x000003d3, 0x000001c1, 0xf82597e7, 0x44b7f99b},
808 	{0x111b520f, 0x00000708, 0x000000eb, 0xc3e109f3, 0x71bc01ee},
809 	{0x62c806f2, 0x00000ba3, 0x0000045c, 0x874d3a72, 0xc539b753},
810 	{0x40d97470, 0x000005e1, 0x0000058d, 0x87a9684f, 0xea6073a5},
811 	{0x4312179c, 0x00000056, 0x0000070e, 0x809a00f5, 0x209aea3b},
812 	{0x13d5f84c, 0x00000a2d, 0x00000104, 0xf3d27578, 0xe087a8b6},
813 	{0x1f302cb2, 0x00000151, 0x00000014, 0x1e162693, 0x95e4b90e},
814 	{0xe491db24, 0x00000600, 0x000006f6, 0x7ff09615, 0x77611523},
815 	{0xf9a98069, 0x000002ba, 0x000002ad, 0x01af7387, 0xea925faa},
816 	{0xe9c477ad, 0x0000015f, 0x00000778, 0x6facf9a0, 0x1130f736},
817 	{0x353f32b2, 0x0000087c, 0x00000783, 0x6cc964ea, 0x32459994},
818 	{0x78e1b24f, 0x00000650, 0x000006a8, 0xb3bb7c27, 0x5a632f78},
819 	{0x61aa400e, 0x00000049, 0x00000254, 0xb8cd1681, 0xdf2652d5},
820 	{0xb84b10b0, 0x00000f73, 0x0000008c, 0x406a6450, 0x3619d31b},
821 	{0x9fa99c9c, 0x00000a7c, 0x000004d7, 0xfb3d21b4, 0xea31c743},
822 	{0x3fc9ebe3, 0x00000cd9, 0x000000d6, 0x43803f9c, 0x1f76a809},
823 	{0x529879cd, 0x000002f2, 0x00000595, 0x78b4c6a6, 0x63b9b93f},
824 	{0x3a933019, 0x00000516, 0x00000266, 0xdcb45436, 0x8f99c98c},
825 	{0x887b4977, 0x00000227, 0x0000038d, 0xc5f7c3d9, 0xaf5e3091},
826 	{0x770745de, 0x000008c6, 0x00000739, 0xf69145e8, 0x53d0dce1},
827 	{0x28be3b47, 0x00000c46, 0x0000032b, 0x764c028f, 0x106d0905},
828 	{0x5013a050, 0x00000cf6, 0x00000309, 0xea8fe164, 0x62180b57},
829 	{0x2ec4c9ba, 0x000006e8, 0x0000078d, 0xa35557a9, 0xf44430a4},
830 	{0xa9f950c9, 0x00000d33, 0x000002cc, 0x41ea8618, 0x587b4eb3},
831 	{0x5b520229, 0x000007b2, 0x00000484, 0x44569f1f, 0x92406c32},
832 	{0xd8dcbbfc, 0x0000002f, 0x0000048c, 0xdb88ab8b, 0x13bfe70e},
833 	{0x25529792, 0x00000d1d, 0x000002e2, 0x20cda404, 0x19d3b4e4},
834 	{0x9f3f6d71, 0x00000238, 0x0000079a, 0x0720443e, 0x3c107021},
835 	{0x64121215, 0x000007ff, 0x0000038f, 0x6aacff2c, 0xb82fdc3e},
836 	{0xfb6cdde0, 0x00000ef8, 0x00000107, 0xbd43a0f1, 0xab0d3c1d},
837 	{0x221c9d6f, 0x000007b6, 0x0000014f, 0xb67f834b, 0x1371ad05},
838 	{0x030e1de4, 0x00000836, 0x000004b4, 0x0d67d26a, 0xe2e72df1},
839 	{0xb56fa6cf, 0x00000c07, 0x000003f8, 0x60601ac1, 0x039de73e},
840 	{0xb55c89f5, 0x0000098e, 0x000001d4, 0x2400efbe, 0xfe39a2bb},
841 	{0x5e90b6d5, 0x0000070b, 0x000003ea, 0x3bb5d6ea, 0xf0f794a0},
842 	{0x2a7045ae, 0x00000961, 0x00000633, 0xfca89e4b, 0xe66ce41c},
843 	{0x8b374ea9, 0x000006ba, 0x00000780, 0xbce036ed, 0x4cb28ef7},
844 	{0x8bd90bc9, 0x00000562, 0x00000369, 0xcb26a24b, 0x40236d1d},
845 	{0x5b1b1762, 0x000000fd, 0x0000051a, 0x33cdda07, 0xc32e420a},
846 	{0xa4153555, 0x0000058f, 0x000005c7, 0xbe50eeca, 0x83a67f35},
847 	{0x0be1f931, 0x00000651, 0x00000672, 0x95a25753, 0x88f1aac1},
848 	{0xb7e78618, 0x00000a7f, 0x000002bb, 0xe06bcc1c, 0x74274f66},
849 	{0x4a9bc41b, 0x00000e51, 0x000001ae, 0x709e8d2c, 0x54eff534},
850 	{0xfc359d13, 0x00000440, 0x000002f8, 0x0a58451f, 0x55e9363f},
851 	{0x5aa48619, 0x000006d1, 0x00000284, 0x928ead83, 0x31041c06},
852 	{0xa609afa8, 0x0000053e, 0x00000272, 0xb048c141, 0x4704efba},
853 	{0x3f108afb, 0x00000949, 0x00000150, 0x9a6bb5bc, 0x4e4430c8},
854 	{0x79bec2d3, 0x000008ed, 0x00000712, 0x32692d57, 0x11d52a7b},
855 	{0x9429e067, 0x00000bc3, 0x0000043c, 0x5295ceff, 0x04640f4d},
856 	{0xae58b96a, 0x0000082d, 0x000007d2, 0xc2a681ba, 0xf7ca4a2c},
857 	{0x95df24be, 0x00000985, 0x000004c1, 0x3a287765, 0x2c4af003},
858 	{0x5e94976f, 0x00000596, 0x000004ed, 0xff00c489, 0x5ae11687},
859 	{0xf5e5f1de, 0x00000d31, 0x000002ce, 0x35f28e91, 0x30d47957},
860 	{0xa2c219cf, 0x00000a3c, 0x00000374, 0x707d21eb, 0x2a14a255},
861 	{0xf21b6ceb, 0x00000919, 0x00000135, 0x0847fb8b, 0xcb8d3b93},
862 	{0xaa988728, 0x00000787, 0x00000771, 0x885aeaa4, 0x6531b509},
863 	{0xaa5dfaac, 0x000003e5, 0x0000051b, 0x52c48ab7, 0xe43cc5e9},
864 	{0x0a053968, 0x00000d2a, 0x000002d5, 0x7a90256d, 0x8004765c},
865 	{0x1421dc20, 0x00000eef, 0x00000110, 0x97d6da24, 0x1378f6ff},
866 	{0xb47c2166, 0x00000a6a, 0x00000209, 0xcfd6cc52, 0x676e14a5},
867 	{0x77dd1955, 0x000000de, 0x00000266, 0xba74bcaa, 0xc71b429c},
868 	{0x68a03cc2, 0x0000082f, 0x000007b0, 0x752bd5d8, 0x19ed14aa},
869 	{0x0226b0a3, 0x00000a5f, 0x000005a0, 0x82de4970, 0xf654d3ed},
870 	{0x637bf3b1, 0x00000d93, 0x0000026c, 0x5c7115cb, 0x3cccb57e},
871 	{0x3b120edf, 0x00000c13, 0x000003ec, 0x80d7d20f, 0x92132798},
872 	{0xe2456780, 0x000002eb, 0x00000641, 0xc0a5d289, 0x6160c87a},
873 	{0x9b2e7125, 0x00000c0c, 0x000003f3, 0xcc15f57e, 0x6f00f637},
874 	{0x153033ef, 0x00000787, 0x000006b6, 0x3cde443b, 0xb46caa6e},
875 	{0x18458b3f, 0x0000066c, 0x00000561, 0x9a2bd8c6, 0xb6c29121},
876 	{0x4ff9d4b9, 0x00000c8f, 0x0000033a, 0xd0ee6d6d, 0xc81cf380},
877 	{0xdf84b5d9, 0x00000802, 0x0000029a, 0xdab0d74a, 0xb2464559},
878 	{0x81ee15df, 0x000003ce, 0x00000725, 0x9942e2de, 0x4ccf571b},
879 	{0x5c768e04, 0x00000afd, 0x00000160, 0x36110831, 0xae0b305a},
880 	{0xe5e18094, 0x00000b4b, 0x000000a0, 0xffa3e4a7, 0x6c8a4f09},
881 	{0xed7263b6, 0x00000d0d, 0x000002f2, 0xb0006a35, 0x7e04af8c},
882 	{0x5bfde7d7, 0x000006fb, 0x00000554, 0xa4193b76, 0xb3a91d12},
883 	{0x67f4a743, 0x00000b85, 0x0000047a, 0xf05c8d8f, 0xfb472fdf},
884 	{0xf13bdf22, 0x00000ff7, 0x00000008, 0x816351eb, 0xf347f235},
885 	{0x08ecc608, 0x00000d5d, 0x00000098, 0x90492772, 0x0b7f1521},
886 	{0x296f52ba, 0x000004f9, 0x00000788, 0x5e5a4896, 0x1cc67088},
887 	{0xbe4624c2, 0x00000427, 0x000004ef, 0xcd267b94, 0x550caefd},
888 	{0x906f7c7c, 0x00000a05, 0x0000003f, 0x03fcfc33, 0x9ed82a02},
889 	{0x8f7b323e, 0x00000458, 0x000004c7, 0xcd4969c8, 0x633c38a8},
890 	{0x88d6593d, 0x00000597, 0x000005b5, 0xf199cd3b, 0x0491452f},
891 	{0x978a7768, 0x00000268, 0x000001d3, 0xb28c95bd, 0x1a42fe61},
892 	{0x857a621e, 0x000007a7, 0x000003a8, 0xf4bf84ab, 0xcd0694c6},
893 	{0xb0e121ef, 0x000005be, 0x00000644, 0x28747c14, 0xf0510c72},
894 	{0, 0, 0, 0, 0},
895 };
896 
test_crc32c(void)897 static int test_crc32c(void)
898 {
899 	struct crc_test *t = test;
900 	int failures = 0;
901 
902 	while (t->length) {
903 		uint32_t be, le;
904 		le = ext2fs_crc32c_le(t->crc, test_buf + t->start, t->length);
905 		be = ext2fs_crc32_be(t->crc, test_buf + t->start, t->length);
906 		if (le != t->crc32c_le) {
907 			printf("Test %d LE fails, %x != %x\n",
908 			       (int) (t - test), le, t->crc32c_le);
909 			failures++;
910 		}
911 		if (be != t->crc32_be) {
912 			printf("Test %d BE fails, %x != %x\n",
913 			       (int) (t - test), be, t->crc32_be);
914 			failures++;
915 		}
916 		t++;
917 	}
918 
919 	return failures;
920 }
921 
main(int argc,char * argv[])922 int main(int argc, char *argv[])
923 {
924 	int ret;
925 
926 	ret = test_crc32c();
927 	if (!ret)
928 		printf("No failures.\n");
929 
930 	return ret;
931 }
932 #endif /* UNITTEST */
933