Skip to content

crypto.cipher: fix xor_key_stream() for OFB mode, add test#25844

Merged
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:ofb
Nov 30, 2025
Merged

crypto.cipher: fix xor_key_stream() for OFB mode, add test#25844
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:ofb

Conversation

@tankf33der

Copy link
Copy Markdown
Contributor

The tests showed that byte-by-byte operation does not work correctly, while block-by-block operation works properly in OFB mode.

Trivial typo in the code that was not tested, proof #1 and #2.

The test vector was created using openssl.

@tankf33der

Copy link
Copy Markdown
Contributor Author

@blackshirt, @einar-hjortdal - please take a look.

@tankf33der

Copy link
Copy Markdown
Contributor Author

Only this patch allows run test successfully against openssl.

@einar-hjortdal

Copy link
Copy Markdown
Contributor

Seems good to me, I would maybe add in the comments how the test array was obtained (openssl version etc.). But that's minor and may be unnecessary.
@blackshirt is the expert, I am just a user

@blackshirt

blackshirt commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

Seems good to me, I would maybe add in the comments how the test array was obtained (openssl version etc.). But that's minor and may be unnecessary. @blackshirt is the expert, I am just a user

Not really true for the expert thing ..it share the same thiing with the others, just some user..

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tankf33der .

@spytheman spytheman merged commit 473c8e8 into vlang:master Nov 30, 2025
73 checks passed
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.

4 participants