mirror of
https://github.com/golang/go
synced 2024-11-23 07:20:06 -07:00
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:
parent
545ef11037
commit
0cd0dc96e0
@ -150,10 +150,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (d0 *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d0 so that caller can keep writing and summing.
|
||||
d := *d0
|
||||
hash := d.checkSum()
|
||||
func (d *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
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
|
||||
func (d0 *digest) ConstantTimeSum(in []byte) []byte {
|
||||
d := *d0
|
||||
hash := d.constSum()
|
||||
func (d *digest) ConstantTimeSum(in []byte) []byte {
|
||||
d0 := *d
|
||||
hash := d0.constSum()
|
||||
return append(in, hash[:]...)
|
||||
}
|
||||
|
||||
|
@ -223,11 +223,11 @@ func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (d0 *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d0 so that caller can keep writing and summing.
|
||||
d := *d0
|
||||
hash := d.checkSum()
|
||||
if d.is224 {
|
||||
func (d *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
if d0.is224 {
|
||||
return append(in, hash[:Size224]...)
|
||||
}
|
||||
return append(in, hash[:]...)
|
||||
|
@ -286,12 +286,12 @@ func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (d0 *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d0 so that caller can keep writing and summing.
|
||||
d := new(digest)
|
||||
*d = *d0
|
||||
hash := d.checkSum()
|
||||
switch d.function {
|
||||
func (d *digest) Sum(in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
d0 := new(digest)
|
||||
*d0 = *d
|
||||
hash := d0.checkSum()
|
||||
switch d0.function {
|
||||
case crypto.SHA384:
|
||||
return append(in, hash[:Size384]...)
|
||||
case crypto.SHA512_224:
|
||||
|
Loading…
Reference in New Issue
Block a user