summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/rsa/rsa.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/rsa/rsa.go')
-rw-r--r--libgo/go/crypto/rsa/rsa.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/crypto/rsa/rsa.go b/libgo/go/crypto/rsa/rsa.go
index f74525c103a..c07e8f90db7 100644
--- a/libgo/go/crypto/rsa/rsa.go
+++ b/libgo/go/crypto/rsa/rsa.go
@@ -189,12 +189,13 @@ func incCounter(c *[4]byte) {
// specified in PKCS#1 v2.1.
func mgf1XOR(out []byte, hash hash.Hash, seed []byte) {
var counter [4]byte
+ var digest []byte
done := 0
for done < len(out) {
hash.Write(seed)
hash.Write(counter[0:4])
- digest := hash.Sum(nil)
+ digest = hash.Sum(digest[:0])
hash.Reset()
for i := 0; i < len(digest) && done < len(out); i++ {