x.crypto.chacha20: changes internal cipher representation to support 64 bit ctr #24039
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to this issues, here is the plan to add support for original ChaCha20 stream cipher with 64 bit counter.
chacha20.Cipher
representation (was done in this PR). Its changed to the raw 128 bytes of[4]u32
opaque where the counter was contained internally and handles transparently. Previously, its separated in thenonce
andcounter
of theCipher
field's.xor_key_stream
and other routines awares for 64-bit counter variantThis PR contains some bits of them, but its not fully activated support for 64-bit counter variant.
The fundamental changes in this PR was the change of internal representation of the
nonce
andcounter
ofchacha20.Cipher
field's into rawnonce
and make enrcyption routines work and aware of this changes..Its also contains some cleansup bits and code safety checking
Thanks