xref: /linux-6.15/include/linux/crc64.h (revision feb541bf)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * See lib/crc64.c for the related specification and polynomial arithmetic.
4  */
5 #ifndef _LINUX_CRC64_H
6 #define _LINUX_CRC64_H
7 
8 #include <linux/types.h>
9 
10 #define CRC64_ROCKSOFT_STRING "crc64-rocksoft"
11 
12 u64 __pure crc64_be(u64 crc, const void *p, size_t len);
13 u64 __pure crc64_rocksoft_generic(u64 crc, const void *p, size_t len);
14 
15 /**
16  * crc64_rocksoft_update - Calculate bitwise Rocksoft CRC64
17  * @crc: seed value for computation. 0 for a new CRC calculation, or the
18  *	 previous crc64 value if computing incrementally.
19  * @p: pointer to buffer over which CRC64 is run
20  * @len: length of buffer @p
21  */
22 static inline u64 crc64_rocksoft_update(u64 crc, const u8 *p, size_t len)
23 {
24 	return crc64_rocksoft_generic(crc, p, len);
25 }
26 
27 #endif /* _LINUX_CRC64_H */
28