RustCrypto / traits

Collection of cryptography-related traits
592 stars 193 forks source link

Use full range of the stream message counter for StreamLE31 #1708

Closed Eosis closed 1 month ago

Eosis commented 1 month ago

I believe that we the StreamPrimitive for StreamLE31 in the library is not using the correct value for COUNTER_MAX, choosing 0x0FFF_FFFF rather than 0x7FFF_FFFF, resulting in a reduced space for the message counter. This commit changes the value to use the full range.

I do not believe this is a security issue, but it does reduce the functionality of the library.

I have just committed this off the tag of the 0.5.2 release of AEAD, rather than master, as this is currently released version.

Let me know if my understanding of the problem is incorrect or if I'm attempting to commit this to the wrong library.

Eosis commented 1 month ago

Sister PR in the AEADs crate where this bug persists: https://github.com/RustCrypto/AEADs/pull/641

newpavlov commented 1 month ago

Closing in favor of https://github.com/RustCrypto/AEADs/pull/641. Since this change is not critical, I don't think it's worth to do a backport for it.