Skip to content

Count blocks instead of bytes in AES-ICM limit computation#551

Merged
pabuhler merged 1 commit intocisco:masterfrom
bifurcation:bytes_vs_blocks
Sep 14, 2021
Merged

Count blocks instead of bytes in AES-ICM limit computation#551
pabuhler merged 1 commit intocisco:masterfrom
bifurcation:bytes_vs_blocks

Conversation

@bifurcation
Copy link
Copy Markdown
Contributor

As noted in #509, the current AES-ICM implementation incorrectly computes the number of bytes it can encrypt. The block counter counts in units of 16-byte AES blocks, but it is added to the number bytes to be encrypted. This PR changes the computation to compute how many new blocks of keystream are required, and compare that with the counter to ensure that enough counter space remains.

Fixes #509

@pabuhler pabuhler merged commit d93ca33 into cisco:master Sep 14, 2021
seyednasermoravej pushed a commit to seyednasermoravej/libsrtp that referenced this pull request Nov 9, 2025
Count blocks instead of bytes in AES-ICM limit computation
pabuhler added a commit to pabuhler/libsrtp that referenced this pull request Nov 23, 2025
This backports cryptex support added in  cisco#551 (76f23aa).
The tests are nearly unchanged but the code was slightly simplified
as non-in-place io is not supported in the v2 branch.

cisco#777
pabuhler added a commit to pabuhler/libsrtp that referenced this pull request Jan 16, 2026
This backports cryptex support added in  cisco#551 (76f23aa).
The tests are nearly unchanged but the code was slightly simplified
as non-in-place io is not supported in the v2 branch.

cisco#777
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.

Premature re-keying

2 participants