blob: 5971f2ad46d5623203b2652e838b5de47a9be2d4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell.com>
3 * Nicer crc32 functions/docs submitted by linux@horizon.com. Thanks!
4 * Code was from the public domain, copyright abandoned. Code was
5 * subsequently included in the kernel, thus was re-licensed under the
6 * GNU GPL v2.
7 *
8 * Oct 12, 2000 Matt Domsch <Matt_Domsch@dell.com>
9 * Same crc32 function was used in 5 other places in the kernel.
10 * I made one version, and deleted the others.
11 * There are various incantations of crc32(). Some use a seed of 0 or ~0.
12 * Some xor at the end with ~0. The generic crc32() function takes
13 * seed as an argument, and doesn't xor at the end. Then individual
14 * users can do whatever they need.
15 * drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0.
16 * fs/jffs2 uses seed 0, doesn't xor with ~0.
17 * fs/partitions/efi.c uses seed ~0, xor's with ~0.
18 *
19 * This source code is licensed under the GNU General Public License,
20 * Version 2. See the file COPYING for more details.
21 */
22
Bob Pearsonfbedceb2012-03-23 15:02:22 -070023/* see: Documentation/crc32.txt for a description of algorithms */
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/crc32.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include "crc32defs.h"
Bob Pearson60e58d52012-03-23 15:02:22 -070029
Bob Pearson9a1dbf62012-03-23 15:02:23 -070030#if CRC_LE_BITS > 8
Bob Pearsonce4320d2012-03-23 15:02:23 -070031# define tole(x) ((__force u32) __constant_cpu_to_le32(x))
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#else
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080033# define tole(x) (x)
34#endif
35
Bob Pearson9a1dbf62012-03-23 15:02:23 -070036#if CRC_BE_BITS > 8
Bob Pearsonce4320d2012-03-23 15:02:23 -070037# define tobe(x) ((__force u32) __constant_cpu_to_be32(x))
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080038#else
39# define tobe(x) (x)
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#endif
Bob Pearson60e58d52012-03-23 15:02:22 -070041
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#include "crc32table.h"
43
44MODULE_AUTHOR("Matt Domsch <Matt_Domsch@dell.com>");
45MODULE_DESCRIPTION("Ethernet CRC32 calculations");
46MODULE_LICENSE("GPL");
47
Bob Pearson9a1dbf62012-03-23 15:02:23 -070048#if CRC_LE_BITS > 8 || CRC_BE_BITS > 8
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080049
50static inline u32
Joakim Tjernlund836e2af2010-05-24 14:33:31 -070051crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080052{
Andrew Morton0d2daf52010-05-25 23:43:03 -070053# ifdef __LITTLE_ENDIAN
Joakim Tjernlund57423322012-01-10 15:10:18 -080054# define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
55# define DO_CRC4 crc = t3[(crc) & 255] ^ \
56 t2[(crc >> 8) & 255] ^ \
57 t1[(crc >> 16) & 255] ^ \
58 t0[(crc >> 24) & 255]
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080059# else
Joakim Tjernlund57423322012-01-10 15:10:18 -080060# define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
61# define DO_CRC4 crc = t0[(crc) & 255] ^ \
62 t1[(crc >> 8) & 255] ^ \
63 t2[(crc >> 16) & 255] ^ \
64 t3[(crc >> 24) & 255]
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080065# endif
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080066 const u32 *b;
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080067 size_t rem_len;
Joakim Tjernlund57423322012-01-10 15:10:18 -080068 const u32 *t0=tab[0], *t1=tab[1], *t2=tab[2], *t3=tab[3];
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080069
70 /* Align it */
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080071 if (unlikely((long)buf & 3 && len)) {
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080072 do {
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080073 DO_CRC(*buf++);
74 } while ((--len) && ((long)buf)&3);
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080075 }
76 rem_len = len & 3;
77 /* load data 32 bits wide, xor data 32 bits wide. */
78 len = len >> 2;
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080079 b = (const u32 *)buf;
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080080 for (--b; len; --len) {
81 crc ^= *++b; /* use pre increment for speed */
Joakim Tjernlund836e2af2010-05-24 14:33:31 -070082 DO_CRC4;
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080083 }
84 len = rem_len;
85 /* And the last few bytes */
86 if (len) {
87 u8 *p = (u8 *)(b + 1) - 1;
88 do {
89 DO_CRC(*++p); /* use pre increment for speed */
90 } while (--len);
91 }
92 return crc;
Joakim Tjernlund4f2a94632010-03-05 13:43:55 -080093#undef DO_CRC
Joakim Tjernlund836e2af2010-05-24 14:33:31 -070094#undef DO_CRC4
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -080095}
96#endif
Bob Pearson60e58d52012-03-23 15:02:22 -070097
Randy Dunlap2f721002006-06-25 05:48:59 -070098/**
99 * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32
100 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for
101 * other uses, or the previous crc32 value if computing incrementally.
102 * @p: pointer to buffer over which CRC is run
103 * @len: length of buffer @p
104 */
Ralf Baechlee8c44312007-10-18 03:07:07 -0700105u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106{
Bob Pearson60e58d52012-03-23 15:02:22 -0700107#if CRC_LE_BITS == 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 int i;
109 while (len--) {
110 crc ^= *p++;
111 for (i = 0; i < 8; i++)
112 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0);
113 }
Bob Pearson60e58d52012-03-23 15:02:22 -0700114# elif CRC_LE_BITS == 2
115 while (len--) {
116 crc ^= *p++;
117 crc = (crc >> 2) ^ crc32table_le[0][crc & 3];
118 crc = (crc >> 2) ^ crc32table_le[0][crc & 3];
119 crc = (crc >> 2) ^ crc32table_le[0][crc & 3];
120 crc = (crc >> 2) ^ crc32table_le[0][crc & 3];
121 }
122# elif CRC_LE_BITS == 4
123 while (len--) {
124 crc ^= *p++;
125 crc = (crc >> 4) ^ crc32table_le[0][crc & 15];
126 crc = (crc >> 4) ^ crc32table_le[0][crc & 15];
127 }
128# elif CRC_LE_BITS == 8
Bob Pearson9a1dbf62012-03-23 15:02:23 -0700129 /* aka Sarwate algorithm */
130 while (len--) {
131 crc ^= *p++;
132 crc = (crc >> 8) ^ crc32table_le[0][crc & 255];
133 }
134# else
Joakim Tjernlund836e2af2010-05-24 14:33:31 -0700135 const u32 (*tab)[] = crc32table_le;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
Bob Pearsonce4320d2012-03-23 15:02:23 -0700137 crc = (__force u32) __cpu_to_le32(crc);
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -0800138 crc = crc32_body(crc, p, len, tab);
Bob Pearsonce4320d2012-03-23 15:02:23 -0700139 crc = __le32_to_cpu((__force __le32)crc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140#endif
Bob Pearson60e58d52012-03-23 15:02:22 -0700141 return crc;
142}
143EXPORT_SYMBOL(crc32_le);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
Randy Dunlap2f721002006-06-25 05:48:59 -0700145/**
146 * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32
147 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for
148 * other uses, or the previous crc32 value if computing incrementally.
149 * @p: pointer to buffer over which CRC is run
150 * @len: length of buffer @p
151 */
Ralf Baechlee8c44312007-10-18 03:07:07 -0700152u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153{
Bob Pearson60e58d52012-03-23 15:02:22 -0700154#if CRC_BE_BITS == 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 int i;
156 while (len--) {
157 crc ^= *p++ << 24;
158 for (i = 0; i < 8; i++)
159 crc =
160 (crc << 1) ^ ((crc & 0x80000000) ? CRCPOLY_BE :
161 0);
162 }
Bob Pearson60e58d52012-03-23 15:02:22 -0700163# elif CRC_BE_BITS == 2
164 while (len--) {
165 crc ^= *p++ << 24;
166 crc = (crc << 2) ^ crc32table_be[0][crc >> 30];
167 crc = (crc << 2) ^ crc32table_be[0][crc >> 30];
168 crc = (crc << 2) ^ crc32table_be[0][crc >> 30];
169 crc = (crc << 2) ^ crc32table_be[0][crc >> 30];
170 }
171# elif CRC_BE_BITS == 4
172 while (len--) {
173 crc ^= *p++ << 24;
174 crc = (crc << 4) ^ crc32table_be[0][crc >> 28];
175 crc = (crc << 4) ^ crc32table_be[0][crc >> 28];
176 }
177# elif CRC_BE_BITS == 8
Bob Pearson9a1dbf62012-03-23 15:02:23 -0700178 while (len--) {
179 crc ^= *p++ << 24;
180 crc = (crc << 8) ^ crc32table_be[0][crc >> 24];
181 }
182# else
Joakim Tjernlund836e2af2010-05-24 14:33:31 -0700183 const u32 (*tab)[] = crc32table_be;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Bob Pearsonce4320d2012-03-23 15:02:23 -0700185 crc = (__force u32) __cpu_to_be32(crc);
Joakim Tjernlundddcaccb2009-12-14 18:01:33 -0800186 crc = crc32_body(crc, p, len, tab);
Bob Pearsonce4320d2012-03-23 15:02:23 -0700187 crc = __be32_to_cpu((__force __be32)crc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188# endif
Bob Pearson60e58d52012-03-23 15:02:22 -0700189 return crc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191EXPORT_SYMBOL(crc32_be);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
Bob Pearson3863ef32012-03-23 15:02:22 -0700193#ifdef CONFIG_CRC32_SELFTEST
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194
Bob Pearson3863ef32012-03-23 15:02:22 -0700195/* 4096 random bytes */
196static u8 __attribute__((__aligned__(8))) test_buf[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197{
Bob Pearson3863ef32012-03-23 15:02:22 -0700198 0x5b, 0x85, 0x21, 0xcb, 0x09, 0x68, 0x7d, 0x30,
199 0xc7, 0x69, 0xd7, 0x30, 0x92, 0xde, 0x59, 0xe4,
200 0xc9, 0x6e, 0x8b, 0xdb, 0x98, 0x6b, 0xaa, 0x60,
201 0xa8, 0xb5, 0xbc, 0x6c, 0xa9, 0xb1, 0x5b, 0x2c,
202 0xea, 0xb4, 0x92, 0x6a, 0x3f, 0x79, 0x91, 0xe4,
203 0xe9, 0x70, 0x51, 0x8c, 0x7f, 0x95, 0x6f, 0x1a,
204 0x56, 0xa1, 0x5c, 0x27, 0x03, 0x67, 0x9f, 0x3a,
205 0xe2, 0x31, 0x11, 0x29, 0x6b, 0x98, 0xfc, 0xc4,
206 0x53, 0x24, 0xc5, 0x8b, 0xce, 0x47, 0xb2, 0xb9,
207 0x32, 0xcb, 0xc1, 0xd0, 0x03, 0x57, 0x4e, 0xd4,
208 0xe9, 0x3c, 0xa1, 0x63, 0xcf, 0x12, 0x0e, 0xca,
209 0xe1, 0x13, 0xd1, 0x93, 0xa6, 0x88, 0x5c, 0x61,
210 0x5b, 0xbb, 0xf0, 0x19, 0x46, 0xb4, 0xcf, 0x9e,
211 0xb6, 0x6b, 0x4c, 0x3a, 0xcf, 0x60, 0xf9, 0x7a,
212 0x8d, 0x07, 0x63, 0xdb, 0x40, 0xe9, 0x0b, 0x6f,
213 0xad, 0x97, 0xf1, 0xed, 0xd0, 0x1e, 0x26, 0xfd,
214 0xbf, 0xb7, 0xc8, 0x04, 0x94, 0xf8, 0x8b, 0x8c,
215 0xf1, 0xab, 0x7a, 0xd4, 0xdd, 0xf3, 0xe8, 0x88,
216 0xc3, 0xed, 0x17, 0x8a, 0x9b, 0x40, 0x0d, 0x53,
217 0x62, 0x12, 0x03, 0x5f, 0x1b, 0x35, 0x32, 0x1f,
218 0xb4, 0x7b, 0x93, 0x78, 0x0d, 0xdb, 0xce, 0xa4,
219 0xc0, 0x47, 0xd5, 0xbf, 0x68, 0xe8, 0x5d, 0x74,
220 0x8f, 0x8e, 0x75, 0x1c, 0xb2, 0x4f, 0x9a, 0x60,
221 0xd1, 0xbe, 0x10, 0xf4, 0x5c, 0xa1, 0x53, 0x09,
222 0xa5, 0xe0, 0x09, 0x54, 0x85, 0x5c, 0xdc, 0x07,
223 0xe7, 0x21, 0x69, 0x7b, 0x8a, 0xfd, 0x90, 0xf1,
224 0x22, 0xd0, 0xb4, 0x36, 0x28, 0xe6, 0xb8, 0x0f,
225 0x39, 0xde, 0xc8, 0xf3, 0x86, 0x60, 0x34, 0xd2,
226 0x5e, 0xdf, 0xfd, 0xcf, 0x0f, 0xa9, 0x65, 0xf0,
227 0xd5, 0x4d, 0x96, 0x40, 0xe3, 0xdf, 0x3f, 0x95,
228 0x5a, 0x39, 0x19, 0x93, 0xf4, 0x75, 0xce, 0x22,
229 0x00, 0x1c, 0x93, 0xe2, 0x03, 0x66, 0xf4, 0x93,
230 0x73, 0x86, 0x81, 0x8e, 0x29, 0x44, 0x48, 0x86,
231 0x61, 0x7c, 0x48, 0xa3, 0x43, 0xd2, 0x9c, 0x8d,
232 0xd4, 0x95, 0xdd, 0xe1, 0x22, 0x89, 0x3a, 0x40,
233 0x4c, 0x1b, 0x8a, 0x04, 0xa8, 0x09, 0x69, 0x8b,
234 0xea, 0xc6, 0x55, 0x8e, 0x57, 0xe6, 0x64, 0x35,
235 0xf0, 0xc7, 0x16, 0x9f, 0x5d, 0x5e, 0x86, 0x40,
236 0x46, 0xbb, 0xe5, 0x45, 0x88, 0xfe, 0xc9, 0x63,
237 0x15, 0xfb, 0xf5, 0xbd, 0x71, 0x61, 0xeb, 0x7b,
238 0x78, 0x70, 0x07, 0x31, 0x03, 0x9f, 0xb2, 0xc8,
239 0xa7, 0xab, 0x47, 0xfd, 0xdf, 0xa0, 0x78, 0x72,
240 0xa4, 0x2a, 0xe4, 0xb6, 0xba, 0xc0, 0x1e, 0x86,
241 0x71, 0xe6, 0x3d, 0x18, 0x37, 0x70, 0xe6, 0xff,
242 0xe0, 0xbc, 0x0b, 0x22, 0xa0, 0x1f, 0xd3, 0xed,
243 0xa2, 0x55, 0x39, 0xab, 0xa8, 0x13, 0x73, 0x7c,
244 0x3f, 0xb2, 0xd6, 0x19, 0xac, 0xff, 0x99, 0xed,
245 0xe8, 0xe6, 0xa6, 0x22, 0xe3, 0x9c, 0xf1, 0x30,
246 0xdc, 0x01, 0x0a, 0x56, 0xfa, 0xe4, 0xc9, 0x99,
247 0xdd, 0xa8, 0xd8, 0xda, 0x35, 0x51, 0x73, 0xb4,
248 0x40, 0x86, 0x85, 0xdb, 0x5c, 0xd5, 0x85, 0x80,
249 0x14, 0x9c, 0xfd, 0x98, 0xa9, 0x82, 0xc5, 0x37,
250 0xff, 0x32, 0x5d, 0xd0, 0x0b, 0xfa, 0xdc, 0x04,
251 0x5e, 0x09, 0xd2, 0xca, 0x17, 0x4b, 0x1a, 0x8e,
252 0x15, 0xe1, 0xcc, 0x4e, 0x52, 0x88, 0x35, 0xbd,
253 0x48, 0xfe, 0x15, 0xa0, 0x91, 0xfd, 0x7e, 0x6c,
254 0x0e, 0x5d, 0x79, 0x1b, 0x81, 0x79, 0xd2, 0x09,
255 0x34, 0x70, 0x3d, 0x81, 0xec, 0xf6, 0x24, 0xbb,
256 0xfb, 0xf1, 0x7b, 0xdf, 0x54, 0xea, 0x80, 0x9b,
257 0xc7, 0x99, 0x9e, 0xbd, 0x16, 0x78, 0x12, 0x53,
258 0x5e, 0x01, 0xa7, 0x4e, 0xbd, 0x67, 0xe1, 0x9b,
259 0x4c, 0x0e, 0x61, 0x45, 0x97, 0xd2, 0xf0, 0x0f,
260 0xfe, 0x15, 0x08, 0xb7, 0x11, 0x4c, 0xe7, 0xff,
261 0x81, 0x53, 0xff, 0x91, 0x25, 0x38, 0x7e, 0x40,
262 0x94, 0xe5, 0xe0, 0xad, 0xe6, 0xd9, 0x79, 0xb6,
263 0x92, 0xc9, 0xfc, 0xde, 0xc3, 0x1a, 0x23, 0xbb,
264 0xdd, 0xc8, 0x51, 0x0c, 0x3a, 0x72, 0xfa, 0x73,
265 0x6f, 0xb7, 0xee, 0x61, 0x39, 0x03, 0x01, 0x3f,
266 0x7f, 0x94, 0x2e, 0x2e, 0xba, 0x3a, 0xbb, 0xb4,
267 0xfa, 0x6a, 0x17, 0xfe, 0xea, 0xef, 0x5e, 0x66,
268 0x97, 0x3f, 0x32, 0x3d, 0xd7, 0x3e, 0xb1, 0xf1,
269 0x6c, 0x14, 0x4c, 0xfd, 0x37, 0xd3, 0x38, 0x80,
270 0xfb, 0xde, 0xa6, 0x24, 0x1e, 0xc8, 0xca, 0x7f,
271 0x3a, 0x93, 0xd8, 0x8b, 0x18, 0x13, 0xb2, 0xe5,
272 0xe4, 0x93, 0x05, 0x53, 0x4f, 0x84, 0x66, 0xa7,
273 0x58, 0x5c, 0x7b, 0x86, 0x52, 0x6d, 0x0d, 0xce,
274 0xa4, 0x30, 0x7d, 0xb6, 0x18, 0x9f, 0xeb, 0xff,
275 0x22, 0xbb, 0x72, 0x29, 0xb9, 0x44, 0x0b, 0x48,
276 0x1e, 0x84, 0x71, 0x81, 0xe3, 0x6d, 0x73, 0x26,
277 0x92, 0xb4, 0x4d, 0x2a, 0x29, 0xb8, 0x1f, 0x72,
278 0xed, 0xd0, 0xe1, 0x64, 0x77, 0xea, 0x8e, 0x88,
279 0x0f, 0xef, 0x3f, 0xb1, 0x3b, 0xad, 0xf9, 0xc9,
280 0x8b, 0xd0, 0xac, 0xc6, 0xcc, 0xa9, 0x40, 0xcc,
281 0x76, 0xf6, 0x3b, 0x53, 0xb5, 0x88, 0xcb, 0xc8,
282 0x37, 0xf1, 0xa2, 0xba, 0x23, 0x15, 0x99, 0x09,
283 0xcc, 0xe7, 0x7a, 0x3b, 0x37, 0xf7, 0x58, 0xc8,
284 0x46, 0x8c, 0x2b, 0x2f, 0x4e, 0x0e, 0xa6, 0x5c,
285 0xea, 0x85, 0x55, 0xba, 0x02, 0x0e, 0x0e, 0x48,
286 0xbc, 0xe1, 0xb1, 0x01, 0x35, 0x79, 0x13, 0x3d,
287 0x1b, 0xc0, 0x53, 0x68, 0x11, 0xe7, 0x95, 0x0f,
288 0x9d, 0x3f, 0x4c, 0x47, 0x7b, 0x4d, 0x1c, 0xae,
289 0x50, 0x9b, 0xcb, 0xdd, 0x05, 0x8d, 0x9a, 0x97,
290 0xfd, 0x8c, 0xef, 0x0c, 0x1d, 0x67, 0x73, 0xa8,
291 0x28, 0x36, 0xd5, 0xb6, 0x92, 0x33, 0x40, 0x75,
292 0x0b, 0x51, 0xc3, 0x64, 0xba, 0x1d, 0xc2, 0xcc,
293 0xee, 0x7d, 0x54, 0x0f, 0x27, 0x69, 0xa7, 0x27,
294 0x63, 0x30, 0x29, 0xd9, 0xc8, 0x84, 0xd8, 0xdf,
295 0x9f, 0x68, 0x8d, 0x04, 0xca, 0xa6, 0xc5, 0xc7,
296 0x7a, 0x5c, 0xc8, 0xd1, 0xcb, 0x4a, 0xec, 0xd0,
297 0xd8, 0x20, 0x69, 0xc5, 0x17, 0xcd, 0x78, 0xc8,
298 0x75, 0x23, 0x30, 0x69, 0xc9, 0xd4, 0xea, 0x5c,
299 0x4f, 0x6b, 0x86, 0x3f, 0x8b, 0xfe, 0xee, 0x44,
300 0xc9, 0x7c, 0xb7, 0xdd, 0x3e, 0xe5, 0xec, 0x54,
301 0x03, 0x3e, 0xaa, 0x82, 0xc6, 0xdf, 0xb2, 0x38,
302 0x0e, 0x5d, 0xb3, 0x88, 0xd9, 0xd3, 0x69, 0x5f,
303 0x8f, 0x70, 0x8a, 0x7e, 0x11, 0xd9, 0x1e, 0x7b,
304 0x38, 0xf1, 0x42, 0x1a, 0xc0, 0x35, 0xf5, 0xc7,
305 0x36, 0x85, 0xf5, 0xf7, 0xb8, 0x7e, 0xc7, 0xef,
306 0x18, 0xf1, 0x63, 0xd6, 0x7a, 0xc6, 0xc9, 0x0e,
307 0x4d, 0x69, 0x4f, 0x84, 0xef, 0x26, 0x41, 0x0c,
308 0xec, 0xc7, 0xe0, 0x7e, 0x3c, 0x67, 0x01, 0x4c,
309 0x62, 0x1a, 0x20, 0x6f, 0xee, 0x47, 0x4d, 0xc0,
310 0x99, 0x13, 0x8d, 0x91, 0x4a, 0x26, 0xd4, 0x37,
311 0x28, 0x90, 0x58, 0x75, 0x66, 0x2b, 0x0a, 0xdf,
312 0xda, 0xee, 0x92, 0x25, 0x90, 0x62, 0x39, 0x9e,
313 0x44, 0x98, 0xad, 0xc1, 0x88, 0xed, 0xe4, 0xb4,
314 0xaf, 0xf5, 0x8c, 0x9b, 0x48, 0x4d, 0x56, 0x60,
315 0x97, 0x0f, 0x61, 0x59, 0x9e, 0xa6, 0x27, 0xfe,
316 0xc1, 0x91, 0x15, 0x38, 0xb8, 0x0f, 0xae, 0x61,
317 0x7d, 0x26, 0x13, 0x5a, 0x73, 0xff, 0x1c, 0xa3,
318 0x61, 0x04, 0x58, 0x48, 0x55, 0x44, 0x11, 0xfe,
319 0x15, 0xca, 0xc3, 0xbd, 0xca, 0xc5, 0xb4, 0x40,
320 0x5d, 0x1b, 0x7f, 0x39, 0xb5, 0x9c, 0x35, 0xec,
321 0x61, 0x15, 0x32, 0x32, 0xb8, 0x4e, 0x40, 0x9f,
322 0x17, 0x1f, 0x0a, 0x4d, 0xa9, 0x91, 0xef, 0xb7,
323 0xb0, 0xeb, 0xc2, 0x83, 0x9a, 0x6c, 0xd2, 0x79,
324 0x43, 0x78, 0x5e, 0x2f, 0xe5, 0xdd, 0x1a, 0x3c,
325 0x45, 0xab, 0x29, 0x40, 0x3a, 0x37, 0x5b, 0x6f,
326 0xd7, 0xfc, 0x48, 0x64, 0x3c, 0x49, 0xfb, 0x21,
327 0xbe, 0xc3, 0xff, 0x07, 0xfb, 0x17, 0xe9, 0xc9,
328 0x0c, 0x4c, 0x5c, 0x15, 0x9e, 0x8e, 0x22, 0x30,
329 0x0a, 0xde, 0x48, 0x7f, 0xdb, 0x0d, 0xd1, 0x2b,
330 0x87, 0x38, 0x9e, 0xcc, 0x5a, 0x01, 0x16, 0xee,
331 0x75, 0x49, 0x0d, 0x30, 0x01, 0x34, 0x6a, 0xb6,
332 0x9a, 0x5a, 0x2a, 0xec, 0xbb, 0x48, 0xac, 0xd3,
333 0x77, 0x83, 0xd8, 0x08, 0x86, 0x4f, 0x48, 0x09,
334 0x29, 0x41, 0x79, 0xa1, 0x03, 0x12, 0xc4, 0xcd,
335 0x90, 0x55, 0x47, 0x66, 0x74, 0x9a, 0xcc, 0x4f,
336 0x35, 0x8c, 0xd6, 0x98, 0xef, 0xeb, 0x45, 0xb9,
337 0x9a, 0x26, 0x2f, 0x39, 0xa5, 0x70, 0x6d, 0xfc,
338 0xb4, 0x51, 0xee, 0xf4, 0x9c, 0xe7, 0x38, 0x59,
339 0xad, 0xf4, 0xbc, 0x46, 0xff, 0x46, 0x8e, 0x60,
340 0x9c, 0xa3, 0x60, 0x1d, 0xf8, 0x26, 0x72, 0xf5,
341 0x72, 0x9d, 0x68, 0x80, 0x04, 0xf6, 0x0b, 0xa1,
342 0x0a, 0xd5, 0xa7, 0x82, 0x3a, 0x3e, 0x47, 0xa8,
343 0x5a, 0xde, 0x59, 0x4f, 0x7b, 0x07, 0xb3, 0xe9,
344 0x24, 0x19, 0x3d, 0x34, 0x05, 0xec, 0xf1, 0xab,
345 0x6e, 0x64, 0x8f, 0xd3, 0xe6, 0x41, 0x86, 0x80,
346 0x70, 0xe3, 0x8d, 0x60, 0x9c, 0x34, 0x25, 0x01,
347 0x07, 0x4d, 0x19, 0x41, 0x4e, 0x3d, 0x5c, 0x7e,
348 0xa8, 0xf5, 0xcc, 0xd5, 0x7b, 0xe2, 0x7d, 0x3d,
349 0x49, 0x86, 0x7d, 0x07, 0xb7, 0x10, 0xe3, 0x35,
350 0xb8, 0x84, 0x6d, 0x76, 0xab, 0x17, 0xc6, 0x38,
351 0xb4, 0xd3, 0x28, 0x57, 0xad, 0xd3, 0x88, 0x5a,
352 0xda, 0xea, 0xc8, 0x94, 0xcc, 0x37, 0x19, 0xac,
353 0x9c, 0x9f, 0x4b, 0x00, 0x15, 0xc0, 0xc8, 0xca,
354 0x1f, 0x15, 0xaa, 0xe0, 0xdb, 0xf9, 0x2f, 0x57,
355 0x1b, 0x24, 0xc7, 0x6f, 0x76, 0x29, 0xfb, 0xed,
356 0x25, 0x0d, 0xc0, 0xfe, 0xbd, 0x5a, 0xbf, 0x20,
357 0x08, 0x51, 0x05, 0xec, 0x71, 0xa3, 0xbf, 0xef,
358 0x5e, 0x99, 0x75, 0xdb, 0x3c, 0x5f, 0x9a, 0x8c,
359 0xbb, 0x19, 0x5c, 0x0e, 0x93, 0x19, 0xf8, 0x6a,
360 0xbc, 0xf2, 0x12, 0x54, 0x2f, 0xcb, 0x28, 0x64,
361 0x88, 0xb3, 0x92, 0x0d, 0x96, 0xd1, 0xa6, 0xe4,
362 0x1f, 0xf1, 0x4d, 0xa4, 0xab, 0x1c, 0xee, 0x54,
363 0xf2, 0xad, 0x29, 0x6d, 0x32, 0x37, 0xb2, 0x16,
364 0x77, 0x5c, 0xdc, 0x2e, 0x54, 0xec, 0x75, 0x26,
365 0xc6, 0x36, 0xd9, 0x17, 0x2c, 0xf1, 0x7a, 0xdc,
366 0x4b, 0xf1, 0xe2, 0xd9, 0x95, 0xba, 0xac, 0x87,
367 0xc1, 0xf3, 0x8e, 0x58, 0x08, 0xd8, 0x87, 0x60,
368 0xc9, 0xee, 0x6a, 0xde, 0xa4, 0xd2, 0xfc, 0x0d,
369 0xe5, 0x36, 0xc4, 0x5c, 0x52, 0xb3, 0x07, 0x54,
370 0x65, 0x24, 0xc1, 0xb1, 0xd1, 0xb1, 0x53, 0x13,
371 0x31, 0x79, 0x7f, 0x05, 0x76, 0xeb, 0x37, 0x59,
372 0x15, 0x2b, 0xd1, 0x3f, 0xac, 0x08, 0x97, 0xeb,
373 0x91, 0x98, 0xdf, 0x6c, 0x09, 0x0d, 0x04, 0x9f,
374 0xdc, 0x3b, 0x0e, 0x60, 0x68, 0x47, 0x23, 0x15,
375 0x16, 0xc6, 0x0b, 0x35, 0xf8, 0x77, 0xa2, 0x78,
376 0x50, 0xd4, 0x64, 0x22, 0x33, 0xff, 0xfb, 0x93,
377 0x71, 0x46, 0x50, 0x39, 0x1b, 0x9c, 0xea, 0x4e,
378 0x8d, 0x0c, 0x37, 0xe5, 0x5c, 0x51, 0x3a, 0x31,
379 0xb2, 0x85, 0x84, 0x3f, 0x41, 0xee, 0xa2, 0xc1,
380 0xc6, 0x13, 0x3b, 0x54, 0x28, 0xd2, 0x18, 0x37,
381 0xcc, 0x46, 0x9f, 0x6a, 0x91, 0x3d, 0x5a, 0x15,
382 0x3c, 0x89, 0xa3, 0x61, 0x06, 0x7d, 0x2e, 0x78,
383 0xbe, 0x7d, 0x40, 0xba, 0x2f, 0x95, 0xb1, 0x2f,
384 0x87, 0x3b, 0x8a, 0xbe, 0x6a, 0xf4, 0xc2, 0x31,
385 0x74, 0xee, 0x91, 0xe0, 0x23, 0xaa, 0x5d, 0x7f,
386 0xdd, 0xf0, 0x44, 0x8c, 0x0b, 0x59, 0x2b, 0xfc,
387 0x48, 0x3a, 0xdf, 0x07, 0x05, 0x38, 0x6c, 0xc9,
388 0xeb, 0x18, 0x24, 0x68, 0x8d, 0x58, 0x98, 0xd3,
389 0x31, 0xa3, 0xe4, 0x70, 0x59, 0xb1, 0x21, 0xbe,
390 0x7e, 0x65, 0x7d, 0xb8, 0x04, 0xab, 0xf6, 0xe4,
391 0xd7, 0xda, 0xec, 0x09, 0x8f, 0xda, 0x6d, 0x24,
392 0x07, 0xcc, 0x29, 0x17, 0x05, 0x78, 0x1a, 0xc1,
393 0xb1, 0xce, 0xfc, 0xaa, 0x2d, 0xe7, 0xcc, 0x85,
394 0x84, 0x84, 0x03, 0x2a, 0x0c, 0x3f, 0xa9, 0xf8,
395 0xfd, 0x84, 0x53, 0x59, 0x5c, 0xf0, 0xd4, 0x09,
396 0xf0, 0xd2, 0x6c, 0x32, 0x03, 0xb0, 0xa0, 0x8c,
397 0x52, 0xeb, 0x23, 0x91, 0x88, 0x43, 0x13, 0x46,
398 0xf6, 0x1e, 0xb4, 0x1b, 0xf5, 0x8e, 0x3a, 0xb5,
399 0x3d, 0x00, 0xf6, 0xe5, 0x08, 0x3d, 0x5f, 0x39,
400 0xd3, 0x21, 0x69, 0xbc, 0x03, 0x22, 0x3a, 0xd2,
401 0x5c, 0x84, 0xf8, 0x15, 0xc4, 0x80, 0x0b, 0xbc,
402 0x29, 0x3c, 0xf3, 0x95, 0x98, 0xcd, 0x8f, 0x35,
403 0xbc, 0xa5, 0x3e, 0xfc, 0xd4, 0x13, 0x9e, 0xde,
404 0x4f, 0xce, 0x71, 0x9d, 0x09, 0xad, 0xf2, 0x80,
405 0x6b, 0x65, 0x7f, 0x03, 0x00, 0x14, 0x7c, 0x15,
406 0x85, 0x40, 0x6d, 0x70, 0xea, 0xdc, 0xb3, 0x63,
407 0x35, 0x4f, 0x4d, 0xe0, 0xd9, 0xd5, 0x3c, 0x58,
408 0x56, 0x23, 0x80, 0xe2, 0x36, 0xdd, 0x75, 0x1d,
409 0x94, 0x11, 0x41, 0x8e, 0xe0, 0x81, 0x8e, 0xcf,
410 0xe0, 0xe5, 0xf6, 0xde, 0xd1, 0xe7, 0x04, 0x12,
411 0x79, 0x92, 0x2b, 0x71, 0x2a, 0x79, 0x8b, 0x7c,
412 0x44, 0x79, 0x16, 0x30, 0x4e, 0xf4, 0xf6, 0x9b,
413 0xb7, 0x40, 0xa3, 0x5a, 0xa7, 0x69, 0x3e, 0xc1,
414 0x3a, 0x04, 0xd0, 0x88, 0xa0, 0x3b, 0xdd, 0xc6,
415 0x9e, 0x7e, 0x1e, 0x1e, 0x8f, 0x44, 0xf7, 0x73,
416 0x67, 0x1e, 0x1a, 0x78, 0xfa, 0x62, 0xf4, 0xa9,
417 0xa8, 0xc6, 0x5b, 0xb8, 0xfa, 0x06, 0x7d, 0x5e,
418 0x38, 0x1c, 0x9a, 0x39, 0xe9, 0x39, 0x98, 0x22,
419 0x0b, 0xa7, 0xac, 0x0b, 0xf3, 0xbc, 0xf1, 0xeb,
420 0x8c, 0x81, 0xe3, 0x48, 0x8a, 0xed, 0x42, 0xc2,
421 0x38, 0xcf, 0x3e, 0xda, 0xd2, 0x89, 0x8d, 0x9c,
422 0x53, 0xb5, 0x2f, 0x41, 0x01, 0x26, 0x84, 0x9c,
423 0xa3, 0x56, 0xf6, 0x49, 0xc7, 0xd4, 0x9f, 0x93,
424 0x1b, 0x96, 0x49, 0x5e, 0xad, 0xb3, 0x84, 0x1f,
425 0x3c, 0xa4, 0xe0, 0x9b, 0xd1, 0x90, 0xbc, 0x38,
426 0x6c, 0xdd, 0x95, 0x4d, 0x9d, 0xb1, 0x71, 0x57,
427 0x2d, 0x34, 0xe8, 0xb8, 0x42, 0xc7, 0x99, 0x03,
428 0xc7, 0x07, 0x30, 0x65, 0x91, 0x55, 0xd5, 0x90,
429 0x70, 0x97, 0x37, 0x68, 0xd4, 0x11, 0xf9, 0xe8,
430 0xce, 0xec, 0xdc, 0x34, 0xd5, 0xd3, 0xb7, 0xc4,
431 0xb8, 0x97, 0x05, 0x92, 0xad, 0xf8, 0xe2, 0x36,
432 0x64, 0x41, 0xc9, 0xc5, 0x41, 0x77, 0x52, 0xd7,
433 0x2c, 0xa5, 0x24, 0x2f, 0xd9, 0x34, 0x0b, 0x47,
434 0x35, 0xa7, 0x28, 0x8b, 0xc5, 0xcd, 0xe9, 0x46,
435 0xac, 0x39, 0x94, 0x3c, 0x10, 0xc6, 0x29, 0x73,
436 0x0e, 0x0e, 0x5d, 0xe0, 0x71, 0x03, 0x8a, 0x72,
437 0x0e, 0x26, 0xb0, 0x7d, 0x84, 0xed, 0x95, 0x23,
438 0x49, 0x5a, 0x45, 0x83, 0x45, 0x60, 0x11, 0x4a,
439 0x46, 0x31, 0xd4, 0xd8, 0x16, 0x54, 0x98, 0x58,
440 0xed, 0x6d, 0xcc, 0x5d, 0xd6, 0x50, 0x61, 0x9f,
441 0x9d, 0xc5, 0x3e, 0x9d, 0x32, 0x47, 0xde, 0x96,
442 0xe1, 0x5d, 0xd8, 0xf8, 0xb4, 0x69, 0x6f, 0xb9,
443 0x15, 0x90, 0x57, 0x7a, 0xf6, 0xad, 0xb0, 0x5b,
444 0xf5, 0xa6, 0x36, 0x94, 0xfd, 0x84, 0xce, 0x1c,
445 0x0f, 0x4b, 0xd0, 0xc2, 0x5b, 0x6b, 0x56, 0xef,
446 0x73, 0x93, 0x0b, 0xc3, 0xee, 0xd9, 0xcf, 0xd3,
447 0xa4, 0x22, 0x58, 0xcd, 0x50, 0x6e, 0x65, 0xf4,
448 0xe9, 0xb7, 0x71, 0xaf, 0x4b, 0xb3, 0xb6, 0x2f,
449 0x0f, 0x0e, 0x3b, 0xc9, 0x85, 0x14, 0xf5, 0x17,
450 0xe8, 0x7a, 0x3a, 0xbf, 0x5f, 0x5e, 0xf8, 0x18,
451 0x48, 0xa6, 0x72, 0xab, 0x06, 0x95, 0xe9, 0xc8,
452 0xa7, 0xf4, 0x32, 0x44, 0x04, 0x0c, 0x84, 0x98,
453 0x73, 0xe3, 0x89, 0x8d, 0x5f, 0x7e, 0x4a, 0x42,
454 0x8f, 0xc5, 0x28, 0xb1, 0x82, 0xef, 0x1c, 0x97,
455 0x31, 0x3b, 0x4d, 0xe0, 0x0e, 0x10, 0x10, 0x97,
456 0x93, 0x49, 0x78, 0x2f, 0x0d, 0x86, 0x8b, 0xa1,
457 0x53, 0xa9, 0x81, 0x20, 0x79, 0xe7, 0x07, 0x77,
458 0xb6, 0xac, 0x5e, 0xd2, 0x05, 0xcd, 0xe9, 0xdb,
459 0x8a, 0x94, 0x82, 0x8a, 0x23, 0xb9, 0x3d, 0x1c,
460 0xa9, 0x7d, 0x72, 0x4a, 0xed, 0x33, 0xa3, 0xdb,
461 0x21, 0xa7, 0x86, 0x33, 0x45, 0xa5, 0xaa, 0x56,
462 0x45, 0xb5, 0x83, 0x29, 0x40, 0x47, 0x79, 0x04,
463 0x6e, 0xb9, 0x95, 0xd0, 0x81, 0x77, 0x2d, 0x48,
464 0x1e, 0xfe, 0xc3, 0xc2, 0x1e, 0xe5, 0xf2, 0xbe,
465 0xfd, 0x3b, 0x94, 0x9f, 0xc4, 0xc4, 0x26, 0x9d,
466 0xe4, 0x66, 0x1e, 0x19, 0xee, 0x6c, 0x79, 0x97,
467 0x11, 0x31, 0x4b, 0x0d, 0x01, 0xcb, 0xde, 0xa8,
468 0xf6, 0x6d, 0x7c, 0x39, 0x46, 0x4e, 0x7e, 0x3f,
469 0x94, 0x17, 0xdf, 0xa1, 0x7d, 0xd9, 0x1c, 0x8e,
470 0xbc, 0x7d, 0x33, 0x7d, 0xe3, 0x12, 0x40, 0xca,
471 0xab, 0x37, 0x11, 0x46, 0xd4, 0xae, 0xef, 0x44,
472 0xa2, 0xb3, 0x6a, 0x66, 0x0e, 0x0c, 0x90, 0x7f,
473 0xdf, 0x5c, 0x66, 0x5f, 0xf2, 0x94, 0x9f, 0xa6,
474 0x73, 0x4f, 0xeb, 0x0d, 0xad, 0xbf, 0xc0, 0x63,
475 0x5c, 0xdc, 0x46, 0x51, 0xe8, 0x8e, 0x90, 0x19,
476 0xa8, 0xa4, 0x3c, 0x91, 0x79, 0xfa, 0x7e, 0x58,
477 0x85, 0x13, 0x55, 0xc5, 0x19, 0x82, 0x37, 0x1b,
478 0x0a, 0x02, 0x1f, 0x99, 0x6b, 0x18, 0xf1, 0x28,
479 0x08, 0xa2, 0x73, 0xb8, 0x0f, 0x2e, 0xcd, 0xbf,
480 0xf3, 0x86, 0x7f, 0xea, 0xef, 0xd0, 0xbb, 0xa6,
481 0x21, 0xdf, 0x49, 0x73, 0x51, 0xcc, 0x36, 0xd3,
482 0x3e, 0xa0, 0xf8, 0x44, 0xdf, 0xd3, 0xa6, 0xbe,
483 0x8a, 0xd4, 0x57, 0xdd, 0x72, 0x94, 0x61, 0x0f,
484 0x82, 0xd1, 0x07, 0xb8, 0x7c, 0x18, 0x83, 0xdf,
485 0x3a, 0xe5, 0x50, 0x6a, 0x82, 0x20, 0xac, 0xa9,
486 0xa8, 0xff, 0xd9, 0xf3, 0x77, 0x33, 0x5a, 0x9e,
487 0x7f, 0x6d, 0xfe, 0x5d, 0x33, 0x41, 0x42, 0xe7,
488 0x6c, 0x19, 0xe0, 0x44, 0x8a, 0x15, 0xf6, 0x70,
489 0x98, 0xb7, 0x68, 0x4d, 0xfa, 0x97, 0x39, 0xb0,
490 0x8e, 0xe8, 0x84, 0x8b, 0x75, 0x30, 0xb7, 0x7d,
491 0x92, 0x69, 0x20, 0x9c, 0x81, 0xfb, 0x4b, 0xf4,
492 0x01, 0x50, 0xeb, 0xce, 0x0c, 0x1c, 0x6c, 0xb5,
493 0x4a, 0xd7, 0x27, 0x0c, 0xce, 0xbb, 0xe5, 0x85,
494 0xf0, 0xb6, 0xee, 0xd5, 0x70, 0xdd, 0x3b, 0xfc,
495 0xd4, 0x99, 0xf1, 0x33, 0xdd, 0x8b, 0xc4, 0x2f,
496 0xae, 0xab, 0x74, 0x96, 0x32, 0xc7, 0x4c, 0x56,
497 0x3c, 0x89, 0x0f, 0x96, 0x0b, 0x42, 0xc0, 0xcb,
498 0xee, 0x0f, 0x0b, 0x8c, 0xfb, 0x7e, 0x47, 0x7b,
499 0x64, 0x48, 0xfd, 0xb2, 0x00, 0x80, 0x89, 0xa5,
500 0x13, 0x55, 0x62, 0xfc, 0x8f, 0xe2, 0x42, 0x03,
501 0xb7, 0x4e, 0x2a, 0x79, 0xb4, 0x82, 0xea, 0x23,
502 0x49, 0xda, 0xaf, 0x52, 0x63, 0x1e, 0x60, 0x03,
503 0x89, 0x06, 0x44, 0x46, 0x08, 0xc3, 0xc4, 0x87,
504 0x70, 0x2e, 0xda, 0x94, 0xad, 0x6b, 0xe0, 0xe4,
505 0xd1, 0x8a, 0x06, 0xc2, 0xa8, 0xc0, 0xa7, 0x43,
506 0x3c, 0x47, 0x52, 0x0e, 0xc3, 0x77, 0x81, 0x11,
507 0x67, 0x0e, 0xa0, 0x70, 0x04, 0x47, 0x29, 0x40,
508 0x86, 0x0d, 0x34, 0x56, 0xa7, 0xc9, 0x35, 0x59,
509 0x68, 0xdc, 0x93, 0x81, 0x70, 0xee, 0x86, 0xd9,
510 0x80, 0x06, 0x40, 0x4f, 0x1a, 0x0d, 0x40, 0x30,
511 0x0b, 0xcb, 0x96, 0x47, 0xc1, 0xb7, 0x52, 0xfd,
512 0x56, 0xe0, 0x72, 0x4b, 0xfb, 0xbd, 0x92, 0x45,
513 0x61, 0x71, 0xc2, 0x33, 0x11, 0xbf, 0x52, 0x83,
514 0x79, 0x26, 0xe0, 0x49, 0x6b, 0xb7, 0x05, 0x8b,
515 0xe8, 0x0e, 0x87, 0x31, 0xd7, 0x9d, 0x8a, 0xf5,
516 0xc0, 0x5f, 0x2e, 0x58, 0x4a, 0xdb, 0x11, 0xb3,
517 0x6c, 0x30, 0x2a, 0x46, 0x19, 0xe3, 0x27, 0x84,
518 0x1f, 0x63, 0x6e, 0xf6, 0x57, 0xc7, 0xc9, 0xd8,
519 0x5e, 0xba, 0xb3, 0x87, 0xd5, 0x83, 0x26, 0x34,
520 0x21, 0x9e, 0x65, 0xde, 0x42, 0xd3, 0xbe, 0x7b,
521 0xbc, 0x91, 0x71, 0x44, 0x4d, 0x99, 0x3b, 0x31,
522 0xe5, 0x3f, 0x11, 0x4e, 0x7f, 0x13, 0x51, 0x3b,
523 0xae, 0x79, 0xc9, 0xd3, 0x81, 0x8e, 0x25, 0x40,
524 0x10, 0xfc, 0x07, 0x1e, 0xf9, 0x7b, 0x9a, 0x4b,
525 0x6c, 0xe3, 0xb3, 0xad, 0x1a, 0x0a, 0xdd, 0x9e,
526 0x59, 0x0c, 0xa2, 0xcd, 0xae, 0x48, 0x4a, 0x38,
527 0x5b, 0x47, 0x41, 0x94, 0x65, 0x6b, 0xbb, 0xeb,
528 0x5b, 0xe3, 0xaf, 0x07, 0x5b, 0xd4, 0x4a, 0xa2,
529 0xc9, 0x5d, 0x2f, 0x64, 0x03, 0xd7, 0x3a, 0x2c,
530 0x6e, 0xce, 0x76, 0x95, 0xb4, 0xb3, 0xc0, 0xf1,
531 0xe2, 0x45, 0x73, 0x7a, 0x5c, 0xab, 0xc1, 0xfc,
532 0x02, 0x8d, 0x81, 0x29, 0xb3, 0xac, 0x07, 0xec,
533 0x40, 0x7d, 0x45, 0xd9, 0x7a, 0x59, 0xee, 0x34,
534 0xf0, 0xe9, 0xd5, 0x7b, 0x96, 0xb1, 0x3d, 0x95,
535 0xcc, 0x86, 0xb5, 0xb6, 0x04, 0x2d, 0xb5, 0x92,
536 0x7e, 0x76, 0xf4, 0x06, 0xa9, 0xa3, 0x12, 0x0f,
537 0xb1, 0xaf, 0x26, 0xba, 0x7c, 0xfc, 0x7e, 0x1c,
538 0xbc, 0x2c, 0x49, 0x97, 0x53, 0x60, 0x13, 0x0b,
539 0xa6, 0x61, 0x83, 0x89, 0x42, 0xd4, 0x17, 0x0c,
540 0x6c, 0x26, 0x52, 0xc3, 0xb3, 0xd4, 0x67, 0xf5,
541 0xe3, 0x04, 0xb7, 0xf4, 0xcb, 0x80, 0xb8, 0xcb,
542 0x77, 0x56, 0x3e, 0xaa, 0x57, 0x54, 0xee, 0xb4,
543 0x2c, 0x67, 0xcf, 0xf2, 0xdc, 0xbe, 0x55, 0xf9,
544 0x43, 0x1f, 0x6e, 0x22, 0x97, 0x67, 0x7f, 0xc4,
545 0xef, 0xb1, 0x26, 0x31, 0x1e, 0x27, 0xdf, 0x41,
546 0x80, 0x47, 0x6c, 0xe2, 0xfa, 0xa9, 0x8c, 0x2a,
547 0xf6, 0xf2, 0xab, 0xf0, 0x15, 0xda, 0x6c, 0xc8,
548 0xfe, 0xb5, 0x23, 0xde, 0xa9, 0x05, 0x3f, 0x06,
549 0x54, 0x4c, 0xcd, 0xe1, 0xab, 0xfc, 0x0e, 0x62,
550 0x33, 0x31, 0x73, 0x2c, 0x76, 0xcb, 0xb4, 0x47,
551 0x1e, 0x20, 0xad, 0xd8, 0xf2, 0x31, 0xdd, 0xc4,
552 0x8b, 0x0c, 0x77, 0xbe, 0xe1, 0x8b, 0x26, 0x00,
553 0x02, 0x58, 0xd6, 0x8d, 0xef, 0xad, 0x74, 0x67,
554 0xab, 0x3f, 0xef, 0xcb, 0x6f, 0xb0, 0xcc, 0x81,
555 0x44, 0x4c, 0xaf, 0xe9, 0x49, 0x4f, 0xdb, 0xa0,
556 0x25, 0xa4, 0xf0, 0x89, 0xf1, 0xbe, 0xd8, 0x10,
557 0xff, 0xb1, 0x3b, 0x4b, 0xfa, 0x98, 0xf5, 0x79,
558 0x6d, 0x1e, 0x69, 0x4d, 0x57, 0xb1, 0xc8, 0x19,
559 0x1b, 0xbd, 0x1e, 0x8c, 0x84, 0xb7, 0x7b, 0xe8,
560 0xd2, 0x2d, 0x09, 0x41, 0x41, 0x37, 0x3d, 0xb1,
561 0x6f, 0x26, 0x5d, 0x71, 0x16, 0x3d, 0xb7, 0x83,
562 0x27, 0x2c, 0xa7, 0xb6, 0x50, 0xbd, 0x91, 0x86,
563 0xab, 0x24, 0xa1, 0x38, 0xfd, 0xea, 0x71, 0x55,
564 0x7e, 0x9a, 0x07, 0x77, 0x4b, 0xfa, 0x61, 0x66,
565 0x20, 0x1e, 0x28, 0x95, 0x18, 0x1b, 0xa4, 0xa0,
566 0xfd, 0xc0, 0x89, 0x72, 0x43, 0xd9, 0x3b, 0x49,
567 0x5a, 0x3f, 0x9d, 0xbf, 0xdb, 0xb4, 0x46, 0xea,
568 0x42, 0x01, 0x77, 0x23, 0x68, 0x95, 0xb6, 0x24,
569 0xb3, 0xa8, 0x6c, 0x28, 0x3b, 0x11, 0x40, 0x7e,
570 0x18, 0x65, 0x6d, 0xd8, 0x24, 0x42, 0x7d, 0x88,
571 0xc0, 0x52, 0xd9, 0x05, 0xe4, 0x95, 0x90, 0x87,
572 0x8c, 0xf4, 0xd0, 0x6b, 0xb9, 0x83, 0x99, 0x34,
573 0x6d, 0xfe, 0x54, 0x40, 0x94, 0x52, 0x21, 0x4f,
574 0x14, 0x25, 0xc5, 0xd6, 0x5e, 0x95, 0xdc, 0x0a,
575 0x2b, 0x89, 0x20, 0x11, 0x84, 0x48, 0xd6, 0x3a,
576 0xcd, 0x5c, 0x24, 0xad, 0x62, 0xe3, 0xb1, 0x93,
577 0x25, 0x8d, 0xcd, 0x7e, 0xfc, 0x27, 0xa3, 0x37,
578 0xfd, 0x84, 0xfc, 0x1b, 0xb2, 0xf1, 0x27, 0x38,
579 0x5a, 0xb7, 0xfc, 0xf2, 0xfa, 0x95, 0x66, 0xd4,
580 0xfb, 0xba, 0xa7, 0xd7, 0xa3, 0x72, 0x69, 0x48,
581 0x48, 0x8c, 0xeb, 0x28, 0x89, 0xfe, 0x33, 0x65,
582 0x5a, 0x36, 0x01, 0x7e, 0x06, 0x79, 0x0a, 0x09,
583 0x3b, 0x74, 0x11, 0x9a, 0x6e, 0xbf, 0xd4, 0x9e,
584 0x58, 0x90, 0x49, 0x4f, 0x4d, 0x08, 0xd4, 0xe5,
585 0x4a, 0x09, 0x21, 0xef, 0x8b, 0xb8, 0x74, 0x3b,
586 0x91, 0xdd, 0x36, 0x85, 0x60, 0x2d, 0xfa, 0xd4,
587 0x45, 0x7b, 0x45, 0x53, 0xf5, 0x47, 0x87, 0x7e,
588 0xa6, 0x37, 0xc8, 0x78, 0x7a, 0x68, 0x9d, 0x8d,
589 0x65, 0x2c, 0x0e, 0x91, 0x5c, 0xa2, 0x60, 0xf0,
590 0x8e, 0x3f, 0xe9, 0x1a, 0xcd, 0xaa, 0xe7, 0xd5,
591 0x77, 0x18, 0xaf, 0xc9, 0xbc, 0x18, 0xea, 0x48,
592 0x1b, 0xfb, 0x22, 0x48, 0x70, 0x16, 0x29, 0x9e,
593 0x5b, 0xc1, 0x2c, 0x66, 0x23, 0xbc, 0xf0, 0x1f,
594 0xef, 0xaf, 0xe4, 0xd6, 0x04, 0x19, 0x82, 0x7a,
595 0x0b, 0xba, 0x4b, 0x46, 0xb1, 0x6a, 0x85, 0x5d,
596 0xb4, 0x73, 0xd6, 0x21, 0xa1, 0x71, 0x60, 0x14,
597 0xee, 0x0a, 0x77, 0xc4, 0x66, 0x2e, 0xf9, 0x69,
598 0x30, 0xaf, 0x41, 0x0b, 0xc8, 0x83, 0x3c, 0x53,
599 0x99, 0x19, 0x27, 0x46, 0xf7, 0x41, 0x6e, 0x56,
600 0xdc, 0x94, 0x28, 0x67, 0x4e, 0xb7, 0x25, 0x48,
601 0x8a, 0xc2, 0xe0, 0x60, 0x96, 0xcc, 0x18, 0xf4,
602 0x84, 0xdd, 0xa7, 0x5e, 0x3e, 0x05, 0x0b, 0x26,
603 0x26, 0xb2, 0x5c, 0x1f, 0x57, 0x1a, 0x04, 0x7e,
604 0x6a, 0xe3, 0x2f, 0xb4, 0x35, 0xb6, 0x38, 0x40,
605 0x40, 0xcd, 0x6f, 0x87, 0x2e, 0xef, 0xa3, 0xd7,
606 0xa9, 0xc2, 0xe8, 0x0d, 0x27, 0xdf, 0x44, 0x62,
607 0x99, 0xa0, 0xfc, 0xcf, 0x81, 0x78, 0xcb, 0xfe,
608 0xe5, 0xa0, 0x03, 0x4e, 0x6c, 0xd7, 0xf4, 0xaf,
609 0x7a, 0xbb, 0x61, 0x82, 0xfe, 0x71, 0x89, 0xb2,
610 0x22, 0x7c, 0x8e, 0x83, 0x04, 0xce, 0xf6, 0x5d,
611 0x84, 0x8f, 0x95, 0x6a, 0x7f, 0xad, 0xfd, 0x32,
612 0x9c, 0x5e, 0xe4, 0x9c, 0x89, 0x60, 0x54, 0xaa,
613 0x96, 0x72, 0xd2, 0xd7, 0x36, 0x85, 0xa9, 0x45,
614 0xd2, 0x2a, 0xa1, 0x81, 0x49, 0x6f, 0x7e, 0x04,
615 0xfa, 0xe2, 0xfe, 0x90, 0x26, 0x77, 0x5a, 0x33,
616 0xb8, 0x04, 0x9a, 0x7a, 0xe6, 0x4c, 0x4f, 0xad,
617 0x72, 0x96, 0x08, 0x28, 0x58, 0x13, 0xf8, 0xc4,
618 0x1c, 0xf0, 0xc3, 0x45, 0x95, 0x49, 0x20, 0x8c,
619 0x9f, 0x39, 0x70, 0xe1, 0x77, 0xfe, 0xd5, 0x4b,
620 0xaf, 0x86, 0xda, 0xef, 0x22, 0x06, 0x83, 0x36,
621 0x29, 0x12, 0x11, 0x40, 0xbc, 0x3b, 0x86, 0xaa,
622 0xaa, 0x65, 0x60, 0xc3, 0x80, 0xca, 0xed, 0xa9,
623 0xf3, 0xb0, 0x79, 0x96, 0xa2, 0x55, 0x27, 0x28,
624 0x55, 0x73, 0x26, 0xa5, 0x50, 0xea, 0x92, 0x4b,
625 0x3c, 0x5c, 0x82, 0x33, 0xf0, 0x01, 0x3f, 0x03,
626 0xc1, 0x08, 0x05, 0xbf, 0x98, 0xf4, 0x9b, 0x6d,
627 0xa5, 0xa8, 0xb4, 0x82, 0x0c, 0x06, 0xfa, 0xff,
628 0x2d, 0x08, 0xf3, 0x05, 0x4f, 0x57, 0x2a, 0x39,
629 0xd4, 0x83, 0x0d, 0x75, 0x51, 0xd8, 0x5b, 0x1b,
630 0xd3, 0x51, 0x5a, 0x32, 0x2a, 0x9b, 0x32, 0xb2,
631 0xf2, 0xa4, 0x96, 0x12, 0xf2, 0xae, 0x40, 0x34,
632 0x67, 0xa8, 0xf5, 0x44, 0xd5, 0x35, 0x53, 0xfe,
633 0xa3, 0x60, 0x96, 0x63, 0x0f, 0x1f, 0x6e, 0xb0,
634 0x5a, 0x42, 0xa6, 0xfc, 0x51, 0x0b, 0x60, 0x27,
635 0xbc, 0x06, 0x71, 0xed, 0x65, 0x5b, 0x23, 0x86,
636 0x4a, 0x07, 0x3b, 0x22, 0x07, 0x46, 0xe6, 0x90,
637 0x3e, 0xf3, 0x25, 0x50, 0x1b, 0x4c, 0x7f, 0x03,
638 0x08, 0xa8, 0x36, 0x6b, 0x87, 0xe5, 0xe3, 0xdb,
639 0x9a, 0x38, 0x83, 0xff, 0x9f, 0x1a, 0x9f, 0x57,
640 0xa4, 0x2a, 0xf6, 0x37, 0xbc, 0x1a, 0xff, 0xc9,
641 0x1e, 0x35, 0x0c, 0xc3, 0x7c, 0xa3, 0xb2, 0xe5,
642 0xd2, 0xc6, 0xb4, 0x57, 0x47, 0xe4, 0x32, 0x16,
643 0x6d, 0xa9, 0xae, 0x64, 0xe6, 0x2d, 0x8d, 0xc5,
644 0x8d, 0x50, 0x8e, 0xe8, 0x1a, 0x22, 0x34, 0x2a,
645 0xd9, 0xeb, 0x51, 0x90, 0x4a, 0xb1, 0x41, 0x7d,
646 0x64, 0xf9, 0xb9, 0x0d, 0xf6, 0x23, 0x33, 0xb0,
647 0x33, 0xf4, 0xf7, 0x3f, 0x27, 0x84, 0xc6, 0x0f,
648 0x54, 0xa5, 0xc0, 0x2e, 0xec, 0x0b, 0x3a, 0x48,
649 0x6e, 0x80, 0x35, 0x81, 0x43, 0x9b, 0x90, 0xb1,
650 0xd0, 0x2b, 0xea, 0x21, 0xdc, 0xda, 0x5b, 0x09,
651 0xf4, 0xcc, 0x10, 0xb4, 0xc7, 0xfe, 0x79, 0x51,
652 0xc3, 0xc5, 0xac, 0x88, 0x74, 0x84, 0x0b, 0x4b,
653 0xca, 0x79, 0x16, 0x29, 0xfb, 0x69, 0x54, 0xdf,
654 0x41, 0x7e, 0xe9, 0xc7, 0x8e, 0xea, 0xa5, 0xfe,
655 0xfc, 0x76, 0x0e, 0x90, 0xc4, 0x92, 0x38, 0xad,
656 0x7b, 0x48, 0xe6, 0x6e, 0xf7, 0x21, 0xfd, 0x4e,
657 0x93, 0x0a, 0x7b, 0x41, 0x83, 0x68, 0xfb, 0x57,
658 0x51, 0x76, 0x34, 0xa9, 0x6c, 0x00, 0xaa, 0x4f,
659 0x66, 0x65, 0x98, 0x4a, 0x4f, 0xa3, 0xa0, 0xef,
660 0x69, 0x3f, 0xe3, 0x1c, 0x92, 0x8c, 0xfd, 0xd8,
661 0xe8, 0xde, 0x7c, 0x7f, 0x3e, 0x84, 0x8e, 0x69,
662 0x3c, 0xf1, 0xf2, 0x05, 0x46, 0xdc, 0x2f, 0x9d,
663 0x5e, 0x6e, 0x4c, 0xfb, 0xb5, 0x99, 0x2a, 0x59,
664 0x63, 0xc1, 0x34, 0xbc, 0x57, 0xc0, 0x0d, 0xb9,
665 0x61, 0x25, 0xf3, 0x33, 0x23, 0x51, 0xb6, 0x0d,
666 0x07, 0xa6, 0xab, 0x94, 0x4a, 0xb7, 0x2a, 0xea,
667 0xee, 0xac, 0xa3, 0xc3, 0x04, 0x8b, 0x0e, 0x56,
668 0xfe, 0x44, 0xa7, 0x39, 0xe2, 0xed, 0xed, 0xb4,
669 0x22, 0x2b, 0xac, 0x12, 0x32, 0x28, 0x91, 0xd8,
670 0xa5, 0xab, 0xff, 0x5f, 0xe0, 0x4b, 0xda, 0x78,
671 0x17, 0xda, 0xf1, 0x01, 0x5b, 0xcd, 0xe2, 0x5f,
672 0x50, 0x45, 0x73, 0x2b, 0xe4, 0x76, 0x77, 0xf4,
673 0x64, 0x1d, 0x43, 0xfb, 0x84, 0x7a, 0xea, 0x91,
674 0xae, 0xf9, 0x9e, 0xb7, 0xb4, 0xb0, 0x91, 0x5f,
675 0x16, 0x35, 0x9a, 0x11, 0xb8, 0xc7, 0xc1, 0x8c,
676 0xc6, 0x10, 0x8d, 0x2f, 0x63, 0x4a, 0xa7, 0x57,
677 0x3a, 0x51, 0xd6, 0x32, 0x2d, 0x64, 0x72, 0xd4,
678 0x66, 0xdc, 0x10, 0xa6, 0x67, 0xd6, 0x04, 0x23,
679 0x9d, 0x0a, 0x11, 0x77, 0xdd, 0x37, 0x94, 0x17,
680 0x3c, 0xbf, 0x8b, 0x65, 0xb0, 0x2e, 0x5e, 0x66,
681 0x47, 0x64, 0xac, 0xdd, 0xf0, 0x84, 0xfd, 0x39,
682 0xfa, 0x15, 0x5d, 0xef, 0xae, 0xca, 0xc1, 0x36,
683 0xa7, 0x5c, 0xbf, 0xc7, 0x08, 0xc2, 0x66, 0x00,
684 0x74, 0x74, 0x4e, 0x27, 0x3f, 0x55, 0x8a, 0xb7,
685 0x38, 0x66, 0x83, 0x6d, 0xcf, 0x99, 0x9e, 0x60,
686 0x8f, 0xdd, 0x2e, 0x62, 0x22, 0x0e, 0xef, 0x0c,
687 0x98, 0xa7, 0x85, 0x74, 0x3b, 0x9d, 0xec, 0x9e,
688 0xa9, 0x19, 0x72, 0xa5, 0x7f, 0x2c, 0x39, 0xb7,
689 0x7d, 0xb7, 0xf1, 0x12, 0x65, 0x27, 0x4b, 0x5a,
690 0xde, 0x17, 0xfe, 0xad, 0x44, 0xf3, 0x20, 0x4d,
691 0xfd, 0xe4, 0x1f, 0xb5, 0x81, 0xb0, 0x36, 0x37,
692 0x08, 0x6f, 0xc3, 0x0c, 0xe9, 0x85, 0x98, 0x82,
693 0xa9, 0x62, 0x0c, 0xc4, 0x97, 0xc0, 0x50, 0xc8,
694 0xa7, 0x3c, 0x50, 0x9f, 0x43, 0xb9, 0xcd, 0x5e,
695 0x4d, 0xfa, 0x1c, 0x4b, 0x0b, 0xa9, 0x98, 0x85,
696 0x38, 0x92, 0xac, 0x8d, 0xe4, 0xad, 0x9b, 0x98,
697 0xab, 0xd9, 0x38, 0xac, 0x62, 0x52, 0xa3, 0x22,
698 0x63, 0x0f, 0xbf, 0x95, 0x48, 0xdf, 0x69, 0xe7,
699 0x8b, 0x33, 0xd5, 0xb2, 0xbd, 0x05, 0x49, 0x49,
700 0x9d, 0x57, 0x73, 0x19, 0x33, 0xae, 0xfa, 0x33,
701 0xf1, 0x19, 0xa8, 0x80, 0xce, 0x04, 0x9f, 0xbc,
702 0x1d, 0x65, 0x82, 0x1b, 0xe5, 0x3a, 0x51, 0xc8,
703 0x1c, 0x21, 0xe3, 0x5d, 0xf3, 0x7d, 0x9b, 0x2f,
704 0x2c, 0x1d, 0x4a, 0x7f, 0x9b, 0x68, 0x35, 0xa3,
705 0xb2, 0x50, 0xf7, 0x62, 0x79, 0xcd, 0xf4, 0x98,
706 0x4f, 0xe5, 0x63, 0x7c, 0x3e, 0x45, 0x31, 0x8c,
707 0x16, 0xa0, 0x12, 0xc8, 0x58, 0xce, 0x39, 0xa6,
708 0xbc, 0x54, 0xdb, 0xc5, 0xe0, 0xd5, 0xba, 0xbc,
709 0xb9, 0x04, 0xf4, 0x8d, 0xe8, 0x2f, 0x15, 0x9d,
710};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711
Bob Pearson3863ef32012-03-23 15:02:22 -0700712/* 100 test cases */
713static struct crc_test {
714 u32 crc; /* random starting crc */
715 u32 start; /* random 6 bit offset in buf */
716 u32 length; /* random 11 bit length of test */
717 u32 crc_le; /* expected crc32_le result */
718 u32 crc_be; /* expected crc32_be result */
719} test[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720{
Bob Pearson3863ef32012-03-23 15:02:22 -0700721 {0x674bf11d, 0x00000038, 0x00000542, 0x0af6d466, 0xd8b6e4c1},
722 {0x35c672c6, 0x0000003a, 0x000001aa, 0xc6d3dfba, 0x28aaf3ad},
723 {0x496da28e, 0x00000039, 0x000005af, 0xd933660f, 0x5d57e81f},
724 {0x09a9b90e, 0x00000027, 0x000001f8, 0xb45fe007, 0xf45fca9a},
725 {0xdc97e5a9, 0x00000025, 0x000003b6, 0xf81a3562, 0xe0126ba2},
726 {0x47c58900, 0x0000000a, 0x000000b9, 0x8e58eccf, 0xf3afc793},
727 {0x292561e8, 0x0000000c, 0x00000403, 0xa2ba8aaf, 0x0b797aed},
728 {0x415037f6, 0x00000003, 0x00000676, 0xa17d52e8, 0x7f0fdf35},
729 {0x3466e707, 0x00000026, 0x00000042, 0x258319be, 0x75c484a2},
730 {0xafd1281b, 0x00000023, 0x000002ee, 0x4428eaf8, 0x06c7ad10},
731 {0xd3857b18, 0x00000028, 0x000004a2, 0x5c430821, 0xb062b7cb},
732 {0x1d825a8f, 0x0000002b, 0x0000050b, 0xd2c45f0c, 0xd68634e0},
733 {0x5033e3bc, 0x0000000b, 0x00000078, 0xa3ea4113, 0xac6d31fb},
734 {0x94f1fb5e, 0x0000000f, 0x000003a2, 0xfbfc50b1, 0x3cfe50ed},
735 {0xc9a0fe14, 0x00000009, 0x00000473, 0x5fb61894, 0x87070591},
736 {0x88a034b1, 0x0000001c, 0x000005ad, 0xc1b16053, 0x46f95c67},
737 {0xf0f72239, 0x00000020, 0x0000026d, 0xa6fa58f3, 0xf8c2c1dd},
738 {0xcc20a5e3, 0x0000003b, 0x0000067a, 0x7740185a, 0x308b979a},
739 {0xce589c95, 0x0000002b, 0x00000641, 0xd055e987, 0x40aae25b},
740 {0x78edc885, 0x00000035, 0x000005be, 0xa39cb14b, 0x035b0d1f},
741 {0x9d40a377, 0x0000003b, 0x00000038, 0x1f47ccd2, 0x197fbc9d},
742 {0x703d0e01, 0x0000003c, 0x000006f1, 0x88735e7c, 0xfed57c5a},
743 {0x776bf505, 0x0000000f, 0x000005b2, 0x5cc4fc01, 0xf32efb97},
744 {0x4a3e7854, 0x00000027, 0x000004b8, 0x8d923c82, 0x0cbfb4a2},
745 {0x209172dd, 0x0000003b, 0x00000356, 0xb89e9c2b, 0xd7868138},
746 {0x3ba4cc5b, 0x0000002f, 0x00000203, 0xe51601a9, 0x5b2a1032},
747 {0xfc62f297, 0x00000000, 0x00000079, 0x71a8e1a2, 0x5d88685f},
748 {0x64280b8b, 0x00000016, 0x000007ab, 0x0fa7a30c, 0xda3a455f},
749 {0x97dd724b, 0x00000033, 0x000007ad, 0x5788b2f4, 0xd7326d32},
750 {0x61394b52, 0x00000035, 0x00000571, 0xc66525f1, 0xcabe7fef},
751 {0x29b4faff, 0x00000024, 0x0000006e, 0xca13751e, 0x993648e0},
752 {0x29bfb1dc, 0x0000000b, 0x00000244, 0x436c43f7, 0x429f7a59},
753 {0x86ae934b, 0x00000035, 0x00000104, 0x0760ec93, 0x9cf7d0f4},
754 {0xc4c1024e, 0x0000002e, 0x000006b1, 0x6516a3ec, 0x19321f9c},
755 {0x3287a80a, 0x00000026, 0x00000496, 0x0b257eb1, 0x754ebd51},
756 {0xa4db423e, 0x00000023, 0x0000045d, 0x9b3a66dc, 0x873e9f11},
757 {0x7a1078df, 0x00000015, 0x0000014a, 0x8c2484c5, 0x6a628659},
758 {0x6048bd5b, 0x00000006, 0x0000006a, 0x897e3559, 0xac9961af},
759 {0xd8f9ea20, 0x0000003d, 0x00000277, 0x60eb905b, 0xed2aaf99},
760 {0xea5ec3b4, 0x0000002a, 0x000004fe, 0x869965dc, 0x6c1f833b},
761 {0x2dfb005d, 0x00000016, 0x00000345, 0x6a3b117e, 0xf05e8521},
762 {0x5a214ade, 0x00000020, 0x000005b6, 0x467f70be, 0xcb22ccd3},
763 {0xf0ab9cca, 0x00000032, 0x00000515, 0xed223df3, 0x7f3ef01d},
764 {0x91b444f9, 0x0000002e, 0x000007f8, 0x84e9a983, 0x5676756f},
765 {0x1b5d2ddb, 0x0000002e, 0x0000012c, 0xba638c4c, 0x3f42047b},
766 {0xd824d1bb, 0x0000003a, 0x000007b5, 0x6288653b, 0x3a3ebea0},
767 {0x0470180c, 0x00000034, 0x000001f0, 0x9d5b80d6, 0x3de08195},
768 {0xffaa3a3f, 0x00000036, 0x00000299, 0xf3a82ab8, 0x53e0c13d},
769 {0x6406cfeb, 0x00000023, 0x00000600, 0xa920b8e8, 0xe4e2acf4},
770 {0xb24aaa38, 0x0000003e, 0x000004a1, 0x657cc328, 0x5077b2c3},
771 {0x58b2ab7c, 0x00000039, 0x000002b4, 0x3a17ee7e, 0x9dcb3643},
772 {0x3db85970, 0x00000006, 0x000002b6, 0x95268b59, 0xb9812c10},
773 {0x857830c5, 0x00000003, 0x00000590, 0x4ef439d5, 0xf042161d},
774 {0xe1fcd978, 0x0000003e, 0x000007d8, 0xae8d8699, 0xce0a1ef5},
775 {0xb982a768, 0x00000016, 0x000006e0, 0x62fad3df, 0x5f8a067b},
776 {0x1d581ce8, 0x0000001e, 0x0000058b, 0xf0f5da53, 0x26e39eee},
777 {0x2456719b, 0x00000025, 0x00000503, 0x4296ac64, 0xd50e4c14},
778 {0xfae6d8f2, 0x00000000, 0x0000055d, 0x057fdf2e, 0x2a31391a},
779 {0xcba828e3, 0x00000039, 0x000002ce, 0xe3f22351, 0x8f00877b},
780 {0x13d25952, 0x0000000a, 0x0000072d, 0x76d4b4cc, 0x5eb67ec3},
781 {0x0342be3f, 0x00000015, 0x00000599, 0xec75d9f1, 0x9d4d2826},
782 {0xeaa344e0, 0x00000014, 0x000004d8, 0x72a4c981, 0x2064ea06},
783 {0xbbb52021, 0x0000003b, 0x00000272, 0x04af99fc, 0xaf042d35},
784 {0xb66384dc, 0x0000001d, 0x000007fc, 0xd7629116, 0x782bd801},
785 {0x616c01b6, 0x00000022, 0x000002c8, 0x5b1dab30, 0x783ce7d2},
786 {0xce2bdaad, 0x00000016, 0x0000062a, 0x932535c8, 0x3f02926d},
787 {0x00fe84d7, 0x00000005, 0x00000205, 0x850e50aa, 0x753d649c},
788 {0xbebdcb4c, 0x00000006, 0x0000055d, 0xbeaa37a2, 0x2d8c9eba},
789 {0xd8b1a02a, 0x00000010, 0x00000387, 0x5017d2fc, 0x503541a5},
790 {0x3b96cad2, 0x00000036, 0x00000347, 0x1d2372ae, 0x926cd90b},
791 {0xc94c1ed7, 0x00000005, 0x0000038b, 0x9e9fdb22, 0x144a9178},
792 {0x1aad454e, 0x00000025, 0x000002b2, 0xc3f6315c, 0x5c7a35b3},
793 {0xa4fec9a6, 0x00000000, 0x000006d6, 0x90be5080, 0xa4107605},
794 {0x1bbe71e2, 0x0000001f, 0x000002fd, 0x4e504c3b, 0x284ccaf1},
795 {0x4201c7e4, 0x00000002, 0x000002b7, 0x7822e3f9, 0x0cc912a9},
796 {0x23fddc96, 0x00000003, 0x00000627, 0x8a385125, 0x07767e78},
797 {0xd82ba25c, 0x00000016, 0x0000063e, 0x98e4148a, 0x283330c9},
798 {0x786f2032, 0x0000002d, 0x0000060f, 0xf201600a, 0xf561bfcd},
799 {0xfebe4e1f, 0x0000002a, 0x000004f2, 0x95e51961, 0xfd80dcab},
800 {0x1a6e0a39, 0x00000008, 0x00000672, 0x8af6c2a5, 0x78dd84cb},
801 {0x56000ab8, 0x0000000e, 0x000000e5, 0x36bacb8f, 0x22ee1f77},
802 {0x4717fe0c, 0x00000000, 0x000006ec, 0x8439f342, 0x5c8e03da},
803 {0xd5d5d68e, 0x0000003c, 0x000003a3, 0x46fff083, 0x177d1b39},
804 {0xc25dd6c6, 0x00000024, 0x000006c0, 0x5ceb8eb4, 0x892b0d16},
805 {0xe9b11300, 0x00000023, 0x00000683, 0x07a5d59a, 0x6c6a3208},
806 {0x95cd285e, 0x00000001, 0x00000047, 0x7b3a4368, 0x0202c07e},
807 {0xd9245a25, 0x0000001e, 0x000003a6, 0xd33c1841, 0x1936c0d5},
808 {0x103279db, 0x00000006, 0x0000039b, 0xca09b8a0, 0x77d62892},
809 {0x1cba3172, 0x00000027, 0x000001c8, 0xcb377194, 0xebe682db},
810 {0x8f613739, 0x0000000c, 0x000001df, 0xb4b0bc87, 0x7710bd43},
811 {0x1c6aa90d, 0x0000001b, 0x0000053c, 0x70559245, 0xda7894ac},
812 {0xaabe5b93, 0x0000003d, 0x00000715, 0xcdbf42fa, 0x0c3b99e7},
813 {0xf15dd038, 0x00000006, 0x000006db, 0x6e104aea, 0x8d5967f2},
814 {0x584dd49c, 0x00000020, 0x000007bc, 0x36b6cfd6, 0xad4e23b2},
815 {0x5d8c9506, 0x00000020, 0x00000470, 0x4c62378e, 0x31d92640},
816 {0xb80d17b0, 0x00000032, 0x00000346, 0x22a5bb88, 0x9a7ec89f},
817 {0xdaf0592e, 0x00000023, 0x000007b0, 0x3cab3f99, 0x9b1fdd99},
818 {0x4793cc85, 0x0000000d, 0x00000706, 0xe82e04f6, 0xed3db6b7},
819 {0x82ebf64e, 0x00000009, 0x000007c3, 0x69d590a9, 0x9efa8499},
820 {0xb18a0319, 0x00000026, 0x000007db, 0x1cf98dcc, 0x8fa9ad6a},
821};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822
Bob Pearson3863ef32012-03-23 15:02:22 -0700823#include <linux/time.h>
824
825static int __init crc32_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826{
Bob Pearson3863ef32012-03-23 15:02:22 -0700827 int i;
828 int errors = 0;
829 int bytes = 0;
830 struct timespec start, stop;
831 u64 nsec;
832 unsigned long flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700833
Bob Pearson3863ef32012-03-23 15:02:22 -0700834 /* keep static to prevent cache warming code from
835 * getting eliminated by the compiler */
836 static u32 crc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837
Bob Pearson3863ef32012-03-23 15:02:22 -0700838 /* pre-warm the cache */
839 for (i = 0; i < 100; i++) {
840 bytes += 2*test[i].length;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700841
Bob Pearson3863ef32012-03-23 15:02:22 -0700842 crc ^= crc32_le(test[i].crc, test_buf +
843 test[i].start, test[i].length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700844
Bob Pearson3863ef32012-03-23 15:02:22 -0700845 crc ^= crc32_be(test[i].crc, test_buf +
846 test[i].start, test[i].length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847 }
848
Bob Pearson3863ef32012-03-23 15:02:22 -0700849 /* reduce OS noise */
850 local_irq_save(flags);
851 local_irq_disable();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852
Bob Pearson3863ef32012-03-23 15:02:22 -0700853 getnstimeofday(&start);
854 for (i = 0; i < 100; i++) {
855 if (test[i].crc_le != crc32_le(test[i].crc, test_buf +
856 test[i].start, test[i].length))
857 errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700858
Bob Pearson3863ef32012-03-23 15:02:22 -0700859 if (test[i].crc_be != crc32_be(test[i].crc, test_buf +
860 test[i].start, test[i].length))
861 errors++;
862 }
863 getnstimeofday(&stop);
864
865 local_irq_restore(flags);
866 local_irq_enable();
867
868 nsec = stop.tv_nsec - start.tv_nsec +
869 1000000000 * (stop.tv_sec - start.tv_sec);
870
871 pr_info("crc32: CRC_LE_BITS = %d, CRC_BE BITS = %d\n",
872 CRC_LE_BITS, CRC_BE_BITS);
873
874 if (errors)
875 pr_warn("crc32: %d self tests failed\n", errors);
876 else {
877 pr_info("crc32: self tests passed, processed %d bytes in %lld nsec\n",
878 bytes, nsec);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700879 }
880
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881 return 0;
882}
883
Bob Pearson3863ef32012-03-23 15:02:22 -0700884static void __exit crc32_exit(void)
885{
886}
887
888module_init(crc32_init);
889module_exit(crc32_exit);
890#endif /* CONFIG_CRC32_SELFTEST */