Lines Matching full:crc
3 * crc32.c - CRC32 and CRC32C using LoongArch crc* instructions
18 #define _CRC32(crc, value, size, type) \ argument
22 : "+r" (crc) \
27 #define CRC32(crc, value, size) _CRC32(crc, value, size, crc) argument
28 #define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc) argument
32 u32 crc = crc_; in crc32_loongarch_hw() local
37 CRC32(crc, value, d); in crc32_loongarch_hw()
45 CRC32(crc, value, w); in crc32_loongarch_hw()
52 CRC32(crc, value, h); in crc32_loongarch_hw()
59 CRC32(crc, value, b); in crc32_loongarch_hw()
62 return crc; in crc32_loongarch_hw()
67 u32 crc = crc_; in crc32c_loongarch_hw() local
72 CRC32C(crc, value, d); in crc32c_loongarch_hw()
80 CRC32C(crc, value, w); in crc32c_loongarch_hw()
87 CRC32C(crc, value, h); in crc32c_loongarch_hw()
94 CRC32C(crc, value, b); in crc32c_loongarch_hw()
97 return crc; in crc32c_loongarch_hw()
108 u32 crc; member
116 ctx->crc = mctx->key; in chksum_init()
141 ctx->crc = crc32_loongarch_hw(ctx->crc, data, length); in chksum_update()
149 ctx->crc = crc32c_loongarch_hw(ctx->crc, data, length); in chksumc_update()
157 put_unaligned_le32(ctx->crc, out); in chksum_final()
165 put_unaligned_le32(~ctx->crc, out); in chksumc_final()
169 static int __chksum_finup(u32 crc, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() argument
171 put_unaligned_le32(crc32_loongarch_hw(crc, data, len), out); in __chksum_finup()
175 static int __chksumc_finup(u32 crc, const u8 *data, unsigned int len, u8 *out) in __chksumc_finup() argument
177 put_unaligned_le32(~crc32c_loongarch_hw(crc, data, len), out); in __chksumc_finup()
185 return __chksum_finup(ctx->crc, data, len, out); in chksum_finup()
192 return __chksumc_finup(ctx->crc, data, len, out); in chksumc_finup()
299 MODULE_DESCRIPTION("CRC32 and CRC32C using LoongArch crc* instructions");