xref: /spdk/lib/util/crc32_ieee.c (revision 6f338d4bf3a8a91b7abe377a605a321ea2b05bf7)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (c) Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #include "util_internal.h"
7 #include "spdk/crc32.h"
8 
9 static struct spdk_crc32_table g_crc32_ieee_table;
10 
11 __attribute__((constructor)) static void
12 crc32_ieee_init(void)
13 {
14 	crc32_table_init(&g_crc32_ieee_table, SPDK_CRC32_POLYNOMIAL_REFLECT);
15 }
16 
17 uint32_t
18 spdk_crc32_ieee_update(const void *buf, size_t len, uint32_t crc)
19 {
20 	return crc32_update(&g_crc32_ieee_table, buf, len, crc);
21 }
22