Reject zero r or p in reference scrypt#406
Open
achimala wants to merge 1 commit into
Open
Conversation
This was referenced May 30, 2026
Member
|
Thanks, the code looks great! Two nitpicks in the commit message, one of them my fault:
|
The file format and libscrypt-kdf API require a positive r * p product, but crypto_scrypt() did not reject zero r or p before later size checks. Reject zero values with EINVAL and document the positive lower bound explicitly. This follows up on d223018.
2a15ba1 to
333de9e
Compare
Contributor
Author
|
Thanks, updated. I amended the commit message to wrap before 80 chars and fixed the historical reference to use the merged master commit d223018. |
Member
|
Closing & reopening to trigger a CI run. |
Member
|
Looks like this collided with #407; can you fix it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
r == 0orp == 0incrypto_scrypt()withEINVAL0 < r * p < 2^30inFORMAT,README.md,scrypt-kdf.h, and the reference implementation commentNotes
This follows up on 686a628 as requested in #405.
Tests
git diff --checkSplit out from #405.