Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Filippo Valsorda a6a393ffd6 all: bump go.mod version and drop compatibility shims
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>
2024-06-26 15:12:35 +00:00
Russ Cox 04dced17f7 internal/subtle: rename to internal/alias
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>
2022-08-17 18:37:53 +00:00
Filippo Valsorda c084706c22 poly1305: deprecate public package
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>
2021-09-15 21:47:49 +00:00
Filippo Valsorda 37a17fe027 internal/subtle: add Any/InexactOverlap (new package) and apply them across 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-06-13 22:47:33 +00:00
Adam Langley 9ba3862cf6 nacl/[secret]box: clarify message size comment.
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-09-09 20:47:57 +00:00
Jeff Hodges 93b5df3bf3 nacl/secretbox: add benchmarks
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-18 20:15:51 +00:00
Kevin Burke e7ba826830 nacl/box: Add examples
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>
2017-06-06 16:30:16 +00:00
Kevin Burke 055d4bfb5c nacl/secretbox: add license header and package prefix
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-31 13:18:26 +00:00
Kevin Burke 88d0005bf4 nacl: use HTTPS for nacl.cr.yp.to links
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-19 14:58:26 +00:00
Kevin Burke 1ce41b6ca7 nacl/secretbox: add Seal, Open example
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>
2016-08-16 17:48:58 +00:00
David Symonds 1fbbd62cfe crypto: add import comments.
Change-Id: I33240faf1b8620d0cd600de661928d8e422ebdbc
Reviewed-on: https://go-review.googlesource.com/1235
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 23:26:36 +00:00
Andrew Gerrand a73c6bbfc5 go.crypto: use golang.org/x/... import paths
LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/167190043
2014-11-10 08:50:25 +11:00
Adam Langley c2ba5865a8 go.crypto/nacl/secretbox: fix append behaviour.
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
2013-06-10 18:03:26 -04:00
Adam Langley f09bfbbb56 go.crypto/nacl: add package
R=golang-dev, dchest, r, rsc
CC=golang-dev
https://golang.org/cl/6497101
2012-09-09 11:18:00 -04:00