X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Fvko2001_test.go;h=a6585f3d50e96d1d1df209ec85ab54c6428733af;hb=285c03431192ff6ffbfa7470652fd545f06e0b00;hp=456bb84abaa42fd34207ad69d51ff5e30cf4dfaa;hpb=5fc90f4d05f0515cc91dd9feceb813e2b753cbb7;p=gogost.git diff --git a/gost3410/vko2001_test.go b/gost3410/vko2001_test.go index 456bb84..a6585f3 100644 --- a/gost3410/vko2001_test.go +++ b/gost3410/vko2001_test.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2022 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 @@ -36,10 +36,10 @@ func TestVKO2001(t *testing.T) { pub2, _ := prv2.PublicKey() kek1, _ := prv1.KEK2001(pub2, ukm) kek2, _ := prv2.KEK2001(pub1, ukm) - if bytes.Compare(kek1, kek2) != 0 { + if !bytes.Equal(kek1, kek2) { t.FailNow() } - if bytes.Compare(kek1, kek) != 0 { + if !bytes.Equal(kek1, kek) { t.FailNow() } } @@ -80,7 +80,7 @@ func TestRandomVKO2001(t *testing.T) { ukm := NewUKM(ukmRaw[:]) kek1, _ := prv1.KEK2001(pub2, ukm) kek2, _ := prv2.KEK2001(pub1, ukm) - return bytes.Compare(kek1, kek2) == 0 + return bytes.Equal(kek1, kek2) } if err := quick.Check(f, nil); err != nil { t.Error(err)