aboutsummaryrefslogtreecommitdiff
path: root/scrypt
AgeCommit message (Collapse)Author
2026-01-13scrypt: fix panic on parameters <= 0Juergen Graf
Providing 0 as argument for r or p results in a panic: panic: runtime error: integer divide by zero Providing negative values for r or p returns a misleading error: scrypt: parameters are too large This change avoids the panic and introduces a new error that is returned when r or p are <= 0: scrypt: parameters must be > 0 Change-Id: I68987b27d1eedd66644d2ec9436cba364fc1d46d Reviewed-on: https://go-review.googlesource.com/c/crypto/+/731780 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org>
2024-06-26all: bump go.mod version and drop compatibility shimsFilippo Valsorda
Also, remove the legacy import annotations. Fixes golang/go#68147 Change-Id: Ibfcc9322f27224c0ba92ea42cd56912a7d8783fd Reviewed-on: https://go-review.googlesource.com/c/crypto/+/594256 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-04-11all: gofmtRuss Cox
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: I076031b6613691eefbb0f21739366e3fd2011ec9 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/399356 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2021-03-17scrypt: use encoding/binary to simplify smixAndreas Auernhammer
This CL simplifies the smix implementation. It: - replaces the manual byte-int conversion with functionality from encoding/binary. - pre-computes the range `r * 32` as `R`. Change-Id: Ife4920089c011fec82b234fb56df33e94204e0f8 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/253357 Reviewed-by: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
2019-04-26scrypt: use math.bits rotate functions instead of ad-hoc implementationUdalov Max
This makes code more readable and idiomatic. No change in benchmarks. Updates golang/go#31456 Change-Id: I010bbff33580350019ce2b0ff13847261905d32f Reviewed-on: https://go-review.googlesource.com/c/crypto/+/174137 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-29all: fix typosIgor Zhilianin
Change-Id: I62cbcfcd0be5f6a74d93b85b24ff7607533bb239 GitHub-Last-Rev: 9967869e706e9fe7d13964bb32b30a44ba640869 GitHub-Pull-Request: golang/crypto#64 Reviewed-on: https://go-review.googlesource.com/c/145240 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-03scrypt: update example to match recommendation two lines belowFilip Haglund
Change-Id: I6eb5db30df9bc1c4b3c4124c9cdd3d504d33ad9d GitHub-Last-Rev: 1f585c4bf946a3241f8c38e1e954c4e5f8dc4713 GitHub-Pull-Request: golang/crypto#43 Reviewed-on: https://go-review.googlesource.com/110120 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-09-30scrypt: add missing license headerKevin Burke
Change-Id: I17daa73c1957ed276ee32419248f321e018f5091 Reviewed-on: https://go-review.googlesource.com/67316 Reviewed-by: Kevin Burke <kev@inburke.com>
2017-09-30scrypt: update recommended parameters for 2017Kevin Burke
Previously we documented recommended parameters for scrypt from 2009, which was eight years ago. Update those parameters and also provide some guidance to users for configuring those settings in 2017. On my late 2015 Macbook Pro, the scrypt benchmark with N=1<<15, r=8, p=1 completes in 91 milliseconds. Add an Example with a salt. Fixes golang/go#22082. Change-Id: I23e3920db67583c9fce093768a32e67ab9c979f5 Reviewed-on: https://go-review.googlesource.com/67070 Reviewed-by: Adam Langley <agl@golang.org>
2017-06-29all: use HTTPS for links that support itKevin Burke
Many websites now support HTTPS that may not at the time the code was committed; let's use the HTTPS links where we can. Change-Id: I7099dfa0dbb213294e65b4387f343d6e8f955b97 Reviewed-on: https://go-review.googlesource.com/47131 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-10scrypt: fix broken example in documentationSam Whited
Fixes golang/go#17046 Change-Id: I7fa7e0b700212992125de32524801048b56ac5d1 Reviewed-on: https://go-review.googlesource.com/28952 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-09crypto: add import comments.David Symonds
Change-Id: I33240faf1b8620d0cd600de661928d8e422ebdbc Reviewed-on: https://go-review.googlesource.com/1235 Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-11-10go.crypto: use golang.org/x/... import pathsAndrew Gerrand
LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/167190043
2013-01-17scrypt: 2x faster.Dmitry Chestnykh
Work on uint32 slices instead of bytes. Replace usage of Salsa20/8 from salsa package with the specialized version. benchmark old ns/op new ns/op delta BenchmarkKey 266430525 126657130 -52.46% R=agl CC=golang-dev https://golang.org/cl/7139050
2012-12-15go.crypto: gofmt -w -sMikio Hara
R=golang-dev, dave CC=golang-dev https://golang.org/cl/6948057
2012-09-18go.crypto/scrypt: add packageDmitry Chestnykh
R=golang-dev, agl, r CC=golang-dev https://golang.org/cl/6535043