X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgogost%2Fgost28147%2Fmac_test.go;h=9f85665b7e3fd8af776994262e3e988e2ac07695;hb=1f35967fa918c1653dfa787818ce4f3559283ff5;hp=58ed6ecfcef0c8a98c0205c992d0e19daaee7a03;hpb=69e668f3499122e0b1140f3bd927de41ad279b94;p=gogost.git diff --git a/src/cypherpunks.ru/gogost/gost28147/mac_test.go b/src/cypherpunks.ru/gogost/gost28147/mac_test.go index 58ed6ec..9f85665 100644 --- a/src/cypherpunks.ru/gogost/gost28147/mac_test.go +++ b/src/cypherpunks.ru/gogost/gost28147/mac_test.go @@ -30,18 +30,18 @@ func TestMACVectors(t *testing.T) { var iv [8]byte m, err := c.NewMAC(8, iv[:]) if err != nil { - t.Fail() + t.FailNow() } m.Write([]byte("a")) if bytes.Compare(m.Sum(nil), []byte{0xbd, 0x5d, 0x3b, 0x5b, 0x2b, 0x7b, 0x57, 0xaf}) != 0 { - t.Fail() + t.FailNow() } m.Reset() m.Write([]byte("abc")) if bytes.Compare(m.Sum(nil), []byte{0x28, 0x66, 0x1e, 0x40, 0x80, 0x5b, 0x1f, 0xf9}) != 0 { - t.Fail() + t.FailNow() } m.Reset() @@ -49,7 +49,7 @@ func TestMACVectors(t *testing.T) { m.Write([]byte("U")) } if bytes.Compare(m.Sum(nil), []byte{0x1a, 0x06, 0xd1, 0xba, 0xd7, 0x45, 0x80, 0xef}) != 0 { - t.Fail() + t.FailNow() } m.Reset() @@ -57,7 +57,7 @@ func TestMACVectors(t *testing.T) { m.Write([]byte("x")) } if bytes.Compare(m.Sum(nil), []byte{0x91, 0x7e, 0xe1, 0xf1, 0xa6, 0x68, 0xfb, 0xd3}) != 0 { - t.Fail() + t.FailNow() } } @@ -71,7 +71,7 @@ func TestMACRandom(t *testing.T) { } m, err := c.NewMAC(8, iv[:]) if err != nil { - t.Fail() + return false } var tag1 []byte