format with go fmt

This commit is contained in:
Jeff Becker
2016-01-29 07:22:31 -05:00
parent f2c6e01206
commit 1e471e4e00
38 changed files with 694 additions and 729 deletions

View File

@ -1,28 +1,27 @@
package crypto
import (
"bytes"
"encoding/base64"
"testing"
"bytes"
"encoding/base64"
"testing"
)
// XXX: IMPLEMENT THIS
func Test_I2PHMAC(t *testing.T) {
data := make([]byte, 64)
for idx, _ := range data {
data[idx] = 1
}
var k HMACKey
for idx, _ := range k[:] {
k[idx] = 1
}
d := I2PHMAC(data, k)
expected_str := "WypV9tIaH1Kn9i7/9OqP6Q=="
expected, _ := base64.StdEncoding.DecodeString(expected_str)
if ! bytes.Equal(d[:], expected) {
t.Logf("%d vs %d", len(d), len(expected))
t.Logf("%q != %q", d, expected)
t.Fail()
}
data := make([]byte, 64)
for idx, _ := range data {
data[idx] = 1
}
var k HMACKey
for idx, _ := range k[:] {
k[idx] = 1
}
d := I2PHMAC(data, k)
expected_str := "WypV9tIaH1Kn9i7/9OqP6Q=="
expected, _ := base64.StdEncoding.DecodeString(expected_str)
if !bytes.Equal(d[:], expected) {
t.Logf("%d vs %d", len(d), len(expected))
t.Logf("%q != %q", d, expected)
t.Fail()
}
}