2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2022-11-01 20:26:26 +00:00
|
|
|
* Copyright (C) 2017 Intel Corporation.
|
2016-08-02 16:34:45 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2020-05-13 18:40:57 +00:00
|
|
|
#include "util_internal.h"
|
2017-07-21 21:44:43 +00:00
|
|
|
#include "spdk/crc32.h"
|
2016-08-02 16:34:45 +00:00
|
|
|
|
2017-07-21 21:44:43 +00:00
|
|
|
static struct spdk_crc32_table g_crc32_ieee_table;
|
2016-08-02 16:34:45 +00:00
|
|
|
|
2017-07-21 21:44:43 +00:00
|
|
|
__attribute__((constructor)) static void
|
2020-05-10 00:56:03 +00:00
|
|
|
crc32_ieee_init(void)
|
2017-07-21 21:44:43 +00:00
|
|
|
{
|
2020-05-13 18:40:57 +00:00
|
|
|
crc32_table_init(&g_crc32_ieee_table, SPDK_CRC32_POLYNOMIAL_REFLECT);
|
2017-07-21 21:44:43 +00:00
|
|
|
}
|
2016-08-02 16:34:45 +00:00
|
|
|
|
2017-07-21 21:44:43 +00:00
|
|
|
uint32_t
|
|
|
|
spdk_crc32_ieee_update(const void *buf, size_t len, uint32_t crc)
|
|
|
|
{
|
2020-05-13 18:40:57 +00:00
|
|
|
return crc32_update(&g_crc32_ieee_table, buf, len, crc);
|
2017-07-21 21:44:43 +00:00
|
|
|
}
|