aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/rsa/rsa.go
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2016-09-22 10:58:43 +1000
committerNigel Tao <nigeltao@golang.org>2016-09-22 03:06:25 +0000
commita7dc821d6447f9bdfb54e2fad2ab76f6d40873ca (patch)
treeb5c8f3bad32a0aa75c1ef53acb38f4e7dc081235 /src/crypto/rsa/rsa.go
parent9e028b70ea3c1a81220a63c2ed3a2c1cd216c733 (diff)
downloadgo-a7dc821d6447f9bdfb54e2fad2ab76f6d40873ca.tar.gz
go-a7dc821d6447f9bdfb54e2fad2ab76f6d40873ca.zip
crypto/rsa: clarify comment on maximum message length.
See https://groups.google.com/d/topic/golang-nuts/stbum5gZbAc/discussion Change-Id: I2e78e8d0dadd78c8b0389514cad3c45d061b663b Reviewed-on: https://go-review.googlesource.com/29496 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/crypto/rsa/rsa.go')
-rw-r--r--src/crypto/rsa/rsa.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/rsa/rsa.go b/src/crypto/rsa/rsa.go
index 94862597dc..f809a9b9bc 100644
--- a/src/crypto/rsa/rsa.go
+++ b/src/crypto/rsa/rsa.go
@@ -362,8 +362,8 @@ func encrypt(c *big.Int, pub *PublicKey, m *big.Int) *big.Int {
// values could be used to ensure that a ciphertext for one purpose cannot be
// used for another by an attacker. If not required it can be empty.
//
-// The message must be no longer than the length of the public modulus less
-// twice the hash length plus 2.
+// The message must be no longer than the length of the public modulus minus
+// twice the hash length, minus a further 2.
func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error) {
if err := checkPub(pub); err != nil {
return nil, err