Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Sep 5, 2024
1 parent cd209b7 commit 967cda5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/aws/checksums/crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AWS_CHECKSUMS_API uint32_t aws_checksums_crc32(const uint8_t *input, int length,
* Pass 0 in the previousCrc32 parameter as an initial value unless continuing
* to update a running crc in a subsequent call.
*/
AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_st(const uint8_t *input, size_t length, uint32_t previous_crc32);
AWS_CHECKSUMS_API uint32_t aws_checksums_crc32_ex(const uint8_t *input, size_t length, uint32_t previous_crc32);

/**
* The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.
Expand All @@ -44,7 +44,7 @@ AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c(const uint8_t *input, int length
* Pass 0 in the previousCrc32 parameter as an initial value unless continuing
* to update a running crc in a subsequent call.
*/
AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_st(const uint8_t *input, size_t length, uint32_t previous_crc32c);
AWS_CHECKSUMS_API uint32_t aws_checksums_crc32c_ex(const uint8_t *input, size_t length, uint32_t previous_crc32c);

/**
* The entry point function to perform a CRC64-NVME (a.k.a. CRC64-Rocksoft) computation.
Expand All @@ -65,7 +65,7 @@ AWS_CHECKSUMS_API uint64_t aws_checksums_crc64nvme(const uint8_t *input, int len
* There are many variants of CRC64 algorithms. This CRC64 variant is bit-reflected (based on
* the non bit-reflected polynomial 0xad93d23594c93659) and inverts the CRC input and output bits.
*/
AWS_CHECKSUMS_API uint64_t aws_checksums_crc64nvme_st(const uint8_t *input, size_t length, uint64_t previous_crc64);
AWS_CHECKSUMS_API uint64_t aws_checksums_crc64nvme_ex(const uint8_t *input, size_t length, uint64_t previous_crc64);

AWS_EXTERN_C_END
AWS_POP_SANE_WARNING_LEVEL
Expand Down
2 changes: 1 addition & 1 deletion include/aws/checksums/private/crc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <limits.h>

#define large_buffer_apply_impl(Name, T) \
T aws_large_buffer_apply_##Name( \
static T aws_large_buffer_apply_##Name( \
T (*checksum_fn)(const uint8_t *, int, T), const uint8_t *buffer, size_t length, T previous) { \
T val = previous; \
while (length > INT_MAX) { \
Expand Down
4 changes: 2 additions & 2 deletions source/crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ uint32_t aws_checksums_crc32(const uint8_t *input, int length, uint32_t previous
return s_crc32_fn_ptr(input, length, previous_crc32);
}

uint32_t aws_checksums_crc32_st(const uint8_t *input, size_t length, uint32_t previous_crc32) {
uint32_t aws_checksums_crc32_ex(const uint8_t *input, size_t length, uint32_t previous_crc32) {
return aws_large_buffer_apply_crc32(aws_checksums_crc32, input, length, previous_crc32);
}

Expand All @@ -54,6 +54,6 @@ uint32_t aws_checksums_crc32c(const uint8_t *input, int length, uint32_t previou
return s_crc32c_fn_ptr(input, length, previous_crc32c);
}

uint32_t aws_checksums_crc32c_st(const uint8_t *input, size_t length, uint32_t previous_crc32) {
uint32_t aws_checksums_crc32c_ex(const uint8_t *input, size_t length, uint32_t previous_crc32) {
return aws_large_buffer_apply_crc32(aws_checksums_crc32c, input, length, previous_crc32);
}
2 changes: 1 addition & 1 deletion source/crc64.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ uint64_t aws_checksums_crc64nvme(const uint8_t *input, int length, uint64_t prev
return s_crc64nvme_fn_ptr(input, length, prev_crc64);
}

uint64_t aws_checksums_crc64nvme_st(const uint8_t *input, size_t length, uint64_t previous_crc64) {
uint64_t aws_checksums_crc64nvme_ex(const uint8_t *input, size_t length, uint64_t previous_crc64) {
return aws_large_buffer_apply_crc64(aws_checksums_crc64nvme, input, length, previous_crc64);
}
2 changes: 1 addition & 1 deletion tests/crc64_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static int s_test_large_buffer_crc64(struct aws_allocator *allocator, void *ctx)
#else
const size_t len = 3 * 1024 * 1024 * 1024ULL;
const uint8_t *many_zeroes = aws_mem_calloc(allocator, len, sizeof(uint8_t));
uint64_t result = aws_checksums_crc64nvme_st(many_zeroes, len, 0);
uint64_t result = aws_checksums_crc64nvme_ex(many_zeroes, len, 0);
aws_mem_release(allocator, (void *)many_zeroes);
ASSERT_HEX_EQUALS(0xa1dddd7c6fd17075, result);
return AWS_OP_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion tests/crc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int s_test_large_buffer_crc32(struct aws_allocator *allocator, void *ctx)
#else
const size_t len = 3 * 1024 * 1024 * 1024ULL;
const uint8_t *many_zeroes = aws_mem_calloc(allocator, len, sizeof(uint8_t));
uint32_t result = aws_checksums_crc32_st(many_zeroes, len, 0);
uint32_t result = aws_checksums_crc32_ex(many_zeroes, len, 0);
aws_mem_release(allocator, (void *)many_zeroes);
ASSERT_HEX_EQUALS(0x480BBE37, result);
return AWS_OP_SUCCESS;
Expand Down

0 comments on commit 967cda5

Please sign in to comment.