mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-11 15:46:40 +02:00
feb541bfac
Following what was done for the CRC32 and CRC-T10DIF library functions, get rid of the pointless use of the crypto API and make crc64_rocksoft_update() call into the library directly. This is faster and simpler. Remove crc64_rocksoft() (the version of the function that did not take a 'crc' argument) since it is unused. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com> Acked-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20250130035130.180676-2-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
28 lines
796 B
C
28 lines
796 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* See lib/crc64.c for the related specification and polynomial arithmetic.
|
|
*/
|
|
#ifndef _LINUX_CRC64_H
|
|
#define _LINUX_CRC64_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#define CRC64_ROCKSOFT_STRING "crc64-rocksoft"
|
|
|
|
u64 __pure crc64_be(u64 crc, const void *p, size_t len);
|
|
u64 __pure crc64_rocksoft_generic(u64 crc, const void *p, size_t len);
|
|
|
|
/**
|
|
* crc64_rocksoft_update - Calculate bitwise Rocksoft CRC64
|
|
* @crc: seed value for computation. 0 for a new CRC calculation, or the
|
|
* previous crc64 value if computing incrementally.
|
|
* @p: pointer to buffer over which CRC64 is run
|
|
* @len: length of buffer @p
|
|
*/
|
|
static inline u64 crc64_rocksoft_update(u64 crc, const u8 *p, size_t len)
|
|
{
|
|
return crc64_rocksoft_generic(crc, p, len);
|
|
}
|
|
|
|
#endif /* _LINUX_CRC64_H */
|