Golint fixes

This commit is contained in:
Harshavardhana
2015-03-25 13:23:07 -07:00
parent 9503a4df33
commit 2cbd15b690
9 changed files with 92 additions and 36 deletions

View File

@@ -21,17 +21,17 @@ package cpu
// int has_avx2 (void);
import "C"
// CPUID instruction verification wrapper for SSE41 extensions
// HasSSE41 - CPUID instruction verification wrapper for SSE41 extensions
func HasSSE41() bool {
return int(C.has_sse41()) == 1
}
// CPUID instruction verification wrapper for AVX extensions
// HasAVX - CPUID instruction verification wrapper for AVX extensions
func HasAVX() bool {
return int(C.has_avx()) == 1
}
// CPUID instruction verification wrapper for AVX2 extensions
// HasAVX2 - CPUID instruction verification wrapper for AVX2 extensions
func HasAVX2() bool {
return int(C.has_avx2()) == 1
}

View File

@@ -98,10 +98,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
}
// Return checksum bytes
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.
d := *d0
hash := d.checkSum()
d0 := *d
hash := d0.checkSum()
return append(in, hash[:]...)
}

View File

@@ -6,6 +6,7 @@ import (
"crypto/sha512"
)
// The size of a SHA512 checksum in bytes.
const (
Size = sha512.Size
)