crypto: enforce lint-clean safety boundaries - #85
Open
loadingalias wants to merge 9 commits into
Open
Conversation
Remove repository-wide lint suppression debt and make feature and target reachability explicit across portable and accelerated implementations. Harden arithmetic, bounds, secret handling, unsafe and ASM contracts, dispatch, tests, fuzz targets, and validation tooling. This intentionally breaks RSA blinding inputs, forced ChaCha20 diagnostic calls, and RISC-V CRC-64 force modes.
Pin Nextest and disable retries so test failures remain visible. Reject yanked crates against the locked dependency graph.
Activate each resolved toolchain through RUSTUP_TOOLCHAIN so repository overrides cannot substitute development Rust. Keep platform and feature-specific checks warning-free under their actual compiler contracts.
Clear caller startup hooks before launching fixture subprocesses so mocked PATH entries cannot be replaced by host shell initialization.
Write the validated exact toolchain through the repository-owned setup script so action inputs never reach GitHub environment-file syntax. Extend ownership and integrity checks for that boundary.
…305 AVX2/AVX-512 kernels to as_chunks auth: gate ed25519 AVX2/IFMA point tests behind the ed25519 feature and migrate point chunking to as_chunks clippy: document missing # Safety on ct-binsec-harness AVX2/IFMA entrypoints Restoring strict cross-target and feature-matrix validation surfaced four latent CI failures: s390x test builds referenced the fixslice AES module after it was excluded from s390x test cfg, x25519-only builds pulled in ed25519-gated point_avx2 tests that were never feature-gated, and the new clippy::chunks_exact_to_as_chunks lint plus missing_safety_doc caught real gaps in the ChaCha20/Poly1305/Ed25519 SIMD kernels and the CT harness.
…5519 The previous ed25519 test-feature gate on point_avx2's mod tests exposed a second layer of latent breakage under --features x25519 (no ed25519): several AVX2/IFMA internals (wNAF tables, cached-point builders, field squaring/shuffle helpers in point_avx2, field_avx2, and field_ifma) were gated any(test, ed25519) so they kept compiling under test alone, but their only real callers are the vartime scalar-mul and Straus verification paths, which are ed25519-only and were never reachable without it. That left them dead code once the test module required ed25519 too. Tighten those internals to feature = "ed25519" and gate the field_avx2 and field_ifma test modules the same way as point_avx2's. Traced the call graph to confirm none of this is reachable from x25519's fixed-base basepoint_mul_dispatch path, which stays available under x25519-only. Verified via a x86_64 cross-compile (zig cc) since ring/aws-lc-sys dev dependencies can't cross-link natively here: x25519-only lib+tests check and clippy are clean, ed25519+x25519 combined check is clean, and the native all-features suite still passes at 1061/1061.
auth: keep basepoint_mul_dispatch reachable under single-curve feature sets
Two more dead-code gaps surfaced by the stricter feature-matrix check.
x86_64_ni's plain encrypt_4blocks/encrypt_4blocks_128 were the only
ungated variants in that file (their _aesni and 16-block siblings already
carry the aes-gcm/aes-gcm-siv gate); under aegis256-only they had no
caller left. basepoint_mul_dispatch only had test-reachable callers via
ed25519's and x25519's own assembly-routing dispatch, and ed25519's path
lacks x25519's test escape hatch, so under ed25519-only ("signatures")
it went dead too; added direct differential tests instead of touching
that dispatch structure.
Verified via x86_64 cross-compile (zig cc): all 58 feature-matrix
profiles in scripts/lib/feature-profiles.sh now pass cargo check
--lib --tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove repository-wide lint suppression debt and make feature and target reachability explicit across portable and accelerated implementations.
Harden arithmetic, bounds, secret handling, unsafe and ASM contracts, dispatch, tests, fuzz targets, and validation tooling. This intentionally breaks RSA blinding inputs, forced ChaCha20 diagnostic calls, and RISC-V CRC-64 force modes.