| 1 | #ifndef AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H |
| 2 | #define AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H |
| 3 | /* |
| 4 | * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
| 7 | * You may not use this file except in compliance with the License. |
| 8 | * A copy of the License is located at |
| 9 | * |
| 10 | * http://aws.amazon.com/apache2.0 |
| 11 | * |
| 12 | * or in the "license" file accompanying this file. This file is distributed |
| 13 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 14 | * express or implied. See the License for the specific language governing |
| 15 | * permissions and limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #define AWS_CRC32_SIZE_BYTES 4 |
| 19 | |
| 20 | #include <aws/checksums/exports.h> |
| 21 | #include <stdint.h> |
| 22 | |
| 23 | #ifdef __cplusplus |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
| 27 | /* Computes CRC32 (Ethernet, gzip, et. al.) using a (slow) reference implementation. */ |
| 28 | AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_sw(const uint8_t *input, int length, uint32_t previousCrc32); |
| 29 | |
| 30 | /* Computes the Castagnoli CRC32c (iSCSI) using a (slow) reference implementation. */ |
| 31 | AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_sw(const uint8_t *input, int length, uint32_t previousCrc32c); |
| 32 | |
| 33 | /* Computes the Castagnoli CRC32c (iSCSI). */ |
| 34 | AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_hw(const uint8_t *data, int length, uint32_t previousCrc32); |
| 35 | |
| 36 | #ifdef __cplusplus |
| 37 | } |
| 38 | #endif |
| 39 | |
| 40 | #endif /* AWS_CHECKSUMS_PRIVATE_CRC_PRIV_H */ |
| 41 | |