Skip to content

Conversation

@onethumb
Copy link
Contributor

The Problem

We'd like to increase our confidence in the memory safety of this crate.

The Solution

Add extensive fuzz testing using libFuzzer.

Changes

  • Adds fuzz tests for all the major CRC variants which use different hardware-accelerated paths (32, 64, reflected, forward, fusion, etc) for both checksum and Digest calculations.
  • Update README.

Planned version bump

  • Which: PATCH
  • Why: non-breaking fuzz testing

@onethumb onethumb requested a review from Copilot November 15, 2025 17:51
Copilot finished reviewing on behalf of onethumb November 15, 2025 17:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive fuzz testing infrastructure using libFuzzer to improve confidence in the memory safety of the crate's hardware-accelerated CRC implementations.

  • Introduces 12 individual fuzz targets covering checksum and Digest calculations for all major CRC variants (32/64-bit, reflected/forward, fusion techniques)
  • Adds fuzz testing configuration with dedicated Cargo workspace
  • Documents memory safety validation approach in README

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
fuzz/Cargo.toml Configures fuzz testing workspace with libfuzzer-sys dependency and 12 bin targets for individual fuzz tests
fuzz/Cargo.lock Lock file for fuzz testing dependencies
fuzz/.gitignore Ignores fuzz testing artifacts (target, corpus, artifacts, coverage)
fuzz/fuzz_targets/digest_crc32_autosar.rs Fuzz target for CRC-32/AUTOSAR Digest (reflected variant)
fuzz/fuzz_targets/digest_crc32_bzip2.rs Fuzz target for CRC-32/BZIP2 Digest (forward variant)
fuzz/fuzz_targets/digest_crc32_iscsi.rs Fuzz target for CRC-32/ISCSI Digest (reflected with x86/aarch64 fusion)
fuzz/fuzz_targets/digest_crc32_iso_hdlc.rs Fuzz target for CRC-32/ISO-HDLC Digest (reflected with aarch64 fusion)
fuzz/fuzz_targets/digest_crc64_ecma_182.rs Fuzz target for CRC-64/ECMA-182 Digest (forward variant)
fuzz/fuzz_targets/digest_crc64_nvme.rs Fuzz target for CRC-64/NVME Digest (reflected variant)
fuzz/fuzz_targets/checksum_crc32_autosar.rs Fuzz target for CRC-32/AUTOSAR checksum (reflected variant)
fuzz/fuzz_targets/checksum_crc32_bzip2.rs Fuzz target for CRC-32/BZIP2 checksum (forward variant)
fuzz/fuzz_targets/checksum_crc32_iscsi.rs Fuzz target for CRC-32/ISCSI checksum (reflected with x86/aarch64 fusion)
fuzz/fuzz_targets/checksum_crc32_iso_hdlc.rs Fuzz target for CRC-32/ISO-HDLC checksum (reflected with aarch64 fusion)
fuzz/fuzz_targets/checksum_crc64_ecma_182.rs Fuzz target for CRC-64/ECMA-182 checksum (forward variant)
fuzz/fuzz_targets/checksum_crc64_nvme.rs Fuzz target for CRC-64/NVME checksum (reflected variant)
fuzz/fuzz_targets/digest.rs General fuzz target file that is not configured in Cargo.toml and contains unused/incorrect code
README.md Adds "Memory Safety" section documenting validation using Miri and libFuzzer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@onethumb onethumb merged commit 49a2b52 into awesomized:main Nov 16, 2025
106 checks passed
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