Lines Matching refs:crc
3 * crc32.c - CRC32 and CRC32C using LoongArch crc* instructions
18 #define _CRC32(crc, value, size, type) \
22 : "+r" (crc) \
27 #define CRC32(crc, value, size) _CRC32(crc, value, size, crc)
28 #define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc)
32 u32 crc = crc_;
37 CRC32(crc, value, d);
45 CRC32(crc, value, w);
53 CRC32(crc, value, h);
60 CRC32(crc, value, b);
63 return crc;
68 u32 crc = crc_;
73 CRC32C(crc, value, d);
81 CRC32C(crc, value, w);
89 CRC32C(crc, value, h);
96 CRC32C(crc, value, b);
99 return crc;
110 u32 crc;
118 ctx->crc = mctx->key;
143 ctx->crc = crc32_loongarch_hw(ctx->crc, data, length);
151 ctx->crc = crc32c_loongarch_hw(ctx->crc, data, length);
159 put_unaligned_le32(ctx->crc, out);
167 put_unaligned_le32(~ctx->crc, out);
171 static int __chksum_finup(u32 crc, const u8 *data, unsigned int len, u8 *out)
173 put_unaligned_le32(crc32_loongarch_hw(crc, data, len), out);
177 static int __chksumc_finup(u32 crc, const u8 *data, unsigned int len, u8 *out)
179 put_unaligned_le32(~crc32c_loongarch_hw(crc, data, len), out);
187 return __chksum_finup(ctx->crc, data, len, out);
194 return __chksumc_finup(ctx->crc, data, len, out);
303 MODULE_DESCRIPTION("CRC32 and CRC32C using LoongArch crc* instructions");