all: gofmt

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>
This commit is contained in:
Russ Cox
2022-04-11 22:02:26 +00:00
committed by Gopher Robot
parent 5352b09029
commit 7b82a4e95d
22 changed files with 82 additions and 70 deletions
-1
View File
@@ -82,7 +82,6 @@ const (
// log.Fatal(err) // log.Fatal(err)
// } // }
// client := &Client{Key: key} // client := &Client{Key: key}
//
type Client struct { type Client struct {
// Key is the account key used to register with a CA and sign requests. // Key is the account key used to register with a CA and sign requests.
// Key.Public() must return a *rsa.PublicKey or *ecdsa.PublicKey. // Key.Public() must return a *rsa.PublicKey or *ecdsa.PublicKey.
+2 -4
View File
@@ -11,8 +11,7 @@
// If you aren't sure which function you need, use Argon2id (IDKey) and // If you aren't sure which function you need, use Argon2id (IDKey) and
// the parameter recommendations for your scenario. // the parameter recommendations for your scenario.
// //
// // # Argon2i
// Argon2i
// //
// Argon2i (implemented by Key) is the side-channel resistant version of Argon2. // Argon2i (implemented by Key) is the side-channel resistant version of Argon2.
// It uses data-independent memory access, which is preferred for password // It uses data-independent memory access, which is preferred for password
@@ -21,8 +20,7 @@
// parameters (taken from [2]) for non-interactive operations are time=3 and to // parameters (taken from [2]) for non-interactive operations are time=3 and to
// use the maximum available memory. // use the maximum available memory.
// //
// // # Argon2id
// Argon2id
// //
// Argon2id (implemented by IDKey) is a hybrid version of Argon2 combining // Argon2id (implemented by IDKey) is a hybrid version of Argon2 combining
// Argon2i and Argon2d. It uses data-independent memory access for the first // Argon2i and Argon2d. It uses data-independent memory access for the first
+1
View File
@@ -15,6 +15,7 @@ const bufSize = 256
// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only
// be called when the vector facility is available. Implementation in asm_s390x.s. // be called when the vector facility is available. Implementation in asm_s390x.s.
//
//go:noescape //go:noescape
func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32)
+3
View File
@@ -1,13 +1,16 @@
// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT.
//go:build amd64 && gc && !purego
// +build amd64,gc,!purego // +build amd64,gc,!purego
package field package field
// feMul sets out = a * b. It works like feMulGeneric. // feMul sets out = a * b. It works like feMulGeneric.
//
//go:noescape //go:noescape
func feMul(out *Element, a *Element, b *Element) func feMul(out *Element, a *Element, b *Element)
// feSquare sets out = a * a. It works like feSquareGeneric. // feSquare sets out = a * a. It works like feSquareGeneric.
//
//go:noescape //go:noescape
func feSquare(out *Element, a *Element) func feSquare(out *Element, a *Element)
-1
View File
@@ -279,7 +279,6 @@ const (
// finalize completes the modular reduction of h and computes // finalize completes the modular reduction of h and computes
// //
// out = h + s mod 2¹²⁸ // out = h + s mod 2¹²⁸
//
func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) { func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) {
h0, h1, h2 := h[0], h[1], h[2] h0, h1, h2 := h[0], h[1], h[2]
+1
View File
@@ -14,6 +14,7 @@ import (
// updateVX is an assembly implementation of Poly1305 that uses vector // updateVX is an assembly implementation of Poly1305 that uses vector
// instructions. It must only be called if the vector facility (vx) is // instructions. It must only be called if the vector facility (vx) is
// available. // available.
//
//go:noescape //go:noescape
func updateVX(state *macState, msg []byte) func updateVX(state *macState, msg []byte)
+2
View File
@@ -23,12 +23,14 @@ import (
// A Block represents an OpenPGP armored structure. // A Block represents an OpenPGP armored structure.
// //
// The encoded form is: // The encoded form is:
//
// -----BEGIN Type----- // -----BEGIN Type-----
// Headers // Headers
// //
// base64-encoded Bytes // base64-encoded Bytes
// '=' base64 encoded checksum // '=' base64 encoded checksum
// -----END Type----- // -----END Type-----
//
// where Headers is a possibly empty sequence of Key: Value lines. // where Headers is a possibly empty sequence of Key: Value lines.
// //
// Since the armored data can be very large, this package presents a streaming // Since the armored data can be very large, this package presents a streaming
+1
View File
@@ -96,6 +96,7 @@ func (l *lineBreaker) Close() (err error) {
// trailer. // trailer.
// //
// It's built into a stack of io.Writers: // It's built into a stack of io.Writers:
//
// encoding -> base64 encoder -> lineBreaker -> out // encoding -> base64 encoder -> lineBreaker -> out
type encoding struct { type encoding struct {
out io.Writer out io.Writer
+2 -2
View File
@@ -77,8 +77,8 @@ func Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err
// returns the plaintext of the message. An error can result only if the // returns the plaintext of the message. An error can result only if the
// ciphertext is invalid. Users should keep in mind that this is a padding // ciphertext is invalid. Users should keep in mind that this is a padding
// oracle and thus, if exposed to an adaptive chosen ciphertext attack, can // oracle and thus, if exposed to an adaptive chosen ciphertext attack, can
// be used to break the cryptosystem. See ``Chosen Ciphertext Attacks // be used to break the cryptosystem. See “Chosen Ciphertext Attacks
// Against Protocols Based on the RSA Encryption Standard PKCS #1'', Daniel // Against Protocols Based on the RSA Encryption Standard PKCS #1”, Daniel
// Bleichenbacher, Advances in Cryptology (Crypto '98), // Bleichenbacher, Advances in Cryptology (Crypto '98),
func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) { func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) {
s := new(big.Int).Exp(c1, priv.X, priv.P) s := new(big.Int).Exp(c1, priv.X, priv.P)
+5
View File
@@ -66,13 +66,18 @@ func v3KeyReader(t *testing.T) io.Reader {
// keySigV3Armor is some V3 public key I found in an SKS dump. // keySigV3Armor is some V3 public key I found in an SKS dump.
// Old: Public Key Packet(tag 6)(141 bytes) // Old: Public Key Packet(tag 6)(141 bytes)
//
// Ver 4 - new // Ver 4 - new
// Public key creation time - Fri Sep 16 17:13:54 CDT 1994 // Public key creation time - Fri Sep 16 17:13:54 CDT 1994
// Pub alg - unknown(pub 0) // Pub alg - unknown(pub 0)
// Unknown public key(pub 0) // Unknown public key(pub 0)
//
// Old: User ID Packet(tag 13)(39 bytes) // Old: User ID Packet(tag 13)(39 bytes)
//
// User ID - Armin M. Warda <warda@nephilim.ruhr.de> // User ID - Armin M. Warda <warda@nephilim.ruhr.de>
//
// Old: Signature Packet(tag 2)(149 bytes) // Old: Signature Packet(tag 2)(149 bytes)
//
// Ver 4 - new // Ver 4 - new
// Sig type - unknown(05) // Sig type - unknown(05)
// Pub alg - ElGamal Encrypt-Only(pub 16) // Pub alg - ElGamal Encrypt-Only(pub 16)
+4 -8
View File
@@ -8,8 +8,7 @@
// Both types of hash function use the "sponge" construction and the Keccak // Both types of hash function use the "sponge" construction and the Keccak
// permutation. For a detailed specification see http://keccak.noekeon.org/ // permutation. For a detailed specification see http://keccak.noekeon.org/
// //
// // # Guidance
// Guidance
// //
// If you aren't sure what function you need, use SHAKE256 with at least 64 // If you aren't sure what function you need, use SHAKE256 with at least 64
// bytes of output. The SHAKE instances are faster than the SHA3 instances; // bytes of output. The SHAKE instances are faster than the SHA3 instances;
@@ -19,8 +18,7 @@
// secret key to the input, hash with SHAKE256 and read at least 32 bytes of // secret key to the input, hash with SHAKE256 and read at least 32 bytes of
// output. // output.
// //
// // # Security strengths
// Security strengths
// //
// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security // The SHA3-x (x equals 224, 256, 384, or 512) functions have a security
// strength against preimage attacks of x bits. Since they only produce "x" // strength against preimage attacks of x bits. Since they only produce "x"
@@ -31,8 +29,7 @@
// is used. Requesting more than 64 or 32 bytes of output, respectively, does // is used. Requesting more than 64 or 32 bytes of output, respectively, does
// not increase the collision-resistance of the SHAKE functions. // not increase the collision-resistance of the SHAKE functions.
// //
// // # The sponge construction
// The sponge construction
// //
// A sponge builds a pseudo-random function from a public pseudo-random // A sponge builds a pseudo-random function from a public pseudo-random
// permutation, by applying the permutation to a state of "rate + capacity" // permutation, by applying the permutation to a state of "rate + capacity"
@@ -50,8 +47,7 @@
// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means // Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means
// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2. // that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.
// //
// // # Recommendations
// Recommendations
// //
// The SHAKE functions are recommended for most new uses. They can produce // The SHAKE functions are recommended for most new uses. They can produce
// output of arbitrary length. SHAKE256, with an output length of at least // output of arbitrary length. SHAKE256, with an output length of at least
+2
View File
@@ -34,11 +34,13 @@ const (
// kimd is a wrapper for the 'compute intermediate message digest' instruction. // kimd is a wrapper for the 'compute intermediate message digest' instruction.
// src must be a multiple of the rate for the given function code. // src must be a multiple of the rate for the given function code.
//
//go:noescape //go:noescape
func kimd(function code, chain *[200]byte, src []byte) func kimd(function code, chain *[200]byte, src []byte)
// klmd is a wrapper for the 'compute last message digest' instruction. // klmd is a wrapper for the 'compute last message digest' instruction.
// src padding is handled by the instruction. // src padding is handled by the instruction.
//
//go:noescape //go:noescape
func klmd(function code, chain *[200]byte, dst, src []byte) func klmd(function code, chain *[200]byte, dst, src []byte)
+1
View File
@@ -8,6 +8,7 @@
// ssh-agent process using the sample server. // ssh-agent process using the sample server.
// //
// References: // References:
//
// [PROTOCOL.agent]: https://tools.ietf.org/html/draft-miller-ssh-agent-00 // [PROTOCOL.agent]: https://tools.ietf.org/html/draft-miller-ssh-agent-00
package agent // import "golang.org/x/crypto/ssh/agent" package agent // import "golang.org/x/crypto/ssh/agent"
+3
View File
@@ -49,9 +49,12 @@ func TestParseCert(t *testing.T) {
// % ssh-keygen -s ca -I testcert -O source-address=192.168.1.0/24 -O force-command=/bin/sleep user.pub // % ssh-keygen -s ca -I testcert -O source-address=192.168.1.0/24 -O force-command=/bin/sleep user.pub
// user.pub key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDACh1rt2DXfV3hk6fszSQcQ/rueMId0kVD9U7nl8cfEnFxqOCrNT92g4laQIGl2mn8lsGZfTLg8ksHq3gkvgO3oo/0wHy4v32JeBOHTsN5AL4gfHNEhWeWb50ev47hnTsRIt9P4dxogeUo/hTu7j9+s9lLpEQXCvq6xocXQt0j8MV9qZBBXFLXVT3cWIkSqOdwt/5ZBg+1GSrc7WfCXVWgTk4a20uPMuJPxU4RQwZW6X3+O8Pqo8C3cW0OzZRFP6gUYUKUsTI5WntlS+LAxgw1mZNsozFGdbiOPRnEryE3SRldh9vjDR3tin1fGpA5P7+CEB/bqaXtG3V+F2OkqaMN // user.pub key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDACh1rt2DXfV3hk6fszSQcQ/rueMId0kVD9U7nl8cfEnFxqOCrNT92g4laQIGl2mn8lsGZfTLg8ksHq3gkvgO3oo/0wHy4v32JeBOHTsN5AL4gfHNEhWeWb50ev47hnTsRIt9P4dxogeUo/hTu7j9+s9lLpEQXCvq6xocXQt0j8MV9qZBBXFLXVT3cWIkSqOdwt/5ZBg+1GSrc7WfCXVWgTk4a20uPMuJPxU4RQwZW6X3+O8Pqo8C3cW0OzZRFP6gUYUKUsTI5WntlS+LAxgw1mZNsozFGdbiOPRnEryE3SRldh9vjDR3tin1fGpA5P7+CEB/bqaXtG3V+F2OkqaMN
// Critical Options: // Critical Options:
//
// force-command /bin/sleep // force-command /bin/sleep
// source-address 192.168.1.0/24 // source-address 192.168.1.0/24
//
// Extensions: // Extensions:
//
// permit-X11-forwarding // permit-X11-forwarding
// permit-agent-forwarding // permit-agent-forwarding
// permit-port-forwarding // permit-port-forwarding
+1
View File
@@ -12,6 +12,7 @@ the multiplexed nature of SSH is exposed to users that wish to support
others. others.
References: References:
[PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD
[SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1