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);
52 CRC32(crc, value, h);
59 CRC32(crc, value, b);
62 return crc;
67 u32 crc = crc_;
72 CRC32C(crc, value, d);
80 CRC32C(crc, value, w);
87 CRC32C(crc, value, h);
94 CRC32C(crc, value, b);
97 return crc;
108 u32 crc;
116 ctx->crc = mctx->key;
141 ctx->crc = crc32_loongarch_hw(ctx->crc, data, length);
149 ctx->crc = crc32c_loongarch_hw(ctx->crc, data, length);
157 put_unaligned_le32(ctx->crc, out);
165 put_unaligned_le32(~ctx->crc, out);
169 static int __chksum_finup(u32 crc, const u8 *data, unsigned int len, u8 *out)
171 put_unaligned_le32(crc32_loongarch_hw(crc, data, len), out);
175 static int __chksumc_finup(u32 crc, const u8 *data, unsigned int len, u8 *out)
177 put_unaligned_le32(~crc32c_loongarch_hw(crc, data, len), out);
185 return __chksum_finup(ctx->crc, data, len, out);
192 return __chksumc_finup(ctx->crc, data, len, out);
299 MODULE_DESCRIPTION("CRC32 and CRC32C using LoongArch crc* instructions");