X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Fvko2001_test.go;h=456bb84abaa42fd34207ad69d51ff5e30cf4dfaa;hb=HEAD;hp=912fc75a6f9b5970c066c48d6d016f70fc98976c;hpb=5afe1dcbfaf1043ed9e72e215a285966eaba3369;p=gogost.git diff --git a/gost3410/vko2001_test.go b/gost3410/vko2001_test.go index 912fc75..2e5e91a 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-2023 Sergey Matveev +// Copyright (C) 2015-2024 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)