xref: /spdk/include/spdk/crc64.h (revision 86d0b37cada0e9541d605c76573da17819e94ca9)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2023 Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 /**
7  * \file
8  * CRC-64 utility functions
9  */
10 
11 #ifndef SPDK_CRC64_H
12 #define SPDK_CRC64_H
13 
14 #include "spdk/stdinc.h"
15 #include "spdk/config.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**
22  * Calculate a CRC-64 checksum (Rocksoft), for NVMe Protection Information
23  *
24  * \param buf Data buffer to checksum.
25  * \param len Length of buf in bytes.
26  * \param crc Previous CRC-64 value.
27  * \return Updated CRC-64 value.
28  */
29 uint64_t spdk_crc64_nvme(const void *buf, size_t len, uint64_t crc);
30 
31 #ifdef __cplusplus
32 }
33 #endif
34 
35 #endif /* SPDK_CRC64_H */
36