Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aes_gcm: Add counter test for max input/output length. #2455

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

briansmith
Copy link
Owner

@briansmith briansmith commented Mar 6, 2025

For ring 0.17.12, both of these tests pass for default release mode,
release mode with overflow-checks=true, and debug mode, on 64-bit and
32-bit targets.

For prior releases, test_aes_gcm_counter_blocks_max_minus_one passes
in all three modes.

For prior releases, test_aes_gcm_counter_blocks_max passes in default
release mode:

$ cargo test --lib test_aes_gcm_counter_blocks --release
[snip]
test aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max ... ok
test aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max_minus_one ... ok

But, for 64-bit targets, when overflow checks are enabled (including debug mode),
test_aes_gcm_counter_blocks_max fails:

$ RUSTFLAGS="-C overflow-checks=true" cargo test --lib test_aes_gcm_counter_blocks
[snip]
thread 'aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max' panicked at src\aead\aes.rs:157:25:
attempt to add with overflow

@briansmith briansmith self-assigned this Mar 6, 2025
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.59%. Comparing base (7b06be8) to head (d04d7b4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2455   +/-   ##
=======================================
  Coverage   96.59%   96.59%           
=======================================
  Files         180      180           
  Lines       21748    21780   +32     
  Branches      538      539    +1     
=======================================
+ Hits        21007    21039   +32     
  Misses        623      623           
  Partials      118      118           

☔ 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.

For *ring* 0.17.12, both of these tests pass for default release mode,
release mode with overflow-checks=true, and debug mode, on 64-bit and
32-bit targets.

For prior releases, `test_aes_gcm_counter_blocks_max_minus_one` passes
in all three modes.

For prior releases, `test_aes_gcm_counter_blocks_max` passes in default
release mode:
```
$ cargo test --lib test_aes_gcm_counter_blocks --release
[snip]
test aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max ... ok
test aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max_minus_one ... ok
```
But, for 64-bit targets, when overflow checks are enabled (including debug mode),
`test_aes_gcm_counter_blocks_max` fails:

```
$ RUSTFLAGS="-C overflow-checks=true" cargo test --lib test_aes_gcm_counter_blocks
[snip]
thread 'aead::aes::aes_gcm_tests::test_aes_gcm_counter_blocks_max' panicked at src\aead\aes.rs:157:25:
attempt to add with overflow
```
@briansmith briansmith merged commit e60b593 into main Mar 6, 2025
174 checks passed
@briansmith briansmith deleted the b/aes_gcm_tests branch March 6, 2025 20:14
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