1#ifndef AWS_CHECKSUMS_CRC_H
2#define AWS_CHECKSUMS_CRC_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#include <aws/checksums/exports.h>
19#include <stdint.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/**
26 * The entry point function to perform a CRC32 (Ethernet, gzip) computation.
27 * Selects a suitable implementation based on hardware capabilities.
28 * Pass 0 in the previousCrc32 parameter as an initial value unless continuing
29 * to update a running crc in a subsequent call.
30 */
31AWS_CHECKSUMS_API uint32_t aws_checksums_crc32(const uint8_t *input, int length, uint32_t previousCrc32);
32
33/**
34 * The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.
35 * Selects a suitable implementation based on hardware capabilities.
36 * Pass 0 in the previousCrc32 parameter as an initial value unless continuing
37 * to update a running crc in a subsequent call.
38 */
39AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c(const uint8_t *input, int length, uint32_t previousCrc32);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* AWS_CHECKSUMS_CRC_H */
46