Skip to content

Comments

Tidying around intrinsics, safety comments, and pointer casts#108

Merged
ctz merged 4 commits intomainfrom
jbp-safer-intrinsics-2
Aug 30, 2025
Merged

Tidying around intrinsics, safety comments, and pointer casts#108
ctz merged 4 commits intomainfrom
jbp-safer-intrinsics-2

Conversation

@ctz
Copy link
Owner

@ctz ctz commented Aug 30, 2025

This is a reduced-strength version of #107. #107 introduces some performance changes that I haven't investigated yet.

@ctz ctz requested a review from Copilot August 30, 2025 19:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _ and as *mut _ pointer casts with .cast() method calls
  • Consolidates duplicate prefetching code into a shared super::cpu::prefetch() function
  • Adds safety comments for mem::transmute operations 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
Copy link

codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (a177593) to head (1c46112).
⚠️ Report is 4 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 30, 2025

CodSpeed Performance Report

Merging #108 will not alter performance

Comparing jbp-safer-intrinsics-2 (1c46112) with main (a177593)

Summary

✅ 143 untouched benchmarks

@ctz ctz merged commit 80afb29 into main Aug 30, 2025
27 of 28 checks passed
@ctz ctz deleted the jbp-safer-intrinsics-2 branch August 30, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant