[FEATURE] Audit authority, code quality and documentation in lib-crc #1

Closed
opened 2026-09-12 07:57:43 +02:00 by erikinkinen · 2 comments
Owner

Problem and motivation

Review the CRC library and its storage callers while preserving their checksum
dialects. A matching checksum must never authorize access or authenticate data.

Proposed behavior and scope

Keep reflected IEEE CRC-32, non-reflected IEEE CRC-32 and Castagnoli CRC-32C
compatible. Cover the complete crate, workflow, documentation and the
lib-partition and e2fsd consumer selections.

Authority, security and reliability

Calls borrow immutable bytes and scalar seeds, return scalar state, and retain
nothing. The crate has no allocation, I/O, capabilities, unsafe code or FFI.
Replay, revocation and cleanup protocols do not apply to this synchronous
computation. Consumers own format validation, authentication and scheduling.

Acceptance criteria

  • Review all APIs, lifetimes, arithmetic and caller responsibilities.
  • Check raw/finalized state, empty inputs, arbitrary seeds and chunk boundaries.
  • Review obsolete APIs, duplication, feature boundaries and incidental limits.
  • Preserve pure computation without ambient, residual or unnecessary authority.
  • Keep authored code below 1,000 lines with enforced, useful rustdoc.
  • Pass formatting, strict Clippy, host tests, doctests and warning-denied builds/rustdoc.
  • Reconcile the exact library selected by both storage consumers and their results.
  • Update component documents and confirm the unchanged manual/API contract.

Alternatives and tradeoffs

The shared reflected recurrence avoids duplication. Bitwise updates use constant
space and eight state steps per byte. No measured consumer bottleneck justifies
tables or hardware acceleration; preserve the auditable implementation.

Tracking and rollout

PR 2 contains the signed
changes. Phase completion
tracks the separate guest and toolchain builds. Cargo manifests track main;
CI retains exact original revisions for each complete resolved graph.

## Problem and motivation Review the CRC library and its storage callers while preserving their checksum dialects. A matching checksum must never authorize access or authenticate data. ## Proposed behavior and scope Keep reflected IEEE CRC-32, non-reflected IEEE CRC-32 and Castagnoli CRC-32C compatible. Cover the complete crate, workflow, documentation and the `lib-partition` and `e2fsd` consumer selections. ## Authority, security and reliability Calls borrow immutable bytes and scalar seeds, return scalar state, and retain nothing. The crate has no allocation, I/O, capabilities, unsafe code or FFI. Replay, revocation and cleanup protocols do not apply to this synchronous computation. Consumers own format validation, authentication and scheduling. ## Acceptance criteria - [x] Review all APIs, lifetimes, arithmetic and caller responsibilities. - [x] Check raw/finalized state, empty inputs, arbitrary seeds and chunk boundaries. - [x] Review obsolete APIs, duplication, feature boundaries and incidental limits. - [x] Preserve pure computation without ambient, residual or unnecessary authority. - [x] Keep authored code below 1,000 lines with enforced, useful rustdoc. - [x] Pass formatting, strict Clippy, host tests, doctests and warning-denied builds/rustdoc. - [x] Reconcile the exact library selected by both storage consumers and their results. - [x] Update component documents and confirm the unchanged manual/API contract. ## Alternatives and tradeoffs The shared reflected recurrence avoids duplication. Bitwise updates use constant space and eight state steps per byte. No measured consumer bottleneck justifies tables or hardware acceleration; preserve the auditable implementation. ## Tracking and rollout [PR 2](https://git.erikinkinen.fi/erix/lib-crc/pulls/2) contains the signed changes. [Phase completion](https://git.erikinkinen.fi/erix/integration/issues/65) tracks the separate guest and toolchain builds. Cargo manifests track `main`; CI retains exact original revisions for each complete resolved graph.
erikinkinen changed title from [FEATURE] [P02.R36] Audit authority, code quality and documentation in lib-crc to [FEATURE] Audit authority, code quality and documentation in lib-crc 2026-09-12 08:02:24 +02:00
Author
Owner

The signed checkpoint completes the full public/private inline review. It corrects the shared accumulator's caller description and includes private items in CI rustdoc. Algorithm, API and existing test behavior are unchanged. Wider audit, consumer and timing work remain open.

The [signed checkpoint](https://git.erikinkinen.fi/erix/lib-crc/commit/5d7582e4f2f9bf83359a725781b33b6c27514157) completes the full public/private inline review. It corrects the shared accumulator's caller description and includes private items in CI rustdoc. Algorithm, API and existing test behavior are unchanged. Wider audit, consumer and timing work remain open.
Author
Owner

Completed the whole crate and workflow review at b18e256b. The API remains pure, allocation-free computation with no retained authority or incidental input limit. The implementation and all eight documented public routes are unchanged from the reviewed source.

Component run 42 passes. Partition run 42 and filesystem run 427 select the same implementation and pass their checksum consumer cases. Closing the component audit; PR 2 remains draft for maintainer review.

Completed the whole crate and workflow review at [b18e256b](https://git.erikinkinen.fi/erix/lib-crc/commit/b18e256b). The API remains pure, allocation-free computation with no retained authority or incidental input limit. The implementation and all eight documented public routes are unchanged from the reviewed source. [Component run 42](https://git.erikinkinen.fi/erix/lib-crc/actions/runs/42) passes. [Partition run 42](https://git.erikinkinen.fi/erix/lib-partition/actions/runs/42) and [filesystem run 427](https://git.erikinkinen.fi/erix/e2fsd/actions/runs/427) select the same implementation and pass their checksum consumer cases. Closing the component audit; PR 2 remains draft for maintainer review.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:39 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/lib-crc#1
No description provided.