aws / aws-sdk-js-crypto-helpers

AWS Cryptographic helpers for Javascript and Node.js
Apache License 2.0
62 stars 34 forks source link

CRC64 implementation in @aws-crypto #844

Open trivikr opened 2 months ago

trivikr commented 2 months ago

Is your feature request related to a problem? Please describe.

The AWS SDK for JavaScript (v3) has a new requirement for using CRC64 checksum algorithm.

For CRC32, the JS SDK v3 currently uses the implementations provided by Crypto:

We would like to use CRC64 implementation from @aws-crypto/crc64.

Describe the solution you'd like

The CRC64 implementation is provided in @aws-crypto/crc64

Describe alternatives you've considered

trivikr commented 2 months ago

Specification of CRC64 implementation that we're looking for http://www.ross.net/crc/download/crc_v3.txt

The Rocksoft (NVME) 64-bit CRC model parameters are as follows:

    Poly: 0xAD93D23594C93659
    Initial value: 0xFFFFFFFFFFFFFFFF
    Reflected Input: True
    Reflected Output: True
    Xor Final: 0xFFFFFFFFFFFFFFFF
trivikr commented 2 months ago

CRC64 rocksoft implementation in Linux

https://github.com/torvalds/linux/blob/master/lib/crc64-rocksoft.c