Skip to content

Reject N less than two in reference scrypt#407

Open
achimala wants to merge 1 commit into
Tarsnap:masterfrom
achimala:codex/ref-param-n-one
Open

Reject N less than two in reference scrypt#407
achimala wants to merge 1 commit into
Tarsnap:masterfrom
achimala:codex/ref-param-n-one

Conversation

@achimala

Copy link
Copy Markdown

Summary

  • reject N < 2 in the reference crypto_scrypt() parameter validation
  • update the internal comments to state that N must be a power of two greater than 1

Tests

  • git diff --check

Split out from #405.

@gperciva

Copy link
Copy Markdown
Member

Thanks, code looks great!

One nitpick in the git commit message: please wrap the lines less than 80 chars. I tend to wrap at 76 or 78 chars.

crypto_scrypt() accepts powers of two for N, but N == 1 leaves smix()
without a meaningful iteration count. Treat N values below 2 as invalid
and keep the implementation comments in sync.
@achimala achimala force-pushed the codex/ref-param-n-one branch from e274ab2 to a93cb14 Compare May 31, 2026 01:45
@achimala

Copy link
Copy Markdown
Author

Thanks, updated. I amended the commit message to wrap before 80 chars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants