lib-crc provides small no-std CRC primitives shared by EriX storage and filesystem components
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Erik Inkinen 7c98f194e3
All checks were successful
CI / markdown (push) Successful in 17s
CI / test (push) Successful in 2m21s
feat: Check checksum contracts on host and freestanding targets
Integrate the human-reviewed change from lib-crc#6.
2026-11-12 18:55:32 +02:00
.github feat: Check checksum contracts on host and freestanding targets 2026-11-12 18:55:32 +02:00
src refactor: Simplify CRC updates and raw-state contracts 2026-10-30 19:20:05 +02:00
.editorconfig Initial commit 2026-05-03 15:32:22 +02:00
.gitignore Initial commit 2026-05-03 15:32:22 +02:00
.markdownlint-cli2.yaml Tighten CI markdown policy 2026-05-22 15:10:15 +03:00
ARCHITECTURE.md ci: Check checksum contracts on host and freestanding targets 2026-10-30 19:20:06 +02:00
Cargo.toml Add shared CRC library 2026-05-03 16:42:12 +03:00
CODE_OF_CONDUCT.md docs: Synchronize shared contribution and review policies 2026-09-12 06:38:15 +03:00
CONTRIBUTING.md docs: Align dependency selection and review policy 2026-10-30 19:20:05 +02:00
LICENSE Initial commit 2026-05-03 15:32:22 +02:00
README.md refactor: Simplify CRC updates and raw-state contracts 2026-10-30 19:20:05 +02:00
ROADMAP.md ci: Check checksum contracts on host and freestanding targets 2026-10-30 19:20:06 +02:00
rustfmt.toml Initial commit 2026-05-03 15:32:22 +02:00
SECURITY.md docs: Synchronize shared contribution and review policies 2026-09-12 06:38:15 +03:00

lib-crc

lib-crc provides no-std CRC primitives for EriX storage and filesystem code: reflected IEEE CRC-32, non-reflected IEEE CRC-32, and CRC-32C Castagnoli.

EriX is a clean-room, capability-based microkernel operating system written entirely in Rust. See ARCHITECTURE for the checksum contracts, ROADMAP for remaining work, and the project documentation for system design.

Purpose of This Repository

The library centralizes the CRC recurrences used by lib-partition and e2fsd. It accepts borrowed byte slices and scalar seeds, returns scalar checksums, and performs no allocation, I/O, storage parsing or capability operation.

The one-shot crc32_ieee and crc32c functions apply the standard initial state and final xor. Their rolling update forms accept and return raw state; finalize only after the last chunk. crc32_be_update preserves the non-reflected raw state used by legacy journal checksums. Every byte value and raw seed is valid. CRCs detect corruption; they do not authenticate input.

Build the source API documentation with cargo doc --no-deps --document-private-items.

Clean-Room Policy

All implementation and test code must be original EriX work, derived from specifications and documented algorithms. No external Rust dependencies, copied implementations, or generators embedding third-party code are allowed. See CONTRIBUTING.

License

This repository uses the ISC License.

Development Model

Preserve checksum compatibility and the pure, allocation-free API. Follow the project priority order: security, reliability, then performance. Consider acceleration only after representative profiling establishes a bottleneck.

Validation

The crate has no dependency or feature variants beyond its empty default set. Run host checks and build the freestanding library without warnings:

cargo fmt --all -- --check
RUSTFLAGS="-D warnings" cargo clippy --all-targets --all-features -- -D warnings
RUSTFLAGS="-D warnings" cargo test --all-targets --all-features
RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo test --doc --all-features
RUSTFLAGS="-D warnings" cargo build --lib --target x86_64-unknown-none --release
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items

The freestanding target must be installed in the selected Rust toolchain. Host unit tests and a freestanding compilation do not establish a guest build.

Governance Principles

Keep public checksum semantics narrow and documented. Changes to polynomial, reflection, initialization or final xor require coordinated consumer updates. Shared governance files remain identical to meta; component documentation uses its formats with checksum-specific content.

Library Boundaries

The library borrows only the supplied bytes during a call and retains no caller state or authority. Storage validation, byte-order conversion, input-size budgets and authentication belong to consumers. No runtime service or device discovery belongs in this crate.

Contact

Discuss changes in the EriX organization. Contact admin@erikinkinen.fi for governance matters and follow SECURITY for private security reports.