mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
093493c6a5
commit
e70cedfaec
22 changed files with 147 additions and 218 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue