Skip to content

Add crc64c support - #138

Open
alan-divd wants to merge 1 commit into
fox-it:mainfrom
alan-divd:feat/crc64c
Open

alan-divd wants to merge 1 commit into
fox-it:mainfrom
alan-divd:feat/crc64c

Conversation

@alan-divd

Copy link
Copy Markdown

Summary

Adds CRC-64/NVME, the 64 bit counterpart to the existing crc32c, in both a
pure Python and a native Rust implementation.

The layout follows crc32c exactly, so dissect.util.hash.crc64c resolves to
the native version when the extension is available and falls back to Python
otherwise, with crc64c_native and crc64c_python available for picking one
explicitly.

Parameters are polynomial 0xAD93D23594C93659, reflected, with all-ones init
and xorout.

Test plan

  • tox run -e py3 passes (163 passed, 63 skipped)
  • Matches the official CRC-64/NVME check value,
    crc64c(b"123456789") == 0xae8b14860a799888
  • Cross-checked against an independent from-spec bitwise reference
    implementation rather than only against itself
  • Native and Python agree over 300 randomized inputs, including chunked
    updates composed via the value argument
  • The shared crc64c fixture runs every case against both
    implementations, matching how crc32c is tested

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant