Skip to content

Commit 1ca2368

Browse files
FiloSottilegopherbot
authored andcommitted
crypto/rsa: fix documentation formatting
Change-Id: I6a6a696422f9ab73b9ddee131b17d3c177fefc4e Reviewed-on: https://go-review.googlesource.com/c/go/+/687615 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]>
1 parent 4bc3373 commit 1ca2368

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/crypto/rsa/rsa.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
// with a key smaller than 1024 bits. Such keys are insecure and should not be
3131
// used.
3232
//
33-
// The `rsa1024min=0` GODEBUG setting suppresses this error, but we recommend
34-
// doing so only in tests, if necessary. Tests can use [testing.T.Setenv] or
35-
// include `//go:debug rsa1024min=0` in a `_test.go` source file to set it.
33+
// The rsa1024min=0 GODEBUG setting suppresses this error, but we recommend
34+
// doing so only in tests, if necessary. Tests can set this option using
35+
// [testing.T.Setenv] or by including "//go:debug rsa1024min=0" in a *_test.go
36+
// source file.
3637
//
3738
// Alternatively, see the [GenerateKey (TestKey)] example for a pregenerated
3839
// test-only 2048-bit key.
3940
//
40-
// [GenerateKey (TestKey)]: #example-GenerateKey-TestKey
41+
// [GenerateKey (TestKey)]: https://pkg.go.dev/crypto/rsa#example-GenerateKey-TestKey
4142
package rsa
4243

4344
import (
@@ -226,7 +227,7 @@ type CRTValue struct {
226227
// Validate performs basic sanity checks on the key.
227228
// It returns nil if the key is valid, or else an error describing a problem.
228229
//
229-
// It runs faster on valid keys if run after [Precompute].
230+
// It runs faster on valid keys if run after [PrivateKey.Precompute].
230231
func (priv *PrivateKey) Validate() error {
231232
// We can operate on keys based on d alone, but it isn't possible to encode
232233
// with [crypto/x509.MarshalPKCS1PrivateKey], which unfortunately doesn't
@@ -274,7 +275,7 @@ func checkPublicKeySize(k *PublicKey) error {
274275
// returned key does not depend deterministically on the bytes read from rand,
275276
// and may change between calls and/or between versions.
276277
//
277-
// [Minimum key size]: #hdr-Minimum_key_size
278+
// [Minimum key size]: https://pkg.go.dev/crypto/rsa#hdr-Minimum_key_size
278279
func GenerateKey(random io.Reader, bits int) (*PrivateKey, error) {
279280
if err := checkKeySize(bits); err != nil {
280281
return nil, err

0 commit comments

Comments
 (0)