mirror of
https://github.com/octoleo/restic.git
synced 2024-12-26 20:30:19 +00:00
Fix golint warnings
(except the exported fields/functions without comments)
This commit is contained in:
parent
f3d09ce7c8
commit
120af801cf
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user