I want to do some CRC check in my own userspace programme. And I find that the kernel crypto lib is already in the system, and come with SSE4.2 support.
I tried to directly #include <linux/crc32c.h> and run gcc with -I/usr/src/linux/include/. However, it doesnot work.
Any way to use some kind of libcrc32c ?
You can use kernel crypto
CRC32c(and other hash/cipher functions) from user-space via socket family AF_ALG on Linux:If you’re hashing files or socket data you can speed it up using zero-copy approach to avoid kernel -> user-space buffer copy with
sendfileand/orsplice.Happy coding.