Tidying around intrinsics, safety comments, and pointer casts#108
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes pointer casting in cryptographic code by replacing explicit cast-as-pointer patterns with .cast() method calls, consolidates duplicate prefetching logic into a reusable function, and adds safety comments for memory transmutations.
- Replaces
as *const _andas *mut _pointer casts with.cast()method calls - Consolidates duplicate prefetching code into a shared
super::cpu::prefetch()function - Adds safety comments for
mem::transmuteoperations and improves existing safety documentation
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| graviola/src/lib.rs | Adds clippy lint exceptions for pointer casting patterns |
| graviola/src/low/x86_64/cpu.rs | Introduces shared prefetch function for code deduplication |
| graviola/src/low/x86_64/sha256.rs | Updates pointer casts to use .cast() method |
| graviola/src/low/x86_64/ghash.rs | Updates pointer casts to use .cast() method |
| graviola/src/low/x86_64/aes_gcm.rs | Replaces duplicate prefetch code with shared function and updates pointer casts |
| graviola/src/low/x86_64/aes.rs | Updates pointer casts to use .cast() method |
| graviola/src/low/x86_64/bignum_*.rs | Replaces duplicate prefetch code with shared function |
| graviola/src/low/aarch64/*.rs | Updates pointer casts and adds safety comments for transmute operations |
| graviola/src/low/generic/zeroise.rs | Updates pointer casts to use .cast() method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
- Coverage 99.14% 99.14% -0.01%
==========================================
Files 171 171
Lines 39090 39074 -16
==========================================
- Hits 38754 38738 -16
Misses 336 336 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #108 will not alter performanceComparing Summary
|
This is a reduced-strength version of #107. #107 introduces some performance changes that I haven't investigated yet.