Thank you for your interest in contributing to QShield. This document covers the development setup, coding standards, and pull request process.
- Rust 1.74 or later (stable toolchain)
- Git
git clone https://github.com/jbaelaw/qshield.git
cd qshield
# Debug build
cargo build
# Release build (optimized, stripped)
cargo build --release
# Run all tests
cargo test
# Run linter
cargo clippy --all-targets -- -D warnings
# Check formatting
cargo fmt --check
# Apply formatting
cargo fmtsrc/
├── main.rs # CLI entry point and command handlers
├── crypto/
│ ├── kem.rs # Hybrid ML-KEM-768 + X25519 encapsulation
│ ├── kdf.rs # Argon2id and HKDF key derivation
│ └── symmetric.rs # AES-256-GCM encryption (single-shot + streaming)
├── volume/
│ └── format.rs # QSV file header serialization
├── tui/
│ ├── app.rs # Terminal UI state machine
│ └── widgets.rs # Ratatui UI components
├── error.rs # Error types
└── ui.rs # CLI output formatting
- All code must pass
cargo clippy --all-targets -- -D warningswith zero warnings - All code must pass
cargo fmt --check(usesrustfmt.tomlin the repo root) - Maximum line width: 120 characters
- Use
thiserrorfor error types; implementFrom<std::io::Error>where appropriate
- All sensitive key material must be zeroized after use via the
zeroizecrate - Never log, print, or serialize key material (even in debug builds)
- Use
OsRng(viarand::rngs::OsRng) for all cryptographic randomness - Validate all input sizes before cryptographic operations
- Prefer constant-time operations for key comparisons
- All cryptographic primitives must have roundtrip tests
- Test error cases (wrong key, corrupted data, truncated input)
- Use
#[cfg(test)]modules within each source file - Integration tests should use
cargo testand temporary files
- Fork the repository and create a feature branch from
master - Implement your changes following the coding standards above
- Test locally:
cargo test cargo clippy --all-targets -- -D warnings cargo fmt --check - Commit with a clear, descriptive message explaining why (not just what)
- Open a PR against
masterwith:- A summary of changes
- Motivation / context
- Test plan (what you tested and how)
- CI must pass — the PR will be checked by automated tests, clippy, and formatting on Ubuntu, macOS, and Windows
<scope>: <concise description>
<optional body explaining motivation and trade-offs>
Examples:
crypto: add ML-KEM-1024 support for Level 5 securityformat: extend QSV header with content type fieldtui: add disk encryption menu items
- Bugs: Open a GitHub Issue with reproduction steps, expected vs. actual behavior, and your platform/version
- Security vulnerabilities: See SECURITY.md — do not open a public issue
- Feature requests: Open a GitHub Issue with a description of the use case
By contributing, you agree that your contributions will be licensed under the MIT License.