Skip to content

Commit 8c9ba31

Browse files
FiloSottilegopherbot
authored andcommitted
all: freeze and deprecate more packages
Fixes golang/go#65250 Change-Id: I6a6a6964a2c87e529be50dd67fec462483b07b75 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/701535 Reviewed-by: Mark Freeman <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> Reviewed-by: Daniel McCarney <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 559e062 commit 8c9ba31

File tree

9 files changed

+55
-45
lines changed

9 files changed

+55
-45
lines changed

curve25519/curve25519.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
// license that can be found in the LICENSE file.
44

55
// Package curve25519 provides an implementation of the X25519 function, which
6-
// performs scalar multiplication on the elliptic curve known as Curve25519.
7-
// See RFC 7748.
6+
// performs scalar multiplication on the elliptic curve known as Curve25519
7+
// according to [RFC 7748].
88
//
9-
// This package is a wrapper for the X25519 implementation
10-
// in the crypto/ecdh package.
9+
// The curve25519 package is a wrapper for the X25519 implementation in the
10+
// crypto/ecdh package. It is [frozen] and is not accepting new features.
11+
//
12+
// [RFC 7748]: https://datatracker.ietf.org/doc/html/rfc7748
13+
// [frozen]: https://go.dev/wiki/Frozen
1114
package curve25519
1215

1316
import "crypto/ecdh"

ed25519/ed25519.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Package ed25519 implements the Ed25519 signature algorithm. See
6-
// https://ed25519.cr.yp.to/.
5+
// Package ed25519 implements the Ed25519 signature algorithm.
76
//
87
// These functions are also compatible with the “Ed25519” function defined in
9-
// RFC 8032. However, unlike RFC 8032's formulation, this package's private key
8+
// [RFC 8032]. However, unlike RFC 8032's formulation, this package's private key
109
// representation includes a public key suffix to make multiple signing
1110
// operations with the same key more efficient. This package refers to the RFC
1211
// 8032 private key as the “seed”.
1312
//
14-
// This package is a wrapper around the standard library crypto/ed25519 package.
13+
// The ed25519 package is a wrapper for the Ed25519 implementation in the
14+
// crypto/ed25519 package. It is [frozen] and is not accepting new features.
15+
//
16+
// [RFC 8032]: https://datatracker.ietf.org/doc/html/rfc8032
17+
// [frozen]: https://go.dev/wiki/Frozen
1518
package ed25519
1619

1720
import (

nacl/auth/auth.go

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
/*
6-
Package auth authenticates a message using a secret key.
7-
8-
The Sum function, viewed as a function of the message for a uniform random
9-
key, is designed to meet the standard notion of unforgeability. This means
10-
that an attacker cannot find authenticators for any messages not authenticated
11-
by the sender, even if the attacker has adaptively influenced the messages
12-
authenticated by the sender. For a formal definition see, e.g., Section 2.4
13-
of Bellare, Kilian, and Rogaway, "The security of the cipher block chaining
14-
message authentication code," Journal of Computer and System Sciences 61 (2000),
15-
362–399; http://www-cse.ucsd.edu/~mihir/papers/cbc.html.
16-
17-
auth does not make any promises regarding "strong" unforgeability; perhaps
18-
one valid authenticator can be converted into another valid authenticator for
19-
the same message. NaCl also does not make any promises regarding "truncated
20-
unforgeability."
21-
22-
This package is interoperable with NaCl: https://nacl.cr.yp.to/auth.html.
23-
*/
5+
// Package auth authenticates a message using a secret key.
6+
//
7+
// This package is interoperable with [NaCl].
8+
//
9+
// The auth package is essentially a wrapper for HMAC-SHA-512 (implemented by
10+
// crypto/hmac and crypto/sha512), truncated to 32 bytes. It is [frozen] and is
11+
// not accepting new features.
12+
//
13+
// [NaCl]: https://nacl.cr.yp.to/auth.html
14+
// [frozen]: https://go.dev/wiki/Frozen
2415
package auth
2516

2617
import (

nacl/sign/sign.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@
44

55
// Package sign signs small messages using public-key cryptography.
66
//
7-
// Sign uses Ed25519 to sign messages. The length of messages is not hidden.
8-
// Messages should be small because:
9-
// 1. The whole message needs to be held in memory to be processed.
10-
// 2. Using large messages pressures implementations on small machines to process
11-
// plaintext without verifying the signature. This is very dangerous, and this API
12-
// discourages it, but a protocol that uses excessive message sizes might present
13-
// some implementations with no other choice.
14-
// 3. Performance may be improved by working with messages that fit into data caches.
15-
// Thus large amounts of data should be chunked so that each message is small.
7+
// This package is interoperable with [libsodium], as well as [TweetNaCl].
168
//
17-
// This package is not interoperable with the current release of NaCl
18-
// (https://nacl.cr.yp.to/sign.html), which does not support Ed25519 yet. However,
19-
// it is compatible with the NaCl fork libsodium (https://www.libsodium.org), as well
20-
// as TweetNaCl (https://tweetnacl.cr.yp.to/).
9+
// The sign package is essentially a wrapper for the Ed25519 signature
10+
// algorithm (implemented by crypto/ed25519). It is [frozen] and is not accepting
11+
// new features.
12+
//
13+
// [libsodium]: https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures
14+
// [TweetNaCl]: https://tweetnacl.cr.yp.to/
15+
// [frozen]: https://go.dev/wiki/Frozen
2116
package sign
2217

2318
import (

otr/otr.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// The version of OTR implemented by this package has been deprecated
99
// (https://bugs.otr.im/lib/libotr/issues/140). An implementation of OTRv3 is
1010
// available at https://github.com/coyim/otr3.
11+
//
12+
// The otr package is [frozen] and is not accepting new features.
13+
//
14+
// [frozen]: https://go.dev/wiki/Frozen
1115
package otr
1216

1317
import (

pkcs12/pkcs12.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
// Package pkcs12 implements some of PKCS#12.
66
//
7-
// This implementation is distilled from https://tools.ietf.org/html/rfc7292
8-
// and referenced documents. It is intended for decoding P12/PFX-stored
9-
// certificates and keys for use with the crypto/tls package.
7+
// This implementation is distilled from [RFC 7292] and referenced documents.
8+
// It is intended for decoding P12/PFX-stored certificates and keys for use
9+
// with the crypto/tls package.
1010
//
11-
// This package is frozen. If it's missing functionality you need, consider
12-
// an alternative like software.sslmate.com/src/go-pkcs12.
11+
// The pkcs12 package is [frozen] and is not accepting new features.
12+
// If it's missing functionality you need, consider an alternative like
13+
// software.sslmate.com/src/go-pkcs12.
14+
//
15+
// [RFC 7292]: https://datatracker.ietf.org/doc/html/rfc7292
16+
// [frozen]: https://go.dev/wiki/Frozen
1317
package pkcs12
1418

1519
import (

salsa20/salsa/hsalsa20.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// license that can be found in the LICENSE file.
44

55
// Package salsa provides low-level access to functions in the Salsa family.
6+
//
7+
// Deprecated: this package exposes unsafe low-level operations. New applications
8+
// should consider using the AEAD construction in golang.org/x/crypto/chacha20poly1305
9+
// instead. Existing users should migrate to golang.org/x/crypto/salsa20.
610
package salsa
711

812
import "math/bits"

ssh/test/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
// Package test contains integration tests for the
66
// golang.org/x/crypto/ssh package.
7+
//
8+
// Deprecated: this package is for internal use only.
79
package test

xts/xts.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
//
2222
// Note that XTS is usually not appropriate for any use besides disk encryption.
2323
// Most users should use an AEAD mode like GCM (from crypto/cipher.NewGCM) instead.
24+
//
25+
// The xts package is [frozen] and is not accepting new features.
26+
//
27+
// [frozen]: https://go.dev/wiki/Frozen
2428
package xts
2529

2630
import (

0 commit comments

Comments
 (0)