mirror of
https://github.com/octoleo/restic.git
synced 2024-11-30 00:33:57 +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).
|
// Valid tests whether the key k is valid (i.e. not zero).
|
||||||
func (k *MACKey) Valid() bool {
|
func (m *MACKey) Valid() bool {
|
||||||
nonzeroK := false
|
nonzeroK := false
|
||||||
for i := 0; i < len(k.K); i++ {
|
for i := 0; i < len(m.K); i++ {
|
||||||
if k.K[i] != 0 {
|
if m.K[i] != 0 {
|
||||||
nonzeroK = true
|
nonzeroK = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,8 +185,8 @@ func (k *MACKey) Valid() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(k.R); i++ {
|
for i := 0; i < len(m.R); i++ {
|
||||||
if k.R[i] != 0 {
|
if m.R[i] != 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf
|
// test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf
|
||||||
var poly1305_tests = []struct {
|
var poly1305Tests = []struct {
|
||||||
msg []byte
|
msg []byte
|
||||||
r []byte
|
r []byte
|
||||||
k []byte
|
k []byte
|
||||||
@ -44,7 +44,7 @@ var poly1305_tests = []struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPoly1305(t *testing.T) {
|
func TestPoly1305(t *testing.T) {
|
||||||
for _, test := range poly1305_tests {
|
for _, test := range poly1305Tests {
|
||||||
key := &MACKey{}
|
key := &MACKey{}
|
||||||
copy(key.K[:], test.k)
|
copy(key.K[:], test.k)
|
||||||
copy(key.R[:], test.r)
|
copy(key.R[:], test.r)
|
||||||
|
Loading…
Reference in New Issue
Block a user