Skip to content

hc-256: use ptable instead of qtable in h2 function #324

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

Merged
merged 1 commit into from
Jun 23, 2023
Merged

hc-256: use ptable instead of qtable in h2 function #324

merged 1 commit into from
Jun 23, 2023

Conversation

cdong1012
Copy link
Contributor

Fixing a small bug in the HC-256 stream cipher to use ptable instead of qtable for the h2 function. The code properly decrypts up to 0x1000 bytes, but it fails to decrypt data that comes afterward due to this bug.

Data encrypted by the original code can still be fully decrypted despite its length, but will fail to be decrypted by other HC-256 libraries.

@cdong1012
Copy link
Contributor Author

Seems like this is duplicate with #283. Should I rebase and update this PR to cipher_v0.5?

@tarcieri
Copy link
Member

Oh wow, looks like #283 went by the wayside.

@cdong1012 #283 had quite a bit going on including adding an implementation of HC-128, which is what blocked merging it.

I think it would be good to just split out the HC-256 fixes for starters, possibly in this PR. You already have the qtable -> ptable fix, but it'd also be good to include the INIT_SIZE fix.

After that, I think HC-128 could be added in a separate PR.

@tarcieri tarcieri changed the title Fix Hc256Core h2 function hc-256: use ptable instead of qtable in h2 function Jun 23, 2023
@tarcieri
Copy link
Member

Actually, let's go ahead and get this merged so it doesn't go by the wayside like #283

@tarcieri tarcieri merged commit 61e39e6 into RustCrypto:master Jun 23, 2023
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