Back to home page

LXR

 
 

    


0001 /*
0002  * Aug 8, 2011 Bob Pearson with help from Joakim Tjernlund and George Spelvin
0003  * cleaned up code to current version of sparse and added the slicing-by-8
0004  * algorithm to the closely similar existing slicing-by-4 algorithm.
0005  *
0006  * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell.com>
0007  * Nicer crc32 functions/docs submitted by linux@horizon.com.  Thanks!
0008  * Code was from the public domain, copyright abandoned.  Code was
0009  * subsequently included in the kernel, thus was re-licensed under the
0010  * GNU GPL v2.
0011  *
0012  * Oct 12, 2000 Matt Domsch <Matt_Domsch@dell.com>
0013  * Same crc32 function was used in 5 other places in the kernel.
0014  * I made one version, and deleted the others.
0015  * There are various incantations of crc32().  Some use a seed of 0 or ~0.
0016  * Some xor at the end with ~0.  The generic crc32() function takes
0017  * seed as an argument, and doesn't xor at the end.  Then individual
0018  * users can do whatever they need.
0019  *   drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0.
0020  *   fs/jffs2 uses seed 0, doesn't xor with ~0.
0021  *   fs/partitions/efi.c uses seed ~0, xor's with ~0.
0022  *
0023  * This source code is licensed under the GNU General Public License,
0024  * Version 2.  See the file COPYING for more details.
0025  */
0026 
0027 /* see: Documentation/crc32.txt for a description of algorithms */
0028 
0029 #include <linux/crc32.h>
0030 #include <linux/module.h>
0031 #include <linux/types.h>
0032 #include <linux/sched.h>
0033 #include "crc32defs.h"
0034 
0035 #if CRC_LE_BITS > 8
0036 # define tole(x) ((__force u32) cpu_to_le32(x))
0037 #else
0038 # define tole(x) (x)
0039 #endif
0040 
0041 #if CRC_BE_BITS > 8
0042 # define tobe(x) ((__force u32) cpu_to_be32(x))
0043 #else
0044 # define tobe(x) (x)
0045 #endif
0046 
0047 #include "crc32table.h"
0048 
0049 MODULE_AUTHOR("Matt Domsch <Matt_Domsch@dell.com>");
0050 MODULE_DESCRIPTION("Various CRC32 calculations");
0051 MODULE_LICENSE("GPL");
0052 
0053 #if CRC_LE_BITS > 8 || CRC_BE_BITS > 8
0054 
0055 /* implements slicing-by-4 or slicing-by-8 algorithm */
0056 static inline u32 __pure
0057 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
0058 {
0059 # ifdef __LITTLE_ENDIAN
0060 #  define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
0061 #  define DO_CRC4 (t3[(q) & 255] ^ t2[(q >> 8) & 255] ^ \
0062            t1[(q >> 16) & 255] ^ t0[(q >> 24) & 255])
0063 #  define DO_CRC8 (t7[(q) & 255] ^ t6[(q >> 8) & 255] ^ \
0064            t5[(q >> 16) & 255] ^ t4[(q >> 24) & 255])
0065 # else
0066 #  define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
0067 #  define DO_CRC4 (t0[(q) & 255] ^ t1[(q >> 8) & 255] ^ \
0068            t2[(q >> 16) & 255] ^ t3[(q >> 24) & 255])
0069 #  define DO_CRC8 (t4[(q) & 255] ^ t5[(q >> 8) & 255] ^ \
0070            t6[(q >> 16) & 255] ^ t7[(q >> 24) & 255])
0071 # endif
0072     const u32 *b;
0073     size_t    rem_len;
0074 # ifdef CONFIG_X86
0075     size_t i;
0076 # endif
0077     const u32 *t0=tab[0], *t1=tab[1], *t2=tab[2], *t3=tab[3];
0078 # if CRC_LE_BITS != 32
0079     const u32 *t4 = tab[4], *t5 = tab[5], *t6 = tab[6], *t7 = tab[7];
0080 # endif
0081     u32 q;
0082 
0083     /* Align it */
0084     if (unlikely((long)buf & 3 && len)) {
0085         do {
0086             DO_CRC(*buf++);
0087         } while ((--len) && ((long)buf)&3);
0088     }
0089 
0090 # if CRC_LE_BITS == 32
0091     rem_len = len & 3;
0092     len = len >> 2;
0093 # else
0094     rem_len = len & 7;
0095     len = len >> 3;
0096 # endif
0097 
0098     b = (const u32 *)buf;
0099 # ifdef CONFIG_X86
0100     --b;
0101     for (i = 0; i < len; i++) {
0102 # else
0103     for (--b; len; --len) {
0104 # endif
0105         q = crc ^ *++b; /* use pre increment for speed */
0106 # if CRC_LE_BITS == 32
0107         crc = DO_CRC4;
0108 # else
0109         crc = DO_CRC8;
0110         q = *++b;
0111         crc ^= DO_CRC4;
0112 # endif
0113     }
0114     len = rem_len;
0115     /* And the last few bytes */
0116     if (len) {
0117         u8 *p = (u8 *)(b + 1) - 1;
0118 # ifdef CONFIG_X86
0119         for (i = 0; i < len; i++)
0120             DO_CRC(*++p); /* use pre increment for speed */
0121 # else
0122         do {
0123             DO_CRC(*++p); /* use pre increment for speed */
0124         } while (--len);
0125 # endif
0126     }
0127     return crc;
0128 #undef DO_CRC
0129 #undef DO_CRC4
0130 #undef DO_CRC8
0131 }
0132 #endif
0133 
0134 
0135 /**
0136  * crc32_le_generic() - Calculate bitwise little-endian Ethernet AUTODIN II
0137  *          CRC32/CRC32C
0138  * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for other
0139  *   uses, or the previous crc32/crc32c value if computing incrementally.
0140  * @p: pointer to buffer over which CRC32/CRC32C is run
0141  * @len: length of buffer @p
0142  * @tab: little-endian Ethernet table
0143  * @polynomial: CRC32/CRC32c LE polynomial
0144  */
0145 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p,
0146                       size_t len, const u32 (*tab)[256],
0147                       u32 polynomial)
0148 {
0149 #if CRC_LE_BITS == 1
0150     int i;
0151     while (len--) {
0152         crc ^= *p++;
0153         for (i = 0; i < 8; i++)
0154             crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0);
0155     }
0156 # elif CRC_LE_BITS == 2
0157     while (len--) {
0158         crc ^= *p++;
0159         crc = (crc >> 2) ^ tab[0][crc & 3];
0160         crc = (crc >> 2) ^ tab[0][crc & 3];
0161         crc = (crc >> 2) ^ tab[0][crc & 3];
0162         crc = (crc >> 2) ^ tab[0][crc & 3];
0163     }
0164 # elif CRC_LE_BITS == 4
0165     while (len--) {
0166         crc ^= *p++;
0167         crc = (crc >> 4) ^ tab[0][crc & 15];
0168         crc = (crc >> 4) ^ tab[0][crc & 15];
0169     }
0170 # elif CRC_LE_BITS == 8
0171     /* aka Sarwate algorithm */
0172     while (len--) {
0173         crc ^= *p++;
0174         crc = (crc >> 8) ^ tab[0][crc & 255];
0175     }
0176 # else
0177     crc = (__force u32) __cpu_to_le32(crc);
0178     crc = crc32_body(crc, p, len, tab);
0179     crc = __le32_to_cpu((__force __le32)crc);
0180 #endif
0181     return crc;
0182 }
0183 
0184 #if CRC_LE_BITS == 1
0185 u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
0186 {
0187     return crc32_le_generic(crc, p, len, NULL, CRCPOLY_LE);
0188 }
0189 u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len)
0190 {
0191     return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE);
0192 }
0193 #else
0194 u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
0195 {
0196     return crc32_le_generic(crc, p, len,
0197             (const u32 (*)[256])crc32table_le, CRCPOLY_LE);
0198 }
0199 u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len)
0200 {
0201     return crc32_le_generic(crc, p, len,
0202             (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
0203 }
0204 #endif
0205 EXPORT_SYMBOL(crc32_le);
0206 EXPORT_SYMBOL(__crc32c_le);
0207 
0208 /*
0209  * This multiplies the polynomials x and y modulo the given modulus.
0210  * This follows the "little-endian" CRC convention that the lsbit
0211  * represents the highest power of x, and the msbit represents x^0.
0212  */
0213 static u32 __attribute_const__ gf2_multiply(u32 x, u32 y, u32 modulus)
0214 {
0215     u32 product = x & 1 ? y : 0;
0216     int i;
0217 
0218     for (i = 0; i < 31; i++) {
0219         product = (product >> 1) ^ (product & 1 ? modulus : 0);
0220         x >>= 1;
0221         product ^= x & 1 ? y : 0;
0222     }
0223 
0224     return product;
0225 }
0226 
0227 /**
0228  * crc32_generic_shift - Append len 0 bytes to crc, in logarithmic time
0229  * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
0230  * @len: The number of bytes. @crc is multiplied by x^(8*@len)
0231  * @polynomial: The modulus used to reduce the result to 32 bits.
0232  *
0233  * It's possible to parallelize CRC computations by computing a CRC
0234  * over separate ranges of a buffer, then summing them.
0235  * This shifts the given CRC by 8*len bits (i.e. produces the same effect
0236  * as appending len bytes of zero to the data), in time proportional
0237  * to log(len).
0238  */
0239 static u32 __attribute_const__ crc32_generic_shift(u32 crc, size_t len,
0240                            u32 polynomial)
0241 {
0242     u32 power = polynomial; /* CRC of x^32 */
0243     int i;
0244 
0245     /* Shift up to 32 bits in the simple linear way */
0246     for (i = 0; i < 8 * (int)(len & 3); i++)
0247         crc = (crc >> 1) ^ (crc & 1 ? polynomial : 0);
0248 
0249     len >>= 2;
0250     if (!len)
0251         return crc;
0252 
0253     for (;;) {
0254         /* "power" is x^(2^i), modulo the polynomial */
0255         if (len & 1)
0256             crc = gf2_multiply(crc, power, polynomial);
0257 
0258         len >>= 1;
0259         if (!len)
0260             break;
0261 
0262         /* Square power, advancing to x^(2^(i+1)) */
0263         power = gf2_multiply(power, power, polynomial);
0264     }
0265 
0266     return crc;
0267 }
0268 
0269 u32 __attribute_const__ crc32_le_shift(u32 crc, size_t len)
0270 {
0271     return crc32_generic_shift(crc, len, CRCPOLY_LE);
0272 }
0273 
0274 u32 __attribute_const__ __crc32c_le_shift(u32 crc, size_t len)
0275 {
0276     return crc32_generic_shift(crc, len, CRC32C_POLY_LE);
0277 }
0278 EXPORT_SYMBOL(crc32_le_shift);
0279 EXPORT_SYMBOL(__crc32c_le_shift);
0280 
0281 /**
0282  * crc32_be_generic() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32
0283  * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for
0284  *  other uses, or the previous crc32 value if computing incrementally.
0285  * @p: pointer to buffer over which CRC32 is run
0286  * @len: length of buffer @p
0287  * @tab: big-endian Ethernet table
0288  * @polynomial: CRC32 BE polynomial
0289  */
0290 static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p,
0291                       size_t len, const u32 (*tab)[256],
0292                       u32 polynomial)
0293 {
0294 #if CRC_BE_BITS == 1
0295     int i;
0296     while (len--) {
0297         crc ^= *p++ << 24;
0298         for (i = 0; i < 8; i++)
0299             crc =
0300                 (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
0301                       0);
0302     }
0303 # elif CRC_BE_BITS == 2
0304     while (len--) {
0305         crc ^= *p++ << 24;
0306         crc = (crc << 2) ^ tab[0][crc >> 30];
0307         crc = (crc << 2) ^ tab[0][crc >> 30];
0308         crc = (crc << 2) ^ tab[0][crc >> 30];
0309         crc = (crc << 2) ^ tab[0][crc >> 30];
0310     }
0311 # elif CRC_BE_BITS == 4
0312     while (len--) {
0313         crc ^= *p++ << 24;
0314         crc = (crc << 4) ^ tab[0][crc >> 28];
0315         crc = (crc << 4) ^ tab[0][crc >> 28];
0316     }
0317 # elif CRC_BE_BITS == 8
0318     while (len--) {
0319         crc ^= *p++ << 24;
0320         crc = (crc << 8) ^ tab[0][crc >> 24];
0321     }
0322 # else
0323     crc = (__force u32) __cpu_to_be32(crc);
0324     crc = crc32_body(crc, p, len, tab);
0325     crc = __be32_to_cpu((__force __be32)crc);
0326 # endif
0327     return crc;
0328 }
0329 
0330 #if CRC_LE_BITS == 1
0331 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
0332 {
0333     return crc32_be_generic(crc, p, len, NULL, CRCPOLY_BE);
0334 }
0335 #else
0336 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
0337 {
0338     return crc32_be_generic(crc, p, len,
0339             (const u32 (*)[256])crc32table_be, CRCPOLY_BE);
0340 }
0341 #endif
0342 EXPORT_SYMBOL(crc32_be);
0343 
0344 #ifdef CONFIG_CRC32_SELFTEST
0345 
0346 /* 4096 random bytes */
0347 static u8 const __aligned(8) test_buf[] __initconst =
0348 {
0349     0x5b, 0x85, 0x21, 0xcb, 0x09, 0x68, 0x7d, 0x30,
0350     0xc7, 0x69, 0xd7, 0x30, 0x92, 0xde, 0x59, 0xe4,
0351     0xc9, 0x6e, 0x8b, 0xdb, 0x98, 0x6b, 0xaa, 0x60,
0352     0xa8, 0xb5, 0xbc, 0x6c, 0xa9, 0xb1, 0x5b, 0x2c,
0353     0xea, 0xb4, 0x92, 0x6a, 0x3f, 0x79, 0x91, 0xe4,
0354     0xe9, 0x70, 0x51, 0x8c, 0x7f, 0x95, 0x6f, 0x1a,
0355     0x56, 0xa1, 0x5c, 0x27, 0x03, 0x67, 0x9f, 0x3a,
0356     0xe2, 0x31, 0x11, 0x29, 0x6b, 0x98, 0xfc, 0xc4,
0357     0x53, 0x24, 0xc5, 0x8b, 0xce, 0x47, 0xb2, 0xb9,
0358     0x32, 0xcb, 0xc1, 0xd0, 0x03, 0x57, 0x4e, 0xd4,
0359     0xe9, 0x3c, 0xa1, 0x63, 0xcf, 0x12, 0x0e, 0xca,
0360     0xe1, 0x13, 0xd1, 0x93, 0xa6, 0x88, 0x5c, 0x61,
0361     0x5b, 0xbb, 0xf0, 0x19, 0x46, 0xb4, 0xcf, 0x9e,
0362     0xb6, 0x6b, 0x4c, 0x3a, 0xcf, 0x60, 0xf9, 0x7a,
0363     0x8d, 0x07, 0x63, 0xdb, 0x40, 0xe9, 0x0b, 0x6f,
0364     0xad, 0x97, 0xf1, 0xed, 0xd0, 0x1e, 0x26, 0xfd,
0365     0xbf, 0xb7, 0xc8, 0x04, 0x94, 0xf8, 0x8b, 0x8c,
0366     0xf1, 0xab, 0x7a, 0xd4, 0xdd, 0xf3, 0xe8, 0x88,
0367     0xc3, 0xed, 0x17, 0x8a, 0x9b, 0x40, 0x0d, 0x53,
0368     0x62, 0x12, 0x03, 0x5f, 0x1b, 0x35, 0x32, 0x1f,
0369     0xb4, 0x7b, 0x93, 0x78, 0x0d, 0xdb, 0xce, 0xa4,
0370     0xc0, 0x47, 0xd5, 0xbf, 0x68, 0xe8, 0x5d, 0x74,
0371     0x8f, 0x8e, 0x75, 0x1c, 0xb2, 0x4f, 0x9a, 0x60,
0372     0xd1, 0xbe, 0x10, 0xf4, 0x5c, 0xa1, 0x53, 0x09,
0373     0xa5, 0xe0, 0x09, 0x54, 0x85, 0x5c, 0xdc, 0x07,
0374     0xe7, 0x21, 0x69, 0x7b, 0x8a, 0xfd, 0x90, 0xf1,
0375     0x22, 0xd0, 0xb4, 0x36, 0x28, 0xe6, 0xb8, 0x0f,
0376     0x39, 0xde, 0xc8, 0xf3, 0x86, 0x60, 0x34, 0xd2,
0377     0x5e, 0xdf, 0xfd, 0xcf, 0x0f, 0xa9, 0x65, 0xf0,
0378     0xd5, 0x4d, 0x96, 0x40, 0xe3, 0xdf, 0x3f, 0x95,
0379     0x5a, 0x39, 0x19, 0x93, 0xf4, 0x75, 0xce, 0x22,
0380     0x00, 0x1c, 0x93, 0xe2, 0x03, 0x66, 0xf4, 0x93,
0381     0x73, 0x86, 0x81, 0x8e, 0x29, 0x44, 0x48, 0x86,
0382     0x61, 0x7c, 0x48, 0xa3, 0x43, 0xd2, 0x9c, 0x8d,
0383     0xd4, 0x95, 0xdd, 0xe1, 0x22, 0x89, 0x3a, 0x40,
0384     0x4c, 0x1b, 0x8a, 0x04, 0xa8, 0x09, 0x69, 0x8b,
0385     0xea, 0xc6, 0x55, 0x8e, 0x57, 0xe6, 0x64, 0x35,
0386     0xf0, 0xc7, 0x16, 0x9f, 0x5d, 0x5e, 0x86, 0x40,
0387     0x46, 0xbb, 0xe5, 0x45, 0x88, 0xfe, 0xc9, 0x63,
0388     0x15, 0xfb, 0xf5, 0xbd, 0x71, 0x61, 0xeb, 0x7b,
0389     0x78, 0x70, 0x07, 0x31, 0x03, 0x9f, 0xb2, 0xc8,
0390     0xa7, 0xab, 0x47, 0xfd, 0xdf, 0xa0, 0x78, 0x72,
0391     0xa4, 0x2a, 0xe4, 0xb6, 0xba, 0xc0, 0x1e, 0x86,
0392     0x71, 0xe6, 0x3d, 0x18, 0x37, 0x70, 0xe6, 0xff,
0393     0xe0, 0xbc, 0x0b, 0x22, 0xa0, 0x1f, 0xd3, 0xed,
0394     0xa2, 0x55, 0x39, 0xab, 0xa8, 0x13, 0x73, 0x7c,
0395     0x3f, 0xb2, 0xd6, 0x19, 0xac, 0xff, 0x99, 0xed,
0396     0xe8, 0xe6, 0xa6, 0x22, 0xe3, 0x9c, 0xf1, 0x30,
0397     0xdc, 0x01, 0x0a, 0x56, 0xfa, 0xe4, 0xc9, 0x99,
0398     0xdd, 0xa8, 0xd8, 0xda, 0x35, 0x51, 0x73, 0xb4,
0399     0x40, 0x86, 0x85, 0xdb, 0x5c, 0xd5, 0x85, 0x80,
0400     0x14, 0x9c, 0xfd, 0x98, 0xa9, 0x82, 0xc5, 0x37,
0401     0xff, 0x32, 0x5d, 0xd0, 0x0b, 0xfa, 0xdc, 0x04,
0402     0x5e, 0x09, 0xd2, 0xca, 0x17, 0x4b, 0x1a, 0x8e,
0403     0x15, 0xe1, 0xcc, 0x4e, 0x52, 0x88, 0x35, 0xbd,
0404     0x48, 0xfe, 0x15, 0xa0, 0x91, 0xfd, 0x7e, 0x6c,
0405     0x0e, 0x5d, 0x79, 0x1b, 0x81, 0x79, 0xd2, 0x09,
0406     0x34, 0x70, 0x3d, 0x81, 0xec, 0xf6, 0x24, 0xbb,
0407     0xfb, 0xf1, 0x7b, 0xdf, 0x54, 0xea, 0x80, 0x9b,
0408     0xc7, 0x99, 0x9e, 0xbd, 0x16, 0x78, 0x12, 0x53,
0409     0x5e, 0x01, 0xa7, 0x4e, 0xbd, 0x67, 0xe1, 0x9b,
0410     0x4c, 0x0e, 0x61, 0x45, 0x97, 0xd2, 0xf0, 0x0f,
0411     0xfe, 0x15, 0x08, 0xb7, 0x11, 0x4c, 0xe7, 0xff,
0412     0x81, 0x53, 0xff, 0x91, 0x25, 0x38, 0x7e, 0x40,
0413     0x94, 0xe5, 0xe0, 0xad, 0xe6, 0xd9, 0x79, 0xb6,
0414     0x92, 0xc9, 0xfc, 0xde, 0xc3, 0x1a, 0x23, 0xbb,
0415     0xdd, 0xc8, 0x51, 0x0c, 0x3a, 0x72, 0xfa, 0x73,
0416     0x6f, 0xb7, 0xee, 0x61, 0x39, 0x03, 0x01, 0x3f,
0417     0x7f, 0x94, 0x2e, 0x2e, 0xba, 0x3a, 0xbb, 0xb4,
0418     0xfa, 0x6a, 0x17, 0xfe, 0xea, 0xef, 0x5e, 0x66,
0419     0x97, 0x3f, 0x32, 0x3d, 0xd7, 0x3e, 0xb1, 0xf1,
0420     0x6c, 0x14, 0x4c, 0xfd, 0x37, 0xd3, 0x38, 0x80,
0421     0xfb, 0xde, 0xa6, 0x24, 0x1e, 0xc8, 0xca, 0x7f,
0422     0x3a, 0x93, 0xd8, 0x8b, 0x18, 0x13, 0xb2, 0xe5,
0423     0xe4, 0x93, 0x05, 0x53, 0x4f, 0x84, 0x66, 0xa7,
0424     0x58, 0x5c, 0x7b, 0x86, 0x52, 0x6d, 0x0d, 0xce,
0425     0xa4, 0x30, 0x7d, 0xb6, 0x18, 0x9f, 0xeb, 0xff,
0426     0x22, 0xbb, 0x72, 0x29, 0xb9, 0x44, 0x0b, 0x48,
0427     0x1e, 0x84, 0x71, 0x81, 0xe3, 0x6d, 0x73, 0x26,
0428     0x92, 0xb4, 0x4d, 0x2a, 0x29, 0xb8, 0x1f, 0x72,
0429     0xed, 0xd0, 0xe1, 0x64, 0x77, 0xea, 0x8e, 0x88,
0430     0x0f, 0xef, 0x3f, 0xb1, 0x3b, 0xad, 0xf9, 0xc9,
0431     0x8b, 0xd0, 0xac, 0xc6, 0xcc, 0xa9, 0x40, 0xcc,
0432     0x76, 0xf6, 0x3b, 0x53, 0xb5, 0x88, 0xcb, 0xc8,
0433     0x37, 0xf1, 0xa2, 0xba, 0x23, 0x15, 0x99, 0x09,
0434     0xcc, 0xe7, 0x7a, 0x3b, 0x37, 0xf7, 0x58, 0xc8,
0435     0x46, 0x8c, 0x2b, 0x2f, 0x4e, 0x0e, 0xa6, 0x5c,
0436     0xea, 0x85, 0x55, 0xba, 0x02, 0x0e, 0x0e, 0x48,
0437     0xbc, 0xe1, 0xb1, 0x01, 0x35, 0x79, 0x13, 0x3d,
0438     0x1b, 0xc0, 0x53, 0x68, 0x11, 0xe7, 0x95, 0x0f,
0439     0x9d, 0x3f, 0x4c, 0x47, 0x7b, 0x4d, 0x1c, 0xae,
0440     0x50, 0x9b, 0xcb, 0xdd, 0x05, 0x8d, 0x9a, 0x97,
0441     0xfd, 0x8c, 0xef, 0x0c, 0x1d, 0x67, 0x73, 0xa8,
0442     0x28, 0x36, 0xd5, 0xb6, 0x92, 0x33, 0x40, 0x75,
0443     0x0b, 0x51, 0xc3, 0x64, 0xba, 0x1d, 0xc2, 0xcc,
0444     0xee, 0x7d, 0x54, 0x0f, 0x27, 0x69, 0xa7, 0x27,
0445     0x63, 0x30, 0x29, 0xd9, 0xc8, 0x84, 0xd8, 0xdf,
0446     0x9f, 0x68, 0x8d, 0x04, 0xca, 0xa6, 0xc5, 0xc7,
0447     0x7a, 0x5c, 0xc8, 0xd1, 0xcb, 0x4a, 0xec, 0xd0,
0448     0xd8, 0x20, 0x69, 0xc5, 0x17, 0xcd, 0x78, 0xc8,
0449     0x75, 0x23, 0x30, 0x69, 0xc9, 0xd4, 0xea, 0x5c,
0450     0x4f, 0x6b, 0x86, 0x3f, 0x8b, 0xfe, 0xee, 0x44,
0451     0xc9, 0x7c, 0xb7, 0xdd, 0x3e, 0xe5, 0xec, 0x54,
0452     0x03, 0x3e, 0xaa, 0x82, 0xc6, 0xdf, 0xb2, 0x38,
0453     0x0e, 0x5d, 0xb3, 0x88, 0xd9, 0xd3, 0x69, 0x5f,
0454     0x8f, 0x70, 0x8a, 0x7e, 0x11, 0xd9, 0x1e, 0x7b,
0455     0x38, 0xf1, 0x42, 0x1a, 0xc0, 0x35, 0xf5, 0xc7,
0456     0x36, 0x85, 0xf5, 0xf7, 0xb8, 0x7e, 0xc7, 0xef,
0457     0x18, 0xf1, 0x63, 0xd6, 0x7a, 0xc6, 0xc9, 0x0e,
0458     0x4d, 0x69, 0x4f, 0x84, 0xef, 0x26, 0x41, 0x0c,
0459     0xec, 0xc7, 0xe0, 0x7e, 0x3c, 0x67, 0x01, 0x4c,
0460     0x62, 0x1a, 0x20, 0x6f, 0xee, 0x47, 0x4d, 0xc0,
0461     0x99, 0x13, 0x8d, 0x91, 0x4a, 0x26, 0xd4, 0x37,
0462     0x28, 0x90, 0x58, 0x75, 0x66, 0x2b, 0x0a, 0xdf,
0463     0xda, 0xee, 0x92, 0x25, 0x90, 0x62, 0x39, 0x9e,
0464     0x44, 0x98, 0xad, 0xc1, 0x88, 0xed, 0xe4, 0xb4,
0465     0xaf, 0xf5, 0x8c, 0x9b, 0x48, 0x4d, 0x56, 0x60,
0466     0x97, 0x0f, 0x61, 0x59, 0x9e, 0xa6, 0x27, 0xfe,
0467     0xc1, 0x91, 0x15, 0x38, 0xb8, 0x0f, 0xae, 0x61,
0468     0x7d, 0x26, 0x13, 0x5a, 0x73, 0xff, 0x1c, 0xa3,
0469     0x61, 0x04, 0x58, 0x48, 0x55, 0x44, 0x11, 0xfe,
0470     0x15, 0xca, 0xc3, 0xbd, 0xca, 0xc5, 0xb4, 0x40,
0471     0x5d, 0x1b, 0x7f, 0x39, 0xb5, 0x9c, 0x35, 0xec,
0472     0x61, 0x15, 0x32, 0x32, 0xb8, 0x4e, 0x40, 0x9f,
0473     0x17, 0x1f, 0x0a, 0x4d, 0xa9, 0x91, 0xef, 0xb7,
0474     0xb0, 0xeb, 0xc2, 0x83, 0x9a, 0x6c, 0xd2, 0x79,
0475     0x43, 0x78, 0x5e, 0x2f, 0xe5, 0xdd, 0x1a, 0x3c,
0476     0x45, 0xab, 0x29, 0x40, 0x3a, 0x37, 0x5b, 0x6f,
0477     0xd7, 0xfc, 0x48, 0x64, 0x3c, 0x49, 0xfb, 0x21,
0478     0xbe, 0xc3, 0xff, 0x07, 0xfb, 0x17, 0xe9, 0xc9,
0479     0x0c, 0x4c, 0x5c, 0x15, 0x9e, 0x8e, 0x22, 0x30,
0480     0x0a, 0xde, 0x48, 0x7f, 0xdb, 0x0d, 0xd1, 0x2b,
0481     0x87, 0x38, 0x9e, 0xcc, 0x5a, 0x01, 0x16, 0xee,
0482     0x75, 0x49, 0x0d, 0x30, 0x01, 0x34, 0x6a, 0xb6,
0483     0x9a, 0x5a, 0x2a, 0xec, 0xbb, 0x48, 0xac, 0xd3,
0484     0x77, 0x83, 0xd8, 0x08, 0x86, 0x4f, 0x48, 0x09,
0485     0x29, 0x41, 0x79, 0xa1, 0x03, 0x12, 0xc4, 0xcd,
0486     0x90, 0x55, 0x47, 0x66, 0x74, 0x9a, 0xcc, 0x4f,
0487     0x35, 0x8c, 0xd6, 0x98, 0xef, 0xeb, 0x45, 0xb9,
0488     0x9a, 0x26, 0x2f, 0x39, 0xa5, 0x70, 0x6d, 0xfc,
0489     0xb4, 0x51, 0xee, 0xf4, 0x9c, 0xe7, 0x38, 0x59,
0490     0xad, 0xf4, 0xbc, 0x46, 0xff, 0x46, 0x8e, 0x60,
0491     0x9c, 0xa3, 0x60, 0x1d, 0xf8, 0x26, 0x72, 0xf5,
0492     0x72, 0x9d, 0x68, 0x80, 0x04, 0xf6, 0x0b, 0xa1,
0493     0x0a, 0xd5, 0xa7, 0x82, 0x3a, 0x3e, 0x47, 0xa8,
0494     0x5a, 0xde, 0x59, 0x4f, 0x7b, 0x07, 0xb3, 0xe9,
0495     0x24, 0x19, 0x3d, 0x34, 0x05, 0xec, 0xf1, 0xab,
0496     0x6e, 0x64, 0x8f, 0xd3, 0xe6, 0x41, 0x86, 0x80,
0497     0x70, 0xe3, 0x8d, 0x60, 0x9c, 0x34, 0x25, 0x01,
0498     0x07, 0x4d, 0x19, 0x41, 0x4e, 0x3d, 0x5c, 0x7e,
0499     0xa8, 0xf5, 0xcc, 0xd5, 0x7b, 0xe2, 0x7d, 0x3d,
0500     0x49, 0x86, 0x7d, 0x07, 0xb7, 0x10, 0xe3, 0x35,
0501     0xb8, 0x84, 0x6d, 0x76, 0xab, 0x17, 0xc6, 0x38,
0502     0xb4, 0xd3, 0x28, 0x57, 0xad, 0xd3, 0x88, 0x5a,
0503     0xda, 0xea, 0xc8, 0x94, 0xcc, 0x37, 0x19, 0xac,
0504     0x9c, 0x9f, 0x4b, 0x00, 0x15, 0xc0, 0xc8, 0xca,
0505     0x1f, 0x15, 0xaa, 0xe0, 0xdb, 0xf9, 0x2f, 0x57,
0506     0x1b, 0x24, 0xc7, 0x6f, 0x76, 0x29, 0xfb, 0xed,
0507     0x25, 0x0d, 0xc0, 0xfe, 0xbd, 0x5a, 0xbf, 0x20,
0508     0x08, 0x51, 0x05, 0xec, 0x71, 0xa3, 0xbf, 0xef,
0509     0x5e, 0x99, 0x75, 0xdb, 0x3c, 0x5f, 0x9a, 0x8c,
0510     0xbb, 0x19, 0x5c, 0x0e, 0x93, 0x19, 0xf8, 0x6a,
0511     0xbc, 0xf2, 0x12, 0x54, 0x2f, 0xcb, 0x28, 0x64,
0512     0x88, 0xb3, 0x92, 0x0d, 0x96, 0xd1, 0xa6, 0xe4,
0513     0x1f, 0xf1, 0x4d, 0xa4, 0xab, 0x1c, 0xee, 0x54,
0514     0xf2, 0xad, 0x29, 0x6d, 0x32, 0x37, 0xb2, 0x16,
0515     0x77, 0x5c, 0xdc, 0x2e, 0x54, 0xec, 0x75, 0x26,
0516     0xc6, 0x36, 0xd9, 0x17, 0x2c, 0xf1, 0x7a, 0xdc,
0517     0x4b, 0xf1, 0xe2, 0xd9, 0x95, 0xba, 0xac, 0x87,
0518     0xc1, 0xf3, 0x8e, 0x58, 0x08, 0xd8, 0x87, 0x60,
0519     0xc9, 0xee, 0x6a, 0xde, 0xa4, 0xd2, 0xfc, 0x0d,
0520     0xe5, 0x36, 0xc4, 0x5c, 0x52, 0xb3, 0x07, 0x54,
0521     0x65, 0x24, 0xc1, 0xb1, 0xd1, 0xb1, 0x53, 0x13,
0522     0x31, 0x79, 0x7f, 0x05, 0x76, 0xeb, 0x37, 0x59,
0523     0x15, 0x2b, 0xd1, 0x3f, 0xac, 0x08, 0x97, 0xeb,
0524     0x91, 0x98, 0xdf, 0x6c, 0x09, 0x0d, 0x04, 0x9f,
0525     0xdc, 0x3b, 0x0e, 0x60, 0x68, 0x47, 0x23, 0x15,
0526     0x16, 0xc6, 0x0b, 0x35, 0xf8, 0x77, 0xa2, 0x78,
0527     0x50, 0xd4, 0x64, 0x22, 0x33, 0xff, 0xfb, 0x93,
0528     0x71, 0x46, 0x50, 0x39, 0x1b, 0x9c, 0xea, 0x4e,
0529     0x8d, 0x0c, 0x37, 0xe5, 0x5c, 0x51, 0x3a, 0x31,
0530     0xb2, 0x85, 0x84, 0x3f, 0x41, 0xee, 0xa2, 0xc1,
0531     0xc6, 0x13, 0x3b, 0x54, 0x28, 0xd2, 0x18, 0x37,
0532     0xcc, 0x46, 0x9f, 0x6a, 0x91, 0x3d, 0x5a, 0x15,
0533     0x3c, 0x89, 0xa3, 0x61, 0x06, 0x7d, 0x2e, 0x78,
0534     0xbe, 0x7d, 0x40, 0xba, 0x2f, 0x95, 0xb1, 0x2f,
0535     0x87, 0x3b, 0x8a, 0xbe, 0x6a, 0xf4, 0xc2, 0x31,
0536     0x74, 0xee, 0x91, 0xe0, 0x23, 0xaa, 0x5d, 0x7f,
0537     0xdd, 0xf0, 0x44, 0x8c, 0x0b, 0x59, 0x2b, 0xfc,
0538     0x48, 0x3a, 0xdf, 0x07, 0x05, 0x38, 0x6c, 0xc9,
0539     0xeb, 0x18, 0x24, 0x68, 0x8d, 0x58, 0x98, 0xd3,
0540     0x31, 0xa3, 0xe4, 0x70, 0x59, 0xb1, 0x21, 0xbe,
0541     0x7e, 0x65, 0x7d, 0xb8, 0x04, 0xab, 0xf6, 0xe4,
0542     0xd7, 0xda, 0xec, 0x09, 0x8f, 0xda, 0x6d, 0x24,
0543     0x07, 0xcc, 0x29, 0x17, 0x05, 0x78, 0x1a, 0xc1,
0544     0xb1, 0xce, 0xfc, 0xaa, 0x2d, 0xe7, 0xcc, 0x85,
0545     0x84, 0x84, 0x03, 0x2a, 0x0c, 0x3f, 0xa9, 0xf8,
0546     0xfd, 0x84, 0x53, 0x59, 0x5c, 0xf0, 0xd4, 0x09,
0547     0xf0, 0xd2, 0x6c, 0x32, 0x03, 0xb0, 0xa0, 0x8c,
0548     0x52, 0xeb, 0x23, 0x91, 0x88, 0x43, 0x13, 0x46,
0549     0xf6, 0x1e, 0xb4, 0x1b, 0xf5, 0x8e, 0x3a, 0xb5,
0550     0x3d, 0x00, 0xf6, 0xe5, 0x08, 0x3d, 0x5f, 0x39,
0551     0xd3, 0x21, 0x69, 0xbc, 0x03, 0x22, 0x3a, 0xd2,
0552     0x5c, 0x84, 0xf8, 0x15, 0xc4, 0x80, 0x0b, 0xbc,
0553     0x29, 0x3c, 0xf3, 0x95, 0x98, 0xcd, 0x8f, 0x35,
0554     0xbc, 0xa5, 0x3e, 0xfc, 0xd4, 0x13, 0x9e, 0xde,
0555     0x4f, 0xce, 0x71, 0x9d, 0x09, 0xad, 0xf2, 0x80,
0556     0x6b, 0x65, 0x7f, 0x03, 0x00, 0x14, 0x7c, 0x15,
0557     0x85, 0x40, 0x6d, 0x70, 0xea, 0xdc, 0xb3, 0x63,
0558     0x35, 0x4f, 0x4d, 0xe0, 0xd9, 0xd5, 0x3c, 0x58,
0559     0x56, 0x23, 0x80, 0xe2, 0x36, 0xdd, 0x75, 0x1d,
0560     0x94, 0x11, 0x41, 0x8e, 0xe0, 0x81, 0x8e, 0xcf,
0561     0xe0, 0xe5, 0xf6, 0xde, 0xd1, 0xe7, 0x04, 0x12,
0562     0x79, 0x92, 0x2b, 0x71, 0x2a, 0x79, 0x8b, 0x7c,
0563     0x44, 0x79, 0x16, 0x30, 0x4e, 0xf4, 0xf6, 0x9b,
0564     0xb7, 0x40, 0xa3, 0x5a, 0xa7, 0x69, 0x3e, 0xc1,
0565     0x3a, 0x04, 0xd0, 0x88, 0xa0, 0x3b, 0xdd, 0xc6,
0566     0x9e, 0x7e, 0x1e, 0x1e, 0x8f, 0x44, 0xf7, 0x73,
0567     0x67, 0x1e, 0x1a, 0x78, 0xfa, 0x62, 0xf4, 0xa9,
0568     0xa8, 0xc6, 0x5b, 0xb8, 0xfa, 0x06, 0x7d, 0x5e,
0569     0x38, 0x1c, 0x9a, 0x39, 0xe9, 0x39, 0x98, 0x22,
0570     0x0b, 0xa7, 0xac, 0x0b, 0xf3, 0xbc, 0xf1, 0xeb,
0571     0x8c, 0x81, 0xe3, 0x48, 0x8a, 0xed, 0x42, 0xc2,
0572     0x38, 0xcf, 0x3e, 0xda, 0xd2, 0x89, 0x8d, 0x9c,
0573     0x53, 0xb5, 0x2f, 0x41, 0x01, 0x26, 0x84, 0x9c,
0574     0xa3, 0x56, 0xf6, 0x49, 0xc7, 0xd4, 0x9f, 0x93,
0575     0x1b, 0x96, 0x49, 0x5e, 0xad, 0xb3, 0x84, 0x1f,
0576     0x3c, 0xa4, 0xe0, 0x9b, 0xd1, 0x90, 0xbc, 0x38,
0577     0x6c, 0xdd, 0x95, 0x4d, 0x9d, 0xb1, 0x71, 0x57,
0578     0x2d, 0x34, 0xe8, 0xb8, 0x42, 0xc7, 0x99, 0x03,
0579     0xc7, 0x07, 0x30, 0x65, 0x91, 0x55, 0xd5, 0x90,
0580     0x70, 0x97, 0x37, 0x68, 0xd4, 0x11, 0xf9, 0xe8,
0581     0xce, 0xec, 0xdc, 0x34, 0xd5, 0xd3, 0xb7, 0xc4,
0582     0xb8, 0x97, 0x05, 0x92, 0xad, 0xf8, 0xe2, 0x36,
0583     0x64, 0x41, 0xc9, 0xc5, 0x41, 0x77, 0x52, 0xd7,
0584     0x2c, 0xa5, 0x24, 0x2f, 0xd9, 0x34, 0x0b, 0x47,
0585     0x35, 0xa7, 0x28, 0x8b, 0xc5, 0xcd, 0xe9, 0x46,
0586     0xac, 0x39, 0x94, 0x3c, 0x10, 0xc6, 0x29, 0x73,
0587     0x0e, 0x0e, 0x5d, 0xe0, 0x71, 0x03, 0x8a, 0x72,
0588     0x0e, 0x26, 0xb0, 0x7d, 0x84, 0xed, 0x95, 0x23,
0589     0x49, 0x5a, 0x45, 0x83, 0x45, 0x60, 0x11, 0x4a,
0590     0x46, 0x31, 0xd4, 0xd8, 0x16, 0x54, 0x98, 0x58,
0591     0xed, 0x6d, 0xcc, 0x5d, 0xd6, 0x50, 0x61, 0x9f,
0592     0x9d, 0xc5, 0x3e, 0x9d, 0x32, 0x47, 0xde, 0x96,
0593     0xe1, 0x5d, 0xd8, 0xf8, 0xb4, 0x69, 0x6f, 0xb9,
0594     0x15, 0x90, 0x57, 0x7a, 0xf6, 0xad, 0xb0, 0x5b,
0595     0xf5, 0xa6, 0x36, 0x94, 0xfd, 0x84, 0xce, 0x1c,
0596     0x0f, 0x4b, 0xd0, 0xc2, 0x5b, 0x6b, 0x56, 0xef,
0597     0x73, 0x93, 0x0b, 0xc3, 0xee, 0xd9, 0xcf, 0xd3,
0598     0xa4, 0x22, 0x58, 0xcd, 0x50, 0x6e, 0x65, 0xf4,
0599     0xe9, 0xb7, 0x71, 0xaf, 0x4b, 0xb3, 0xb6, 0x2f,
0600     0x0f, 0x0e, 0x3b, 0xc9, 0x85, 0x14, 0xf5, 0x17,
0601     0xe8, 0x7a, 0x3a, 0xbf, 0x5f, 0x5e, 0xf8, 0x18,
0602     0x48, 0xa6, 0x72, 0xab, 0x06, 0x95, 0xe9, 0xc8,
0603     0xa7, 0xf4, 0x32, 0x44, 0x04, 0x0c, 0x84, 0x98,
0604     0x73, 0xe3, 0x89, 0x8d, 0x5f, 0x7e, 0x4a, 0x42,
0605     0x8f, 0xc5, 0x28, 0xb1, 0x82, 0xef, 0x1c, 0x97,
0606     0x31, 0x3b, 0x4d, 0xe0, 0x0e, 0x10, 0x10, 0x97,
0607     0x93, 0x49, 0x78, 0x2f, 0x0d, 0x86, 0x8b, 0xa1,
0608     0x53, 0xa9, 0x81, 0x20, 0x79, 0xe7, 0x07, 0x77,
0609     0xb6, 0xac, 0x5e, 0xd2, 0x05, 0xcd, 0xe9, 0xdb,
0610     0x8a, 0x94, 0x82, 0x8a, 0x23, 0xb9, 0x3d, 0x1c,
0611     0xa9, 0x7d, 0x72, 0x4a, 0xed, 0x33, 0xa3, 0xdb,
0612     0x21, 0xa7, 0x86, 0x33, 0x45, 0xa5, 0xaa, 0x56,
0613     0x45, 0xb5, 0x83, 0x29, 0x40, 0x47, 0x79, 0x04,
0614     0x6e, 0xb9, 0x95, 0xd0, 0x81, 0x77, 0x2d, 0x48,
0615     0x1e, 0xfe, 0xc3, 0xc2, 0x1e, 0xe5, 0xf2, 0xbe,
0616     0xfd, 0x3b, 0x94, 0x9f, 0xc4, 0xc4, 0x26, 0x9d,
0617     0xe4, 0x66, 0x1e, 0x19, 0xee, 0x6c, 0x79, 0x97,
0618     0x11, 0x31, 0x4b, 0x0d, 0x01, 0xcb, 0xde, 0xa8,
0619     0xf6, 0x6d, 0x7c, 0x39, 0x46, 0x4e, 0x7e, 0x3f,
0620     0x94, 0x17, 0xdf, 0xa1, 0x7d, 0xd9, 0x1c, 0x8e,
0621     0xbc, 0x7d, 0x33, 0x7d, 0xe3, 0x12, 0x40, 0xca,
0622     0xab, 0x37, 0x11, 0x46, 0xd4, 0xae, 0xef, 0x44,
0623     0xa2, 0xb3, 0x6a, 0x66, 0x0e, 0x0c, 0x90, 0x7f,
0624     0xdf, 0x5c, 0x66, 0x5f, 0xf2, 0x94, 0x9f, 0xa6,
0625     0x73, 0x4f, 0xeb, 0x0d, 0xad, 0xbf, 0xc0, 0x63,
0626     0x5c, 0xdc, 0x46, 0x51, 0xe8, 0x8e, 0x90, 0x19,
0627     0xa8, 0xa4, 0x3c, 0x91, 0x79, 0xfa, 0x7e, 0x58,
0628     0x85, 0x13, 0x55, 0xc5, 0x19, 0x82, 0x37, 0x1b,
0629     0x0a, 0x02, 0x1f, 0x99, 0x6b, 0x18, 0xf1, 0x28,
0630     0x08, 0xa2, 0x73, 0xb8, 0x0f, 0x2e, 0xcd, 0xbf,
0631     0xf3, 0x86, 0x7f, 0xea, 0xef, 0xd0, 0xbb, 0xa6,
0632     0x21, 0xdf, 0x49, 0x73, 0x51, 0xcc, 0x36, 0xd3,
0633     0x3e, 0xa0, 0xf8, 0x44, 0xdf, 0xd3, 0xa6, 0xbe,
0634     0x8a, 0xd4, 0x57, 0xdd, 0x72, 0x94, 0x61, 0x0f,
0635     0x82, 0xd1, 0x07, 0xb8, 0x7c, 0x18, 0x83, 0xdf,
0636     0x3a, 0xe5, 0x50, 0x6a, 0x82, 0x20, 0xac, 0xa9,
0637     0xa8, 0xff, 0xd9, 0xf3, 0x77, 0x33, 0x5a, 0x9e,
0638     0x7f, 0x6d, 0xfe, 0x5d, 0x33, 0x41, 0x42, 0xe7,
0639     0x6c, 0x19, 0xe0, 0x44, 0x8a, 0x15, 0xf6, 0x70,
0640     0x98, 0xb7, 0x68, 0x4d, 0xfa, 0x97, 0x39, 0xb0,
0641     0x8e, 0xe8, 0x84, 0x8b, 0x75, 0x30, 0xb7, 0x7d,
0642     0x92, 0x69, 0x20, 0x9c, 0x81, 0xfb, 0x4b, 0xf4,
0643     0x01, 0x50, 0xeb, 0xce, 0x0c, 0x1c, 0x6c, 0xb5,
0644     0x4a, 0xd7, 0x27, 0x0c, 0xce, 0xbb, 0xe5, 0x85,
0645     0xf0, 0xb6, 0xee, 0xd5, 0x70, 0xdd, 0x3b, 0xfc,
0646     0xd4, 0x99, 0xf1, 0x33, 0xdd, 0x8b, 0xc4, 0x2f,
0647     0xae, 0xab, 0x74, 0x96, 0x32, 0xc7, 0x4c, 0x56,
0648     0x3c, 0x89, 0x0f, 0x96, 0x0b, 0x42, 0xc0, 0xcb,
0649     0xee, 0x0f, 0x0b, 0x8c, 0xfb, 0x7e, 0x47, 0x7b,
0650     0x64, 0x48, 0xfd, 0xb2, 0x00, 0x80, 0x89, 0xa5,
0651     0x13, 0x55, 0x62, 0xfc, 0x8f, 0xe2, 0x42, 0x03,
0652     0xb7, 0x4e, 0x2a, 0x79, 0xb4, 0x82, 0xea, 0x23,
0653     0x49, 0xda, 0xaf, 0x52, 0x63, 0x1e, 0x60, 0x03,
0654     0x89, 0x06, 0x44, 0x46, 0x08, 0xc3, 0xc4, 0x87,
0655     0x70, 0x2e, 0xda, 0x94, 0xad, 0x6b, 0xe0, 0xe4,
0656     0xd1, 0x8a, 0x06, 0xc2, 0xa8, 0xc0, 0xa7, 0x43,
0657     0x3c, 0x47, 0x52, 0x0e, 0xc3, 0x77, 0x81, 0x11,
0658     0x67, 0x0e, 0xa0, 0x70, 0x04, 0x47, 0x29, 0x40,
0659     0x86, 0x0d, 0x34, 0x56, 0xa7, 0xc9, 0x35, 0x59,
0660     0x68, 0xdc, 0x93, 0x81, 0x70, 0xee, 0x86, 0xd9,
0661     0x80, 0x06, 0x40, 0x4f, 0x1a, 0x0d, 0x40, 0x30,
0662     0x0b, 0xcb, 0x96, 0x47, 0xc1, 0xb7, 0x52, 0xfd,
0663     0x56, 0xe0, 0x72, 0x4b, 0xfb, 0xbd, 0x92, 0x45,
0664     0x61, 0x71, 0xc2, 0x33, 0x11, 0xbf, 0x52, 0x83,
0665     0x79, 0x26, 0xe0, 0x49, 0x6b, 0xb7, 0x05, 0x8b,
0666     0xe8, 0x0e, 0x87, 0x31, 0xd7, 0x9d, 0x8a, 0xf5,
0667     0xc0, 0x5f, 0x2e, 0x58, 0x4a, 0xdb, 0x11, 0xb3,
0668     0x6c, 0x30, 0x2a, 0x46, 0x19, 0xe3, 0x27, 0x84,
0669     0x1f, 0x63, 0x6e, 0xf6, 0x57, 0xc7, 0xc9, 0xd8,
0670     0x5e, 0xba, 0xb3, 0x87, 0xd5, 0x83, 0x26, 0x34,
0671     0x21, 0x9e, 0x65, 0xde, 0x42, 0xd3, 0xbe, 0x7b,
0672     0xbc, 0x91, 0x71, 0x44, 0x4d, 0x99, 0x3b, 0x31,
0673     0xe5, 0x3f, 0x11, 0x4e, 0x7f, 0x13, 0x51, 0x3b,
0674     0xae, 0x79, 0xc9, 0xd3, 0x81, 0x8e, 0x25, 0x40,
0675     0x10, 0xfc, 0x07, 0x1e, 0xf9, 0x7b, 0x9a, 0x4b,
0676     0x6c, 0xe3, 0xb3, 0xad, 0x1a, 0x0a, 0xdd, 0x9e,
0677     0x59, 0x0c, 0xa2, 0xcd, 0xae, 0x48, 0x4a, 0x38,
0678     0x5b, 0x47, 0x41, 0x94, 0x65, 0x6b, 0xbb, 0xeb,
0679     0x5b, 0xe3, 0xaf, 0x07, 0x5b, 0xd4, 0x4a, 0xa2,
0680     0xc9, 0x5d, 0x2f, 0x64, 0x03, 0xd7, 0x3a, 0x2c,
0681     0x6e, 0xce, 0x76, 0x95, 0xb4, 0xb3, 0xc0, 0xf1,
0682     0xe2, 0x45, 0x73, 0x7a, 0x5c, 0xab, 0xc1, 0xfc,
0683     0x02, 0x8d, 0x81, 0x29, 0xb3, 0xac, 0x07, 0xec,
0684     0x40, 0x7d, 0x45, 0xd9, 0x7a, 0x59, 0xee, 0x34,
0685     0xf0, 0xe9, 0xd5, 0x7b, 0x96, 0xb1, 0x3d, 0x95,
0686     0xcc, 0x86, 0xb5, 0xb6, 0x04, 0x2d, 0xb5, 0x92,
0687     0x7e, 0x76, 0xf4, 0x06, 0xa9, 0xa3, 0x12, 0x0f,
0688     0xb1, 0xaf, 0x26, 0xba, 0x7c, 0xfc, 0x7e, 0x1c,
0689     0xbc, 0x2c, 0x49, 0x97, 0x53, 0x60, 0x13, 0x0b,
0690     0xa6, 0x61, 0x83, 0x89, 0x42, 0xd4, 0x17, 0x0c,
0691     0x6c, 0x26, 0x52, 0xc3, 0xb3, 0xd4, 0x67, 0xf5,
0692     0xe3, 0x04, 0xb7, 0xf4, 0xcb, 0x80, 0xb8, 0xcb,
0693     0x77, 0x56, 0x3e, 0xaa, 0x57, 0x54, 0xee, 0xb4,
0694     0x2c, 0x67, 0xcf, 0xf2, 0xdc, 0xbe, 0x55, 0xf9,
0695     0x43, 0x1f, 0x6e, 0x22, 0x97, 0x67, 0x7f, 0xc4,
0696     0xef, 0xb1, 0x26, 0x31, 0x1e, 0x27, 0xdf, 0x41,
0697     0x80, 0x47, 0x6c, 0xe2, 0xfa, 0xa9, 0x8c, 0x2a,
0698     0xf6, 0xf2, 0xab, 0xf0, 0x15, 0xda, 0x6c, 0xc8,
0699     0xfe, 0xb5, 0x23, 0xde, 0xa9, 0x05, 0x3f, 0x06,
0700     0x54, 0x4c, 0xcd, 0xe1, 0xab, 0xfc, 0x0e, 0x62,
0701     0x33, 0x31, 0x73, 0x2c, 0x76, 0xcb, 0xb4, 0x47,
0702     0x1e, 0x20, 0xad, 0xd8, 0xf2, 0x31, 0xdd, 0xc4,
0703     0x8b, 0x0c, 0x77, 0xbe, 0xe1, 0x8b, 0x26, 0x00,
0704     0x02, 0x58, 0xd6, 0x8d, 0xef, 0xad, 0x74, 0x67,
0705     0xab, 0x3f, 0xef, 0xcb, 0x6f, 0xb0, 0xcc, 0x81,
0706     0x44, 0x4c, 0xaf, 0xe9, 0x49, 0x4f, 0xdb, 0xa0,
0707     0x25, 0xa4, 0xf0, 0x89, 0xf1, 0xbe, 0xd8, 0x10,
0708     0xff, 0xb1, 0x3b, 0x4b, 0xfa, 0x98, 0xf5, 0x79,
0709     0x6d, 0x1e, 0x69, 0x4d, 0x57, 0xb1, 0xc8, 0x19,
0710     0x1b, 0xbd, 0x1e, 0x8c, 0x84, 0xb7, 0x7b, 0xe8,
0711     0xd2, 0x2d, 0x09, 0x41, 0x41, 0x37, 0x3d, 0xb1,
0712     0x6f, 0x26, 0x5d, 0x71, 0x16, 0x3d, 0xb7, 0x83,
0713     0x27, 0x2c, 0xa7, 0xb6, 0x50, 0xbd, 0x91, 0x86,
0714     0xab, 0x24, 0xa1, 0x38, 0xfd, 0xea, 0x71, 0x55,
0715     0x7e, 0x9a, 0x07, 0x77, 0x4b, 0xfa, 0x61, 0x66,
0716     0x20, 0x1e, 0x28, 0x95, 0x18, 0x1b, 0xa4, 0xa0,
0717     0xfd, 0xc0, 0x89, 0x72, 0x43, 0xd9, 0x3b, 0x49,
0718     0x5a, 0x3f, 0x9d, 0xbf, 0xdb, 0xb4, 0x46, 0xea,
0719     0x42, 0x01, 0x77, 0x23, 0x68, 0x95, 0xb6, 0x24,
0720     0xb3, 0xa8, 0x6c, 0x28, 0x3b, 0x11, 0x40, 0x7e,
0721     0x18, 0x65, 0x6d, 0xd8, 0x24, 0x42, 0x7d, 0x88,
0722     0xc0, 0x52, 0xd9, 0x05, 0xe4, 0x95, 0x90, 0x87,
0723     0x8c, 0xf4, 0xd0, 0x6b, 0xb9, 0x83, 0x99, 0x34,
0724     0x6d, 0xfe, 0x54, 0x40, 0x94, 0x52, 0x21, 0x4f,
0725     0x14, 0x25, 0xc5, 0xd6, 0x5e, 0x95, 0xdc, 0x0a,
0726     0x2b, 0x89, 0x20, 0x11, 0x84, 0x48, 0xd6, 0x3a,
0727     0xcd, 0x5c, 0x24, 0xad, 0x62, 0xe3, 0xb1, 0x93,
0728     0x25, 0x8d, 0xcd, 0x7e, 0xfc, 0x27, 0xa3, 0x37,
0729     0xfd, 0x84, 0xfc, 0x1b, 0xb2, 0xf1, 0x27, 0x38,
0730     0x5a, 0xb7, 0xfc, 0xf2, 0xfa, 0x95, 0x66, 0xd4,
0731     0xfb, 0xba, 0xa7, 0xd7, 0xa3, 0x72, 0x69, 0x48,
0732     0x48, 0x8c, 0xeb, 0x28, 0x89, 0xfe, 0x33, 0x65,
0733     0x5a, 0x36, 0x01, 0x7e, 0x06, 0x79, 0x0a, 0x09,
0734     0x3b, 0x74, 0x11, 0x9a, 0x6e, 0xbf, 0xd4, 0x9e,
0735     0x58, 0x90, 0x49, 0x4f, 0x4d, 0x08, 0xd4, 0xe5,
0736     0x4a, 0x09, 0x21, 0xef, 0x8b, 0xb8, 0x74, 0x3b,
0737     0x91, 0xdd, 0x36, 0x85, 0x60, 0x2d, 0xfa, 0xd4,
0738     0x45, 0x7b, 0x45, 0x53, 0xf5, 0x47, 0x87, 0x7e,
0739     0xa6, 0x37, 0xc8, 0x78, 0x7a, 0x68, 0x9d, 0x8d,
0740     0x65, 0x2c, 0x0e, 0x91, 0x5c, 0xa2, 0x60, 0xf0,
0741     0x8e, 0x3f, 0xe9, 0x1a, 0xcd, 0xaa, 0xe7, 0xd5,
0742     0x77, 0x18, 0xaf, 0xc9, 0xbc, 0x18, 0xea, 0x48,
0743     0x1b, 0xfb, 0x22, 0x48, 0x70, 0x16, 0x29, 0x9e,
0744     0x5b, 0xc1, 0x2c, 0x66, 0x23, 0xbc, 0xf0, 0x1f,
0745     0xef, 0xaf, 0xe4, 0xd6, 0x04, 0x19, 0x82, 0x7a,
0746     0x0b, 0xba, 0x4b, 0x46, 0xb1, 0x6a, 0x85, 0x5d,
0747     0xb4, 0x73, 0xd6, 0x21, 0xa1, 0x71, 0x60, 0x14,
0748     0xee, 0x0a, 0x77, 0xc4, 0x66, 0x2e, 0xf9, 0x69,
0749     0x30, 0xaf, 0x41, 0x0b, 0xc8, 0x83, 0x3c, 0x53,
0750     0x99, 0x19, 0x27, 0x46, 0xf7, 0x41, 0x6e, 0x56,
0751     0xdc, 0x94, 0x28, 0x67, 0x4e, 0xb7, 0x25, 0x48,
0752     0x8a, 0xc2, 0xe0, 0x60, 0x96, 0xcc, 0x18, 0xf4,
0753     0x84, 0xdd, 0xa7, 0x5e, 0x3e, 0x05, 0x0b, 0x26,
0754     0x26, 0xb2, 0x5c, 0x1f, 0x57, 0x1a, 0x04, 0x7e,
0755     0x6a, 0xe3, 0x2f, 0xb4, 0x35, 0xb6, 0x38, 0x40,
0756     0x40, 0xcd, 0x6f, 0x87, 0x2e, 0xef, 0xa3, 0xd7,
0757     0xa9, 0xc2, 0xe8, 0x0d, 0x27, 0xdf, 0x44, 0x62,
0758     0x99, 0xa0, 0xfc, 0xcf, 0x81, 0x78, 0xcb, 0xfe,
0759     0xe5, 0xa0, 0x03, 0x4e, 0x6c, 0xd7, 0xf4, 0xaf,
0760     0x7a, 0xbb, 0x61, 0x82, 0xfe, 0x71, 0x89, 0xb2,
0761     0x22, 0x7c, 0x8e, 0x83, 0x04, 0xce, 0xf6, 0x5d,
0762     0x84, 0x8f, 0x95, 0x6a, 0x7f, 0xad, 0xfd, 0x32,
0763     0x9c, 0x5e, 0xe4, 0x9c, 0x89, 0x60, 0x54, 0xaa,
0764     0x96, 0x72, 0xd2, 0xd7, 0x36, 0x85, 0xa9, 0x45,
0765     0xd2, 0x2a, 0xa1, 0x81, 0x49, 0x6f, 0x7e, 0x04,
0766     0xfa, 0xe2, 0xfe, 0x90, 0x26, 0x77, 0x5a, 0x33,
0767     0xb8, 0x04, 0x9a, 0x7a, 0xe6, 0x4c, 0x4f, 0xad,
0768     0x72, 0x96, 0x08, 0x28, 0x58, 0x13, 0xf8, 0xc4,
0769     0x1c, 0xf0, 0xc3, 0x45, 0x95, 0x49, 0x20, 0x8c,
0770     0x9f, 0x39, 0x70, 0xe1, 0x77, 0xfe, 0xd5, 0x4b,
0771     0xaf, 0x86, 0xda, 0xef, 0x22, 0x06, 0x83, 0x36,
0772     0x29, 0x12, 0x11, 0x40, 0xbc, 0x3b, 0x86, 0xaa,
0773     0xaa, 0x65, 0x60, 0xc3, 0x80, 0xca, 0xed, 0xa9,
0774     0xf3, 0xb0, 0x79, 0x96, 0xa2, 0x55, 0x27, 0x28,
0775     0x55, 0x73, 0x26, 0xa5, 0x50, 0xea, 0x92, 0x4b,
0776     0x3c, 0x5c, 0x82, 0x33, 0xf0, 0x01, 0x3f, 0x03,
0777     0xc1, 0x08, 0x05, 0xbf, 0x98, 0xf4, 0x9b, 0x6d,
0778     0xa5, 0xa8, 0xb4, 0x82, 0x0c, 0x06, 0xfa, 0xff,
0779     0x2d, 0x08, 0xf3, 0x05, 0x4f, 0x57, 0x2a, 0x39,
0780     0xd4, 0x83, 0x0d, 0x75, 0x51, 0xd8, 0x5b, 0x1b,
0781     0xd3, 0x51, 0x5a, 0x32, 0x2a, 0x9b, 0x32, 0xb2,
0782     0xf2, 0xa4, 0x96, 0x12, 0xf2, 0xae, 0x40, 0x34,
0783     0x67, 0xa8, 0xf5, 0x44, 0xd5, 0x35, 0x53, 0xfe,
0784     0xa3, 0x60, 0x96, 0x63, 0x0f, 0x1f, 0x6e, 0xb0,
0785     0x5a, 0x42, 0xa6, 0xfc, 0x51, 0x0b, 0x60, 0x27,
0786     0xbc, 0x06, 0x71, 0xed, 0x65, 0x5b, 0x23, 0x86,
0787     0x4a, 0x07, 0x3b, 0x22, 0x07, 0x46, 0xe6, 0x90,
0788     0x3e, 0xf3, 0x25, 0x50, 0x1b, 0x4c, 0x7f, 0x03,
0789     0x08, 0xa8, 0x36, 0x6b, 0x87, 0xe5, 0xe3, 0xdb,
0790     0x9a, 0x38, 0x83, 0xff, 0x9f, 0x1a, 0x9f, 0x57,
0791     0xa4, 0x2a, 0xf6, 0x37, 0xbc, 0x1a, 0xff, 0xc9,
0792     0x1e, 0x35, 0x0c, 0xc3, 0x7c, 0xa3, 0xb2, 0xe5,
0793     0xd2, 0xc6, 0xb4, 0x57, 0x47, 0xe4, 0x32, 0x16,
0794     0x6d, 0xa9, 0xae, 0x64, 0xe6, 0x2d, 0x8d, 0xc5,
0795     0x8d, 0x50, 0x8e, 0xe8, 0x1a, 0x22, 0x34, 0x2a,
0796     0xd9, 0xeb, 0x51, 0x90, 0x4a, 0xb1, 0x41, 0x7d,
0797     0x64, 0xf9, 0xb9, 0x0d, 0xf6, 0x23, 0x33, 0xb0,
0798     0x33, 0xf4, 0xf7, 0x3f, 0x27, 0x84, 0xc6, 0x0f,
0799     0x54, 0xa5, 0xc0, 0x2e, 0xec, 0x0b, 0x3a, 0x48,
0800     0x6e, 0x80, 0x35, 0x81, 0x43, 0x9b, 0x90, 0xb1,
0801     0xd0, 0x2b, 0xea, 0x21, 0xdc, 0xda, 0x5b, 0x09,
0802     0xf4, 0xcc, 0x10, 0xb4, 0xc7, 0xfe, 0x79, 0x51,
0803     0xc3, 0xc5, 0xac, 0x88, 0x74, 0x84, 0x0b, 0x4b,
0804     0xca, 0x79, 0x16, 0x29, 0xfb, 0x69, 0x54, 0xdf,
0805     0x41, 0x7e, 0xe9, 0xc7, 0x8e, 0xea, 0xa5, 0xfe,
0806     0xfc, 0x76, 0x0e, 0x90, 0xc4, 0x92, 0x38, 0xad,
0807     0x7b, 0x48, 0xe6, 0x6e, 0xf7, 0x21, 0xfd, 0x4e,
0808     0x93, 0x0a, 0x7b, 0x41, 0x83, 0x68, 0xfb, 0x57,
0809     0x51, 0x76, 0x34, 0xa9, 0x6c, 0x00, 0xaa, 0x4f,
0810     0x66, 0x65, 0x98, 0x4a, 0x4f, 0xa3, 0xa0, 0xef,
0811     0x69, 0x3f, 0xe3, 0x1c, 0x92, 0x8c, 0xfd, 0xd8,
0812     0xe8, 0xde, 0x7c, 0x7f, 0x3e, 0x84, 0x8e, 0x69,
0813     0x3c, 0xf1, 0xf2, 0x05, 0x46, 0xdc, 0x2f, 0x9d,
0814     0x5e, 0x6e, 0x4c, 0xfb, 0xb5, 0x99, 0x2a, 0x59,
0815     0x63, 0xc1, 0x34, 0xbc, 0x57, 0xc0, 0x0d, 0xb9,
0816     0x61, 0x25, 0xf3, 0x33, 0x23, 0x51, 0xb6, 0x0d,
0817     0x07, 0xa6, 0xab, 0x94, 0x4a, 0xb7, 0x2a, 0xea,
0818     0xee, 0xac, 0xa3, 0xc3, 0x04, 0x8b, 0x0e, 0x56,
0819     0xfe, 0x44, 0xa7, 0x39, 0xe2, 0xed, 0xed, 0xb4,
0820     0x22, 0x2b, 0xac, 0x12, 0x32, 0x28, 0x91, 0xd8,
0821     0xa5, 0xab, 0xff, 0x5f, 0xe0, 0x4b, 0xda, 0x78,
0822     0x17, 0xda, 0xf1, 0x01, 0x5b, 0xcd, 0xe2, 0x5f,
0823     0x50, 0x45, 0x73, 0x2b, 0xe4, 0x76, 0x77, 0xf4,
0824     0x64, 0x1d, 0x43, 0xfb, 0x84, 0x7a, 0xea, 0x91,
0825     0xae, 0xf9, 0x9e, 0xb7, 0xb4, 0xb0, 0x91, 0x5f,
0826     0x16, 0x35, 0x9a, 0x11, 0xb8, 0xc7, 0xc1, 0x8c,
0827     0xc6, 0x10, 0x8d, 0x2f, 0x63, 0x4a, 0xa7, 0x57,
0828     0x3a, 0x51, 0xd6, 0x32, 0x2d, 0x64, 0x72, 0xd4,
0829     0x66, 0xdc, 0x10, 0xa6, 0x67, 0xd6, 0x04, 0x23,
0830     0x9d, 0x0a, 0x11, 0x77, 0xdd, 0x37, 0x94, 0x17,
0831     0x3c, 0xbf, 0x8b, 0x65, 0xb0, 0x2e, 0x5e, 0x66,
0832     0x47, 0x64, 0xac, 0xdd, 0xf0, 0x84, 0xfd, 0x39,
0833     0xfa, 0x15, 0x5d, 0xef, 0xae, 0xca, 0xc1, 0x36,
0834     0xa7, 0x5c, 0xbf, 0xc7, 0x08, 0xc2, 0x66, 0x00,
0835     0x74, 0x74, 0x4e, 0x27, 0x3f, 0x55, 0x8a, 0xb7,
0836     0x38, 0x66, 0x83, 0x6d, 0xcf, 0x99, 0x9e, 0x60,
0837     0x8f, 0xdd, 0x2e, 0x62, 0x22, 0x0e, 0xef, 0x0c,
0838     0x98, 0xa7, 0x85, 0x74, 0x3b, 0x9d, 0xec, 0x9e,
0839     0xa9, 0x19, 0x72, 0xa5, 0x7f, 0x2c, 0x39, 0xb7,
0840     0x7d, 0xb7, 0xf1, 0x12, 0x65, 0x27, 0x4b, 0x5a,
0841     0xde, 0x17, 0xfe, 0xad, 0x44, 0xf3, 0x20, 0x4d,
0842     0xfd, 0xe4, 0x1f, 0xb5, 0x81, 0xb0, 0x36, 0x37,
0843     0x08, 0x6f, 0xc3, 0x0c, 0xe9, 0x85, 0x98, 0x82,
0844     0xa9, 0x62, 0x0c, 0xc4, 0x97, 0xc0, 0x50, 0xc8,
0845     0xa7, 0x3c, 0x50, 0x9f, 0x43, 0xb9, 0xcd, 0x5e,
0846     0x4d, 0xfa, 0x1c, 0x4b, 0x0b, 0xa9, 0x98, 0x85,
0847     0x38, 0x92, 0xac, 0x8d, 0xe4, 0xad, 0x9b, 0x98,
0848     0xab, 0xd9, 0x38, 0xac, 0x62, 0x52, 0xa3, 0x22,
0849     0x63, 0x0f, 0xbf, 0x95, 0x48, 0xdf, 0x69, 0xe7,
0850     0x8b, 0x33, 0xd5, 0xb2, 0xbd, 0x05, 0x49, 0x49,
0851     0x9d, 0x57, 0x73, 0x19, 0x33, 0xae, 0xfa, 0x33,
0852     0xf1, 0x19, 0xa8, 0x80, 0xce, 0x04, 0x9f, 0xbc,
0853     0x1d, 0x65, 0x82, 0x1b, 0xe5, 0x3a, 0x51, 0xc8,
0854     0x1c, 0x21, 0xe3, 0x5d, 0xf3, 0x7d, 0x9b, 0x2f,
0855     0x2c, 0x1d, 0x4a, 0x7f, 0x9b, 0x68, 0x35, 0xa3,
0856     0xb2, 0x50, 0xf7, 0x62, 0x79, 0xcd, 0xf4, 0x98,
0857     0x4f, 0xe5, 0x63, 0x7c, 0x3e, 0x45, 0x31, 0x8c,
0858     0x16, 0xa0, 0x12, 0xc8, 0x58, 0xce, 0x39, 0xa6,
0859     0xbc, 0x54, 0xdb, 0xc5, 0xe0, 0xd5, 0xba, 0xbc,
0860     0xb9, 0x04, 0xf4, 0x8d, 0xe8, 0x2f, 0x15, 0x9d,
0861 };
0862 
0863 /* 100 test cases */
0864 static struct crc_test {
0865     u32 crc;    /* random starting crc */
0866     u32 start;  /* random 6 bit offset in buf */
0867     u32 length; /* random 11 bit length of test */
0868     u32 crc_le; /* expected crc32_le result */
0869     u32 crc_be; /* expected crc32_be result */
0870     u32 crc32c_le;  /* expected crc32c_le result */
0871 } const test[] __initconst =
0872 {
0873     {0x674bf11d, 0x00000038, 0x00000542, 0x0af6d466, 0xd8b6e4c1, 0xf6e93d6c},
0874     {0x35c672c6, 0x0000003a, 0x000001aa, 0xc6d3dfba, 0x28aaf3ad, 0x0fe92aca},
0875     {0x496da28e, 0x00000039, 0x000005af, 0xd933660f, 0x5d57e81f, 0x52e1ebb8},
0876     {0x09a9b90e, 0x00000027, 0x000001f8, 0xb45fe007, 0xf45fca9a, 0x0798af9a},
0877     {0xdc97e5a9, 0x00000025, 0x000003b6, 0xf81a3562, 0xe0126ba2, 0x18eb3152},
0878     {0x47c58900, 0x0000000a, 0x000000b9, 0x8e58eccf, 0xf3afc793, 0xd00d08c7},
0879     {0x292561e8, 0x0000000c, 0x00000403, 0xa2ba8aaf, 0x0b797aed, 0x8ba966bc},
0880     {0x415037f6, 0x00000003, 0x00000676, 0xa17d52e8, 0x7f0fdf35, 0x11d694a2},
0881     {0x3466e707, 0x00000026, 0x00000042, 0x258319be, 0x75c484a2, 0x6ab3208d},
0882     {0xafd1281b, 0x00000023, 0x000002ee, 0x4428eaf8, 0x06c7ad10, 0xba4603c5},
0883     {0xd3857b18, 0x00000028, 0x000004a2, 0x5c430821, 0xb062b7cb, 0xe6071c6f},
0884     {0x1d825a8f, 0x0000002b, 0x0000050b, 0xd2c45f0c, 0xd68634e0, 0x179ec30a},
0885     {0x5033e3bc, 0x0000000b, 0x00000078, 0xa3ea4113, 0xac6d31fb, 0x0903beb8},
0886     {0x94f1fb5e, 0x0000000f, 0x000003a2, 0xfbfc50b1, 0x3cfe50ed, 0x6a7cb4fa},
0887     {0xc9a0fe14, 0x00000009, 0x00000473, 0x5fb61894, 0x87070591, 0xdb535801},
0888     {0x88a034b1, 0x0000001c, 0x000005ad, 0xc1b16053, 0x46f95c67, 0x92bed597},
0889     {0xf0f72239, 0x00000020, 0x0000026d, 0xa6fa58f3, 0xf8c2c1dd, 0x192a3f1b},
0890     {0xcc20a5e3, 0x0000003b, 0x0000067a, 0x7740185a, 0x308b979a, 0xccbaec1a},
0891     {0xce589c95, 0x0000002b, 0x00000641, 0xd055e987, 0x40aae25b, 0x7eabae4d},
0892     {0x78edc885, 0x00000035, 0x000005be, 0xa39cb14b, 0x035b0d1f, 0x28c72982},
0893     {0x9d40a377, 0x0000003b, 0x00000038, 0x1f47ccd2, 0x197fbc9d, 0xc3cd4d18},
0894     {0x703d0e01, 0x0000003c, 0x000006f1, 0x88735e7c, 0xfed57c5a, 0xbca8f0e7},
0895     {0x776bf505, 0x0000000f, 0x000005b2, 0x5cc4fc01, 0xf32efb97, 0x713f60b3},
0896     {0x4a3e7854, 0x00000027, 0x000004b8, 0x8d923c82, 0x0cbfb4a2, 0xebd08fd5},
0897     {0x209172dd, 0x0000003b, 0x00000356, 0xb89e9c2b, 0xd7868138, 0x64406c59},
0898     {0x3ba4cc5b, 0x0000002f, 0x00000203, 0xe51601a9, 0x5b2a1032, 0x7421890e},
0899     {0xfc62f297, 0x00000000, 0x00000079, 0x71a8e1a2, 0x5d88685f, 0xe9347603},
0900     {0x64280b8b, 0x00000016, 0x000007ab, 0x0fa7a30c, 0xda3a455f, 0x1bef9060},
0901     {0x97dd724b, 0x00000033, 0x000007ad, 0x5788b2f4, 0xd7326d32, 0x34720072},
0902     {0x61394b52, 0x00000035, 0x00000571, 0xc66525f1, 0xcabe7fef, 0x48310f59},
0903     {0x29b4faff, 0x00000024, 0x0000006e, 0xca13751e, 0x993648e0, 0x783a4213},
0904     {0x29bfb1dc, 0x0000000b, 0x00000244, 0x436c43f7, 0x429f7a59, 0x9e8efd41},
0905     {0x86ae934b, 0x00000035, 0x00000104, 0x0760ec93, 0x9cf7d0f4, 0xfc3d34a5},
0906     {0xc4c1024e, 0x0000002e, 0x000006b1, 0x6516a3ec, 0x19321f9c, 0x17a52ae2},
0907     {0x3287a80a, 0x00000026, 0x00000496, 0x0b257eb1, 0x754ebd51, 0x886d935a},
0908     {0xa4db423e, 0x00000023, 0x0000045d, 0x9b3a66dc, 0x873e9f11, 0xeaaeaeb2},
0909     {0x7a1078df, 0x00000015, 0x0000014a, 0x8c2484c5, 0x6a628659, 0x8e900a4b},
0910     {0x6048bd5b, 0x00000006, 0x0000006a, 0x897e3559, 0xac9961af, 0xd74662b1},
0911     {0xd8f9ea20, 0x0000003d, 0x00000277, 0x60eb905b, 0xed2aaf99, 0xd26752ba},
0912     {0xea5ec3b4, 0x0000002a, 0x000004fe, 0x869965dc, 0x6c1f833b, 0x8b1fcd62},
0913     {0x2dfb005d, 0x00000016, 0x00000345, 0x6a3b117e, 0xf05e8521, 0xf54342fe},
0914     {0x5a214ade, 0x00000020, 0x000005b6, 0x467f70be, 0xcb22ccd3, 0x5b95b988},
0915     {0xf0ab9cca, 0x00000032, 0x00000515, 0xed223df3, 0x7f3ef01d, 0x2e1176be},
0916     {0x91b444f9, 0x0000002e, 0x000007f8, 0x84e9a983, 0x5676756f, 0x66120546},
0917     {0x1b5d2ddb, 0x0000002e, 0x0000012c, 0xba638c4c, 0x3f42047b, 0xf256a5cc},
0918     {0xd824d1bb, 0x0000003a, 0x000007b5, 0x6288653b, 0x3a3ebea0, 0x4af1dd69},
0919     {0x0470180c, 0x00000034, 0x000001f0, 0x9d5b80d6, 0x3de08195, 0x56f0a04a},
0920     {0xffaa3a3f, 0x00000036, 0x00000299, 0xf3a82ab8, 0x53e0c13d, 0x74f6b6b2},
0921     {0x6406cfeb, 0x00000023, 0x00000600, 0xa920b8e8, 0xe4e2acf4, 0x085951fd},
0922     {0xb24aaa38, 0x0000003e, 0x000004a1, 0x657cc328, 0x5077b2c3, 0xc65387eb},
0923     {0x58b2ab7c, 0x00000039, 0x000002b4, 0x3a17ee7e, 0x9dcb3643, 0x1ca9257b},
0924     {0x3db85970, 0x00000006, 0x000002b6, 0x95268b59, 0xb9812c10, 0xfd196d76},
0925     {0x857830c5, 0x00000003, 0x00000590, 0x4ef439d5, 0xf042161d, 0x5ef88339},
0926     {0xe1fcd978, 0x0000003e, 0x000007d8, 0xae8d8699, 0xce0a1ef5, 0x2c3714d9},
0927     {0xb982a768, 0x00000016, 0x000006e0, 0x62fad3df, 0x5f8a067b, 0x58576548},
0928     {0x1d581ce8, 0x0000001e, 0x0000058b, 0xf0f5da53, 0x26e39eee, 0xfd7c57de},
0929     {0x2456719b, 0x00000025, 0x00000503, 0x4296ac64, 0xd50e4c14, 0xd5fedd59},
0930     {0xfae6d8f2, 0x00000000, 0x0000055d, 0x057fdf2e, 0x2a31391a, 0x1cc3b17b},
0931     {0xcba828e3, 0x00000039, 0x000002ce, 0xe3f22351, 0x8f00877b, 0x270eed73},
0932     {0x13d25952, 0x0000000a, 0x0000072d, 0x76d4b4cc, 0x5eb67ec3, 0x91ecbb11},
0933     {0x0342be3f, 0x00000015, 0x00000599, 0xec75d9f1, 0x9d4d2826, 0x05ed8d0c},
0934     {0xeaa344e0, 0x00000014, 0x000004d8, 0x72a4c981, 0x2064ea06, 0x0b09ad5b},
0935     {0xbbb52021, 0x0000003b, 0x00000272, 0x04af99fc, 0xaf042d35, 0xf8d511fb},
0936     {0xb66384dc, 0x0000001d, 0x000007fc, 0xd7629116, 0x782bd801, 0x5ad832cc},
0937     {0x616c01b6, 0x00000022, 0x000002c8, 0x5b1dab30, 0x783ce7d2, 0x1214d196},
0938     {0xce2bdaad, 0x00000016, 0x0000062a, 0x932535c8, 0x3f02926d, 0x5747218a},
0939     {0x00fe84d7, 0x00000005, 0x00000205, 0x850e50aa, 0x753d649c, 0xde8f14de},
0940     {0xbebdcb4c, 0x00000006, 0x0000055d, 0xbeaa37a2, 0x2d8c9eba, 0x3563b7b9},
0941     {0xd8b1a02a, 0x00000010, 0x00000387, 0x5017d2fc, 0x503541a5, 0x071475d0},
0942     {0x3b96cad2, 0x00000036, 0x00000347, 0x1d2372ae, 0x926cd90b, 0x54c79d60},
0943     {0xc94c1ed7, 0x00000005, 0x0000038b, 0x9e9fdb22, 0x144a9178, 0x4c53eee6},
0944     {0x1aad454e, 0x00000025, 0x000002b2, 0xc3f6315c, 0x5c7a35b3, 0x10137a3c},
0945     {0xa4fec9a6, 0x00000000, 0x000006d6, 0x90be5080, 0xa4107605, 0xaa9d6c73},
0946     {0x1bbe71e2, 0x0000001f, 0x000002fd, 0x4e504c3b, 0x284ccaf1, 0xb63d23e7},
0947     {0x4201c7e4, 0x00000002, 0x000002b7, 0x7822e3f9, 0x0cc912a9, 0x7f53e9cf},
0948     {0x23fddc96, 0x00000003, 0x00000627, 0x8a385125, 0x07767e78, 0x13c1cd83},
0949     {0xd82ba25c, 0x00000016, 0x0000063e, 0x98e4148a, 0x283330c9, 0x49ff5867},
0950     {0x786f2032, 0x0000002d, 0x0000060f, 0xf201600a, 0xf561bfcd, 0x8467f211},
0951     {0xfebe4e1f, 0x0000002a, 0x000004f2, 0x95e51961, 0xfd80dcab, 0x3f9683b2},
0952     {0x1a6e0a39, 0x00000008, 0x00000672, 0x8af6c2a5, 0x78dd84cb, 0x76a3f874},
0953     {0x56000ab8, 0x0000000e, 0x000000e5, 0x36bacb8f, 0x22ee1f77, 0x863b702f},
0954     {0x4717fe0c, 0x00000000, 0x000006ec, 0x8439f342, 0x5c8e03da, 0xdc6c58ff},
0955     {0xd5d5d68e, 0x0000003c, 0x000003a3, 0x46fff083, 0x177d1b39, 0x0622cc95},
0956     {0xc25dd6c6, 0x00000024, 0x000006c0, 0x5ceb8eb4, 0x892b0d16, 0xe85605cd},
0957     {0xe9b11300, 0x00000023, 0x00000683, 0x07a5d59a, 0x6c6a3208, 0x31da5f06},
0958     {0x95cd285e, 0x00000001, 0x00000047, 0x7b3a4368, 0x0202c07e, 0xa1f2e784},
0959     {0xd9245a25, 0x0000001e, 0x000003a6, 0xd33c1841, 0x1936c0d5, 0xb07cc616},
0960     {0x103279db, 0x00000006, 0x0000039b, 0xca09b8a0, 0x77d62892, 0xbf943b6c},
0961     {0x1cba3172, 0x00000027, 0x000001c8, 0xcb377194, 0xebe682db, 0x2c01af1c},
0962     {0x8f613739, 0x0000000c, 0x000001df, 0xb4b0bc87, 0x7710bd43, 0x0fe5f56d},
0963     {0x1c6aa90d, 0x0000001b, 0x0000053c, 0x70559245, 0xda7894ac, 0xf8943b2d},
0964     {0xaabe5b93, 0x0000003d, 0x00000715, 0xcdbf42fa, 0x0c3b99e7, 0xe4d89272},
0965     {0xf15dd038, 0x00000006, 0x000006db, 0x6e104aea, 0x8d5967f2, 0x7c2f6bbb},
0966     {0x584dd49c, 0x00000020, 0x000007bc, 0x36b6cfd6, 0xad4e23b2, 0xabbf388b},
0967     {0x5d8c9506, 0x00000020, 0x00000470, 0x4c62378e, 0x31d92640, 0x1dca1f4e},
0968     {0xb80d17b0, 0x00000032, 0x00000346, 0x22a5bb88, 0x9a7ec89f, 0x5c170e23},
0969     {0xdaf0592e, 0x00000023, 0x000007b0, 0x3cab3f99, 0x9b1fdd99, 0xc0e9d672},
0970     {0x4793cc85, 0x0000000d, 0x00000706, 0xe82e04f6, 0xed3db6b7, 0xc18bdc86},
0971     {0x82ebf64e, 0x00000009, 0x000007c3, 0x69d590a9, 0x9efa8499, 0xa874fcdd},
0972     {0xb18a0319, 0x00000026, 0x000007db, 0x1cf98dcc, 0x8fa9ad6a, 0x9dc0bb48},
0973 };
0974 
0975 #include <linux/time.h>
0976 
0977 static int __init crc32c_test(void)
0978 {
0979     int i;
0980     int errors = 0;
0981     int bytes = 0;
0982     u64 nsec;
0983     unsigned long flags;
0984 
0985     /* keep static to prevent cache warming code from
0986      * getting eliminated by the compiler */
0987     static u32 crc;
0988 
0989     /* pre-warm the cache */
0990     for (i = 0; i < 100; i++) {
0991         bytes += 2*test[i].length;
0992 
0993         crc ^= __crc32c_le(test[i].crc, test_buf +
0994             test[i].start, test[i].length);
0995     }
0996 
0997     /* reduce OS noise */
0998     local_irq_save(flags);
0999     local_irq_disable();
1000 
1001     nsec = ktime_get_ns();
1002     for (i = 0; i < 100; i++) {
1003         if (test[i].crc32c_le != __crc32c_le(test[i].crc, test_buf +
1004             test[i].start, test[i].length))
1005             errors++;
1006     }
1007     nsec = ktime_get_ns() - nsec;
1008 
1009     local_irq_restore(flags);
1010     local_irq_enable();
1011 
1012     pr_info("crc32c: CRC_LE_BITS = %d\n", CRC_LE_BITS);
1013 
1014     if (errors)
1015         pr_warn("crc32c: %d self tests failed\n", errors);
1016     else {
1017         pr_info("crc32c: self tests passed, processed %d bytes in %lld nsec\n",
1018             bytes, nsec);
1019     }
1020 
1021     return 0;
1022 }
1023 
1024 static int __init crc32c_combine_test(void)
1025 {
1026     int i, j;
1027     int errors = 0, runs = 0;
1028 
1029     for (i = 0; i < 10; i++) {
1030         u32 crc_full;
1031 
1032         crc_full = __crc32c_le(test[i].crc, test_buf + test[i].start,
1033                        test[i].length);
1034         for (j = 0; j <= test[i].length; ++j) {
1035             u32 crc1, crc2;
1036             u32 len1 = j, len2 = test[i].length - j;
1037 
1038             crc1 = __crc32c_le(test[i].crc, test_buf +
1039                        test[i].start, len1);
1040             crc2 = __crc32c_le(0, test_buf + test[i].start +
1041                        len1, len2);
1042 
1043             if (!(crc_full == __crc32c_le_combine(crc1, crc2, len2) &&
1044                   crc_full == test[i].crc32c_le))
1045                 errors++;
1046             runs++;
1047             cond_resched();
1048         }
1049     }
1050 
1051     if (errors)
1052         pr_warn("crc32c_combine: %d/%d self tests failed\n", errors, runs);
1053     else
1054         pr_info("crc32c_combine: %d self tests passed\n", runs);
1055 
1056     return 0;
1057 }
1058 
1059 static int __init crc32_test(void)
1060 {
1061     int i;
1062     int errors = 0;
1063     int bytes = 0;
1064     u64 nsec;
1065     unsigned long flags;
1066 
1067     /* keep static to prevent cache warming code from
1068      * getting eliminated by the compiler */
1069     static u32 crc;
1070 
1071     /* pre-warm the cache */
1072     for (i = 0; i < 100; i++) {
1073         bytes += 2*test[i].length;
1074 
1075         crc ^= crc32_le(test[i].crc, test_buf +
1076             test[i].start, test[i].length);
1077 
1078         crc ^= crc32_be(test[i].crc, test_buf +
1079             test[i].start, test[i].length);
1080     }
1081 
1082     /* reduce OS noise */
1083     local_irq_save(flags);
1084     local_irq_disable();
1085 
1086     nsec = ktime_get_ns();
1087     for (i = 0; i < 100; i++) {
1088         if (test[i].crc_le != crc32_le(test[i].crc, test_buf +
1089             test[i].start, test[i].length))
1090             errors++;
1091 
1092         if (test[i].crc_be != crc32_be(test[i].crc, test_buf +
1093             test[i].start, test[i].length))
1094             errors++;
1095     }
1096     nsec = ktime_get_ns() - nsec;
1097 
1098     local_irq_restore(flags);
1099     local_irq_enable();
1100 
1101     pr_info("crc32: CRC_LE_BITS = %d, CRC_BE BITS = %d\n",
1102          CRC_LE_BITS, CRC_BE_BITS);
1103 
1104     if (errors)
1105         pr_warn("crc32: %d self tests failed\n", errors);
1106     else {
1107         pr_info("crc32: self tests passed, processed %d bytes in %lld nsec\n",
1108             bytes, nsec);
1109     }
1110 
1111     return 0;
1112 }
1113 
1114 static int __init crc32_combine_test(void)
1115 {
1116     int i, j;
1117     int errors = 0, runs = 0;
1118 
1119     for (i = 0; i < 10; i++) {
1120         u32 crc_full;
1121 
1122         crc_full = crc32_le(test[i].crc, test_buf + test[i].start,
1123                     test[i].length);
1124         for (j = 0; j <= test[i].length; ++j) {
1125             u32 crc1, crc2;
1126             u32 len1 = j, len2 = test[i].length - j;
1127 
1128             crc1 = crc32_le(test[i].crc, test_buf +
1129                     test[i].start, len1);
1130             crc2 = crc32_le(0, test_buf + test[i].start +
1131                     len1, len2);
1132 
1133             if (!(crc_full == crc32_le_combine(crc1, crc2, len2) &&
1134                   crc_full == test[i].crc_le))
1135                 errors++;
1136             runs++;
1137             cond_resched();
1138         }
1139     }
1140 
1141     if (errors)
1142         pr_warn("crc32_combine: %d/%d self tests failed\n", errors, runs);
1143     else
1144         pr_info("crc32_combine: %d self tests passed\n", runs);
1145 
1146     return 0;
1147 }
1148 
1149 static int __init crc32test_init(void)
1150 {
1151     crc32_test();
1152     crc32c_test();
1153 
1154     crc32_combine_test();
1155     crc32c_combine_test();
1156 
1157     return 0;
1158 }
1159 
1160 static void __exit crc32_exit(void)
1161 {
1162 }
1163 
1164 module_init(crc32test_init);
1165 module_exit(crc32_exit);
1166 #endif /* CONFIG_CRC32_SELFTEST */