Fix golint warnings

(except the exported fields/functions without comments)
This commit is contained in:
Pauline Middelink 2017-05-17 01:39:39 +02:00
parent f3d09ce7c8
commit 120af801cf
2 changed files with 7 additions and 7 deletions

View File

@ -173,10 +173,10 @@ func (m *MACKey) UnmarshalJSON(data []byte) error {
}
// Valid tests whether the key k is valid (i.e. not zero).
func (k *MACKey) Valid() bool {
func (m *MACKey) Valid() bool {
nonzeroK := false
for i := 0; i < len(k.K); i++ {
if k.K[i] != 0 {
for i := 0; i < len(m.K); i++ {
if m.K[i] != 0 {
nonzeroK = true
}
}
@ -185,8 +185,8 @@ func (k *MACKey) Valid() bool {
return false
}
for i := 0; i < len(k.R); i++ {
if k.R[i] != 0 {
for i := 0; i < len(m.R); i++ {
if m.R[i] != 0 {
return true
}
}

View File

@ -7,7 +7,7 @@ import (
)
// test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf
var poly1305_tests = []struct {
var poly1305Tests = []struct {
msg []byte
r []byte
k []byte
@ -44,7 +44,7 @@ var poly1305_tests = []struct {
}
func TestPoly1305(t *testing.T) {
for _, test := range poly1305_tests {
for _, test := range poly1305Tests {
key := &MACKey{}
copy(key.K[:], test.k)
copy(key.R[:], test.r)