| 1 |
#ifndef AWS_CHECKSUMS_PRIVATE_CRC64_PRIV_H |
| 2 |
#define AWS_CHECKSUMS_PRIVATE_CRC64_PRIV_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/checksums/exports.h> |
| 10 |
#include <aws/common/config.h> |
| 11 |
#include <aws/common/macros.h> |
| 12 |
#include <stdint.h> |
| 13 |
|
| 14 |
AWS_EXTERN_C_BEGIN |
| 15 |
|
| 16 |
AWS_CHECKSUMS_API uint64_t aws_checksums_crc64nvme_sw(const uint8_t *input, int length, uint64_t prev_crc64); |
| 17 |
|
| 18 |
AWS_CHECKSUMS_API uint64_t aws_checksums_crc64nvme_combine_sw(uint64_t crc1, uint64_t crc2, uint64_t len2); |
| 19 |
|
| 20 |
#if defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_INTEL_X64) && defined(AWS_HAVE_CLMUL) && \ |
| 21 |
!(defined(_MSC_VER) && _MSC_VER < 1920) |
| 22 |
uint64_t aws_checksums_crc64nvme_intel_clmul(const uint8_t *input, int length, uint64_t previous_crc_64); |
| 23 |
#endif |
| 24 |
|
| 25 |
#if defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_INTEL_X64) && defined(AWS_HAVE_AVX2_INTRINSICS) && \ |
| 26 |
!(defined(_MSC_VER) && _MSC_VER < 1920) |
| 27 |
uint64_t aws_checksums_crc64nvme_intel_avx512(const uint8_t *input, int length, uint64_t previous_crc_64); |
| 28 |
|
| 29 |
uint64_t aws_checksums_crc64nvme_combine_clmul(uint64_t crc1, uint64_t crc2, uint64_t len2); |
| 30 |
#endif |
| 31 |
|
| 32 |
|
| 33 |
#if defined(AWS_USE_CPU_EXTENSIONS) && defined(AWS_ARCH_ARM64) |
| 34 |
uint64_t aws_checksums_crc64nvme_arm_pmull(const uint8_t *input, int length, uint64_t previous_crc_64); |
| 35 |
|
| 36 |
uint64_t aws_checksums_crc64nvme_combine_arm_pmull(uint64_t crc1, uint64_t crc2, uint64_t len2); |
| 37 |
#endif |
| 38 |
|
| 39 |
|
| 40 |
typedef struct { |
| 41 |
uint64_t x2048[8]; |
| 42 |
uint64_t x1536[8]; |
| 43 |
uint64_t x1024[8]; |
| 44 |
uint64_t x512[8]; |
| 45 |
uint64_t x384[2]; |
| 46 |
uint64_t x256[2]; |
| 47 |
uint64_t x128[2]; |
| 48 |
uint64_t mu_poly[2]; |
| 49 |
uint64_t trailing[15][2]; |
| 50 |
uint64_t shift_factors[16][16][2]; |
| 51 |
} aws_checksums_crc64_constants_t; |
| 52 |
|
| 53 |
extern uint8_t aws_checksums_masks_shifts[6][16]; |
| 54 |
extern aws_checksums_crc64_constants_t aws_checksums_crc64nvme_constants; |
| 55 |
|
| 56 |
AWS_EXTERN_C_END |
| 57 |
|
| 58 |
#endif |