briansmith / ring

Safe, fast, small crypto using Rust
Other
3.77k stars 708 forks source link

ChaCha20-Poly1305 internals: Clarify memory safety of `encrypt_within`. #2031

Closed briansmith closed 7 months ago

briansmith commented 7 months ago

Eliminate the "less safe" variant of encrypt_within. Move the check for overlapping buffers into the inner safe wrapper around the assembly function call, so that it is clear what we're giving the assembly function.

The extra checks are only done for 32-bit ARM and 32-bit x86, which are less of a performance priority now. And also the checks probably don't affect performance anyway.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.25%. Comparing base (31a0313) to head (a6bb031).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2031 +/- ## ========================================== - Coverage 96.26% 96.25% -0.01% ========================================== Files 140 140 Lines 20410 20401 -9 Branches 226 226 ========================================== - Hits 19648 19638 -10 Misses 728 728 - Partials 34 35 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.