remove bytes.Copy

replace all calls with calls to copy
use copy in regexp and bytes.Buffer

R=rsc
CC=golang-dev
https://golang.org/cl/157073
This commit is contained in:
Rob Pike 2009-11-18 15:24:24 -08:00
parent 093493c6a5
commit e70cedfaec
22 changed files with 147 additions and 218 deletions

View file

@ -9,7 +9,6 @@ package rsa
import (
"big";
"bytes";
"crypto/subtle";
"hash";
"io";
@ -263,9 +262,9 @@ func EncryptOAEP(hash hash.Hash, rand io.Reader, pub *PublicKey, msg []byte, lab
seed := em[1 : 1+hash.Size()];
db := em[1+hash.Size() : len(em)];
bytes.Copy(db[0:hash.Size()], lHash);
copy(db[0:hash.Size()], lHash);
db[len(db)-len(msg)-1] = 1;
bytes.Copy(db[len(db)-len(msg):len(db)], msg);
copy(db[len(db)-len(msg):len(db)], msg);
_, err = io.ReadFull(rand, seed);
if err != nil {
@ -445,6 +444,6 @@ func leftPad(input []byte, size int) (out []byte) {
n = size
}
out = make([]byte, size);
bytes.Copy(out[len(out)-n:len(out)], input);
copy(out[len(out)-n:len(out)], input);
return;
}