X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=internal%2Fgost34112012%2Fhmac_test.go;h=d8e47afc0d9a42a66f5646a450350391fd44517e;hb=285c03431192ff6ffbfa7470652fd545f06e0b00;hp=d8562b637ff25ae8a2c232dbb281704933a3b8b9;hpb=c07494bbd559b9d00f391e28cfd070e18afe9900;p=gogost.git diff --git a/internal/gost34112012/hmac_test.go b/internal/gost34112012/hmac_test.go index d8562b6..d8e47af 100644 --- a/internal/gost34112012/hmac_test.go +++ b/internal/gost34112012/hmac_test.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2019 Sergey Matveev +// Copyright (C) 2015-2023 Sergey Matveev // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -44,12 +44,12 @@ func TestHMACVectors(t *testing.T) { 0x01, 0x26, 0xbd, 0xb8, 0x78, 0x00, 0xaf, 0x21, 0x43, 0x41, 0x45, 0x65, 0x63, 0x78, 0x01, 0x00, }) - if bytes.Compare(h.Sum(nil), []byte{ + if !bytes.Equal(h.Sum(nil), []byte{ 0xa1, 0xaa, 0x5f, 0x7d, 0xe4, 0x02, 0xd7, 0xb3, 0xd3, 0x23, 0xf2, 0x99, 0x1c, 0x8d, 0x45, 0x34, 0x01, 0x31, 0x37, 0x01, 0x0a, 0x83, 0x75, 0x4f, 0xd0, 0xaf, 0x6d, 0x7c, 0xd4, 0x92, 0x2e, 0xd9, - }) != 0 { + }) { t.FailNow() } }) @@ -65,7 +65,7 @@ func TestHMACVectors(t *testing.T) { 0x01, 0x26, 0xbd, 0xb8, 0x78, 0x00, 0xaf, 0x21, 0x43, 0x41, 0x45, 0x65, 0x63, 0x78, 0x01, 0x00, }) - if bytes.Compare(h.Sum(nil), []byte{ + if !bytes.Equal(h.Sum(nil), []byte{ 0xa5, 0x9b, 0xab, 0x22, 0xec, 0xae, 0x19, 0xc6, 0x5f, 0xbd, 0xe6, 0xe5, 0xf4, 0xe9, 0xf5, 0xd8, 0x54, 0x9d, 0x31, 0xf0, 0x37, 0xf9, 0xdf, 0x9b, @@ -74,7 +74,7 @@ func TestHMACVectors(t *testing.T) { 0x4c, 0xb2, 0xee, 0xdc, 0x29, 0xe9, 0xad, 0x2f, 0x3a, 0xfe, 0x93, 0xb2, 0x81, 0x4f, 0x79, 0xf5, 0x00, 0x0f, 0xfc, 0x03, 0x66, 0xc2, 0x51, 0xe6, - }) != 0 { + }) { t.FailNow() } })