]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/aes: more precise description for AES keys requirements
authorPasha Radchenko <ep4sh2k@gmail.com>
Thu, 6 Feb 2025 18:42:28 +0000 (18:42 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 10 Feb 2025 16:30:07 +0000 (08:30 -0800)
The existing documentation is not certain in the place regarding requirements about AES key.
Added some notes for precise description.

Change-Id: I190562ab7c1566cce8e7771f9927d738c72880ce
GitHub-Last-Rev: 6565a8f4e5b37220fd14d55e876b809b2d763b7c
GitHub-Pull-Request: golang/go#71589
Reviewed-on: https://go-review.googlesource.com/c/go/+/647336
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/aes/aes.go

index 5bc2d13d673e0a2660574b5055916c50e36d049c..22ea8819ed239affd8d0e1d1bc8d186d2be46fa4 100644 (file)
@@ -30,7 +30,7 @@ func (k KeySizeError) Error() string {
 }
 
 // NewCipher creates and returns a new [cipher.Block].
-// The key argument should be the AES key,
+// The key argument must be the AES key,
 // either 16, 24, or 32 bytes to select
 // AES-128, AES-192, or AES-256.
 func NewCipher(key []byte) (cipher.Block, error) {