1 #ifndef AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H 2 #define AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H 3 /** 4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 5 * SPDX-License-Identifier: Apache-2.0. 6 */ 7 8 #define AWS_CRC32_SIZE_BYTES 4 9 10 #include <aws/checksums/exports.h> 11 #include <stdint.h> 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 /* Computes CRC32 (Ethernet, gzip, et. al.) using a (slow) reference implementation. */ 18 AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_sw(const uint8_t *input, int length, uint32_t previousCrc32); 19 20 /* Computes the Castagnoli CRC32c (iSCSI) using a (slow) reference implementation. */ 21 AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_sw(const uint8_t *input, int length, uint32_t previousCrc32c); 22 23 /* Computes the Castagnoli CRC32c (iSCSI). */ 24 AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_hw(const uint8_t *data, int length, uint32_t previousCrc32); 25 26 /* Computes CRC32 (Ethernet, gzip, et. al.) using crc instructions. */ 27 AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_hw(const uint8_t *data, int length, uint32_t previousCrc32); 28 29 #ifdef __cplusplus 30 } 31 #endif 32 33 #endif /* AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H */ 34