crypto: make receiver name consistent

Fixes go lint warning.

Change-Id: I63950e7c70bf431e88a04f32befd50be9beacadf
Reviewed-on: https://go-review.googlesource.com/108815
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
ludweeg 2018-04-23 20:20:43 +03:00 committed by Brad Fitzpatrick
parent 545ef11037
commit 0cd0dc96e0
3 changed files with 18 additions and 18 deletions

View File

@ -150,10 +150,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
return return
} }
func (d0 *digest) Sum(in []byte) []byte { func (d *digest) Sum(in []byte) []byte {
// Make a copy of d0 so that caller can keep writing and summing. // Make a copy of d so that caller can keep writing and summing.
d := *d0 d0 := *d
hash := d.checkSum() hash := d0.checkSum()
return append(in, hash[:]...) return append(in, hash[:]...)
} }
@ -189,9 +189,9 @@ func (d *digest) checkSum() [Size]byte {
} }
// ConstantTimeSum computes the same result of Sum() but in constant time // ConstantTimeSum computes the same result of Sum() but in constant time
func (d0 *digest) ConstantTimeSum(in []byte) []byte { func (d *digest) ConstantTimeSum(in []byte) []byte {
d := *d0 d0 := *d
hash := d.constSum() hash := d0.constSum()
return append(in, hash[:]...) return append(in, hash[:]...)
} }

View File

@ -223,11 +223,11 @@ func (d *digest) Write(p []byte) (nn int, err error) {
return return
} }
func (d0 *digest) Sum(in []byte) []byte { func (d *digest) Sum(in []byte) []byte {
// Make a copy of d0 so that caller can keep writing and summing. // Make a copy of d so that caller can keep writing and summing.
d := *d0 d0 := *d
hash := d.checkSum() hash := d0.checkSum()
if d.is224 { if d0.is224 {
return append(in, hash[:Size224]...) return append(in, hash[:Size224]...)
} }
return append(in, hash[:]...) return append(in, hash[:]...)

View File

@ -286,12 +286,12 @@ func (d *digest) Write(p []byte) (nn int, err error) {
return return
} }
func (d0 *digest) Sum(in []byte) []byte { func (d *digest) Sum(in []byte) []byte {
// Make a copy of d0 so that caller can keep writing and summing. // Make a copy of d so that caller can keep writing and summing.
d := new(digest) d0 := new(digest)
*d = *d0 *d0 = *d
hash := d.checkSum() hash := d0.checkSum()
switch d.function { switch d0.function {
case crypto.SHA384: case crypto.SHA384:
return append(in, hash[:Size384]...) return append(in, hash[:Size384]...)
case crypto.SHA512_224: case crypto.SHA512_224: