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

All: Fix a flaky test case in crypto.test.ts #11389

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

wh201906
Copy link
Contributor

Comment on lines 41 to 44
while (i-- > end) {
nonce[i] += carry;
if (nonce[i] !== 0 || carry !== 1) {
nonce[i] += 1;
if (nonce[i] !== 0) {
break;
Copy link
Owner

Choose a reason for hiding this comment

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

Could this affect data that has already been encrypted with the new encryption method? From the name I'm guessing that not but please confirm. How is this function used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't affect the encrypted data at all. The old implementation and and the new implementation generate exactly the same output with same input (nonce in this case). It's just a optimization.
This function is used when a new chunk of data is encrypted. Each trunk of data is encrypted with the same key and a different nonce, and this function is used to change the nonce.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for confirming!

@laurent22
Copy link
Owner

Thanks for checking this issue and fixing it @wh201906!

@laurent22 laurent22 merged commit fb0bfe6 into laurent22:dev Nov 14, 2024
7 checks passed
@wh201906 wh201906 deleted the wh201906/fix_test branch November 14, 2024 09:49
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.

2 participants