OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Update to current version of Go library (revision 94d654be2064).
[pf3gnuchains/gcc-fork.git]
/
libgo
/
go
/
crypto
/
rsa
/
rsa.go
diff --git
a/libgo/go/crypto/rsa/rsa.go
b/libgo/go/crypto/rsa/rsa.go
index
c7a8d20
..
faf9149
100644
(file)
--- a/
libgo/go/crypto/rsa/rsa.go
+++ b/
libgo/go/crypto/rsa/rsa.go
@@
-274,6
+274,14
@@
func EncryptOAEP(hash hash.Hash, rand io.Reader, pub *PublicKey, msg []byte, lab
m.SetBytes(em)
c := encrypt(new(big.Int), pub, m)
out = c.Bytes()
+
+ if len(out) < k {
+ // If the output is too small, we need to left-pad with zeros.
+ t := make([]byte, k)
+ copy(t[k-len(out):], out)
+ out = t
+ }
+
return
}