aboutsummaryrefslogtreecommitdiff
path: root/nacl
AgeCommit message (Collapse)Author
2025-10-08all: fix some typos in commentcuishuang
Change-Id: Ia209f0a6d9b19d14e655c65d1287a1416b48c487 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/707535 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: Nicola Murino <nicola.murino@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sean Liao <sean@liao.dev>
2025-09-09all: freeze and deprecate more packagesFilippo Valsorda
Fixes golang/go#65250 Change-Id: I6a6a6964a2c87e529be50dd67fec462483b07b75 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/701535 Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
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>
2023-09-27all: use crypto/ed25519 instead of golang.org/x/crypto/ed25519Sebastiaan van Stijn
This is a follow-up to CL 317169, which dropped go1.12 compatibility, and made the golang.org/x/crypto/ed25519 package an alias / wrapper for crypto/ed25519 in stdlib. This patch updates uses within this repository to use stdlib instead of depending on the wrapper. With this patch applied, the only remaining use of the wrapper is in ed25519_test, which appears to be in place to verify compatibility of the wrapper itself. Change-Id: I0195396102a75ae20bdd82ca8ab59855c0eb5cea GitHub-Last-Rev: 24dbec563cbd84bc47bdc7736b0245fc83dd3353 GitHub-Pull-Request: golang/crypto#238 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/448238 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Nicola Murino <nicola.murino@gmail.com> Reviewed-by: Nicola Murino <nicola.murino@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joedian Reid <joedian@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-08-17internal/subtle: rename to internal/aliasRuss Cox
This avoids an import conflict in code that needs to import crypto/subtle as well. CL 424194 does the same for the main repo. Change-Id: Ic54cb62bbfdcf5c2cb6f15ac47075ee1c41981ad Reviewed-on: https://go-review.googlesource.com/c/crypto/+/424175 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org>
2021-09-15poly1305: deprecate public packageFilippo Valsorda
Fixes golang/go#36646 Change-Id: Ic19dd2171c84472fc9d3f44803224b87fc5c0417 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/345649 Trust: Filippo Valsorda <filippo@golang.org> Trust: Katie Hockman <katie@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Katie Hockman <katie@golang.org>
2020-10-02nacl/auth: use Size instead of KeySize for Sum outputwoat
Fixes golang/go#41692 Change-Id: If6e885ca2e016dfecf534093c989356142ec7823 GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b GitHub-Pull-Request: golang/crypto#154 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357 Reviewed-by: Filippo Valsorda <filippo@golang.org> Trust: Roland Shoemaker <roland@golang.org>
2019-12-19nacl/box: support anonymous seal/openBen Toews
This adds SealAnonymous and OpenAnonymous functions that implement the libsodium "sealed box" functionality. Fixes golang/go#35346 Change-Id: I22455f1b83595ec8a68d1861e635bd6cb0573f44 GitHub-Last-Rev: 7d334cf861942ec63ad613b7f28fb6dd7a1f9992 GitHub-Pull-Request: golang/crypto#107 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/205241 Reviewed-by: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-31all: fix ineffectual assignmentsMichael Cook
audited using ineffassign tool from github.com/gordonklaus/ineffassign go generate does not generate any changes Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b GitHub-Last-Rev: acd17cce410e9c68ce3c87b5546261be9153e3ea GitHub-Pull-Request: golang/crypto#70 Reviewed-on: https://go-review.googlesource.com/c/155942 Reviewed-by: Filippo Valsorda <filippo@golang.org>
2018-06-13internal/subtle: add Any/InexactOverlap (new package) and apply them across ↵Filippo Valsorda
packages AnyOverlap and InexactOverlap implement checks for the aliasing requirements defined by the crypto/cipher interfaces. Apply them to all implementations as the actual requirement could be architecture-dependent and user code should not rely on undefined behavior. Updates golang/go#21624 Change-Id: I465de02fb3fec4e0c6f1fdee1ef6ae7ed5abff10 Reviewed-on: https://go-review.googlesource.com/112236 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-20nacl/sign: add packageFlorian Uekermann
This change adds the equivalents of crypto_sign, crypto_sign_open and crypto_sign_keypair in TweetNaCl and libsodium using the Ed25519 system. The original NaCl codebase does not contain functions with identical semantics but its documentation stated the intent of using Ed25519 in future releases. Fixes golang/go#24350 Change-Id: I4c3c86b4875f2f718ad9299c2274b4ad9e11fbeb Reviewed-on: https://go-review.googlesource.com/100578 Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
2017-11-27nacl/auth: use KeySize constant consistently.Adam Langley
Fixes golang/go#21788 Change-Id: I9310b438ce90cd3bba48295c829d44779c9f09c5 Reviewed-on: https://go-review.googlesource.com/79875 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Kevin Burke <kev@inburke.com>
2017-09-11all: make overlap rules wording consistentFilippo Valsorda
Updates golang/go#21279 Change-Id: I686835c644f52e3d5ea2b7e6431ef096d188c19d Reviewed-on: https://go-review.googlesource.com/61133 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09nacl/[secret]box: clarify message size comment.Adam Langley
While package comments shouldn't be novels, this throwaway word was not sufficient (and wasn't mirrored in the `box` package). This change attempts to include more reasoning without using too many words. Fixes golang/go#17673,golang/go#21139 Change-Id: I7fa11e2cd5b8e2010420cc14d784f9b0c65db6d2 Reviewed-on: https://go-review.googlesource.com/35910 Reviewed-by: Russ Cox <rsc@golang.org>
2017-08-07nacl/auth: add crypto_auth primitiveKevin Burke
This matches the implementation in NaCL, so a user can generate a crypto_auth digest in another language and verify it with Go, or vice versa. Fixes golang/go#20265. Change-Id: Ice96abb9347a5318a16ced5152ebfa7d9ebdd285 Reviewed-on: https://go-review.googlesource.com/51932 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-18nacl/secretbox: add benchmarksJeff Hodges
Initial results on an Ivy Bridge system for reference: BenchmarkSeal8Bytes-8 5000000 310 ns/op 25.77 MB/s BenchmarkSeal100Bytes-8 3000000 599 ns/op 166.76 MB/s BenchmarkSeal1K-8 1000000 1825 ns/op 561.06 MB/s BenchmarkSeal8K-8 100000 10997 ns/op 744.88 MB/s BenchmarkOpen8Bytes-8 5000000 327 ns/op 24.39 MB/s BenchmarkOpen100Bytes-8 2000000 630 ns/op 158.49 MB/s BenchmarkOpen1K-8 1000000 1752 ns/op 584.21 MB/s BenchmarkOpen8K-8 200000 10420 ns/op 786.12 MB/s Fixes golang/go#20563 Change-Id: Iaacd9715840c1f5c7ee2459759e79c98a4b6f62a Reviewed-on: https://go-review.googlesource.com/46039 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-06nacl/box: Add examplesKevin Burke
These largely follow the pattern laid out in the secretbox example file. Hopefully they should demonstrate the best ways to use the `box` primitives. Change-Id: I99be5f886e6ffe5f859268d6caa282e263eeacd0 Reviewed-on: https://go-review.googlesource.com/44736 Reviewed-by: Adam Langley <agl@golang.org>
2016-08-31nacl/secretbox: add license header and package prefixKevin Burke
Name the example package "secretbox_test" so we use the public interface for secretbox in examples. This way the code appears the same way a user would have to type it. Change-Id: I0487e39927ddae297ea45e09a3fa397779a8e21d Reviewed-on: https://go-review.googlesource.com/28222 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-08-19nacl: use HTTPS for nacl.cr.yp.to linksKevin Burke
nacl.cr.yp.to is available over HTTPS and presents a valid certificate, so seems useful to use it. Change-Id: I64d86e52cc314641b4169167fe5123d38c2904c0 Reviewed-on: https://go-review.googlesource.com/26812 Reviewed-by: Jonathan Rudenberg <jonathan@titanous.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16nacl/secretbox: add Seal, Open exampleKevin Burke
I read the docs and wasn't sure how to use the package - what is the best way to generate a nonce? Do I need to use the same nonce for encrypting and decrypting the same message? I read through some code that used this package, and the tests, found the answers I was looking for, and used them to generate an example, which hopefully will be helpful to other users of this package. Change-Id: I24f9682fecb6632f34b4d8d13fed6eb002993677 Reviewed-on: https://go-review.googlesource.com/26810 Reviewed-by: Adam Langley <agl@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-06-10go.crypto/nacl/secretbox: fix append behaviour.Adam Langley
secretbox is supposed to append to the given slice, like hash.Sum() and append(). However, I had a complete brain-fart: I've really no idea what I was thinking of at the time. R=golang-dev, sfrithjof, rsc CC=agl, golang-dev https://golang.org/cl/10099043
2012-09-09go.crypto/nacl: add packageAdam Langley
R=golang-dev, dchest, r, rsc CC=golang-dev https://golang.org/cl/6497101