briansmith / ring

Safe, fast, small crypto using Rust
Other
3.64k stars 683 forks source link

AES: Use `NonZero_size_t` for ctr32_encrypt functions. #2052

Closed briansmith closed 2 months ago

briansmith commented 2 months ago

It turns out BSAES isn't the only one that required a non-empty in/out; at least the x86-64 implementation of aes_hw_ctr32_encrypt_blocks requires a non-empty in/out as well. Just assume all of them require it.

As the code currently exists, this is a no-op because ctr32_encrypt_within is never called with an empty in/out, but this would prevent memory safety issues if/when that changes.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 96.27%. Comparing base (c5914cd) to head (2a38158). Report is 2 commits behind head on main.

Files Patch % Lines
src/aead/aes.rs 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2052 +/- ## ========================================== - Coverage 96.28% 96.27% -0.01% ========================================== Files 143 143 Lines 20462 20460 -2 Branches 226 226 ========================================== - Hits 19701 19698 -3 - Misses 727 728 +1 Partials 34 34 ```

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