scrypt: recommending larger values in 2021
I have noticed the values kept being from 2017, despite single-core performance getting faster, for example with Apple's ARM M1 offering.
So, I re-tested the N parameter, with the code from here
https://blog.filippo.io/the-scrypt-parameters/
The results, on M1 Macbook Air:
N = 2^14 26ms N = 2^15 53ms N = 2^16 108ms N = 2^17 219ms N = 2^18 441ms N = 2^19 901ms N = 2^20 1778ms N = 2^21 3675ms N = 2^22 7530ms
strictly speaking, it should be 2^15, but this is an entry-level laptop and 108 ms is almost 100, so I increased N.
I do not really understand r, but, according to this discussion
https://news.ycombinator.com/item?id=25660467
M1 has double cache line size, so I doubled r.
I don't really expect this to be accepted I guess - IETF still recommends the lower values, in 2021 - https://tools.ietf.org/id/draft-ietf-kitten-password-storage-01.html - but I guess to open a discussion?
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.
ℹ️ Googlers: Go here for more info.
This PR (HEAD: d9e526e312055b38c3a636fe4a3613d7ed67424a) has been imported to Gerrit for code review.
Please visit https://go-review.googlesource.com/c/crypto/+/320390 to see it.
Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info
Message from Go Bot:
Patch Set 1:
Congratulations on opening your first change. Thank you for your contribution!
Next steps: A maintainer will review your change and provide feedback. See https://golang.org/doc/contribute.html#review for more info and tips to get your patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be surprising to people new to the project. The careful, iterative review process is our way of helping mentor contributors and ensuring that their contributions have a lasting impact.
During May-July and Nov-Jan the Go project is in a code freeze, during which little code gets reviewed or merged. If a reviewer responds with a comment like R=go1.11 or adds a tag like "wait-release", it means that this CL will be reviewed as part of the next development cycle. See https://golang.org/s/release for more details.
Please don’t reply on this GitHub thread. Visit golang.org/cl/320390. After addressing review feedback, remember to publish your drafts!
The new M1 chips (fall 2021) seem to be even faster; but the single-core performance is actually very similar. So I think this won't move the numbers that much.