Lines Matching full:crc

40 u32 __pure crc32_le_base(u32 crc, const u8 *p, size_t len)  in crc32_le_base()  argument
43 crc = (crc >> 8) ^ crc32table_le[(crc & 255) ^ *p++]; in crc32_le_base()
44 return crc; in crc32_le_base()
48 u32 __pure crc32c_le_base(u32 crc, const u8 *p, size_t len) in crc32c_le_base() argument
51 crc = (crc >> 8) ^ crc32ctable_le[(crc & 255) ^ *p++]; in crc32c_le_base()
52 return crc; in crc32c_le_base()
58 * This follows the "little-endian" CRC convention that the lsbit
76 * crc32_generic_shift - Append @len 0 bytes to crc, in logarithmic time
77 * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
78 * @len: The number of bytes. @crc is multiplied by x^(8*@len)
81 * It's possible to parallelize CRC computations by computing a CRC
83 * This shifts the given CRC by 8*len bits (i.e. produces the same effect
87 static u32 __attribute_const__ crc32_generic_shift(u32 crc, size_t len, in crc32_generic_shift() argument
90 u32 power = polynomial; /* CRC of x^32 */ in crc32_generic_shift()
95 crc = (crc >> 1) ^ (crc & 1 ? polynomial : 0); in crc32_generic_shift()
99 return crc; in crc32_generic_shift()
104 crc = gf2_multiply(crc, power, polynomial); in crc32_generic_shift()
114 return crc; in crc32_generic_shift()
117 u32 __attribute_const__ crc32_le_shift(u32 crc, size_t len) in crc32_le_shift() argument
119 return crc32_generic_shift(crc, len, CRC32_POLY_LE); in crc32_le_shift()
122 u32 __attribute_const__ __crc32c_le_shift(u32 crc, size_t len) in __crc32c_le_shift() argument
124 return crc32_generic_shift(crc, len, CRC32C_POLY_LE); in __crc32c_le_shift()
129 u32 __pure crc32_be_base(u32 crc, const u8 *p, size_t len) in crc32_be_base() argument
132 crc = (crc << 8) ^ crc32table_be[(crc >> 24) ^ *p++]; in crc32_be_base()
133 return crc; in crc32_be_base()