X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost28147%2Fcfb_test.go;h=1e2fad04a7136df871c64324b5acb460277c68c5;hb=285c03431192ff6ffbfa7470652fd545f06e0b00;hp=1f40e45d1c23619526141f05ce89ef4def7f3b17;hpb=5afe1dcbfaf1043ed9e72e215a285966eaba3369;p=gogost.git diff --git a/gost28147/cfb_test.go b/gost28147/cfb_test.go index 1f40e45..1e2fad0 100644 --- a/gost28147/cfb_test.go +++ b/gost28147/cfb_test.go @@ -43,12 +43,12 @@ func TestCFBCryptomanager(t *testing.T) { tmp := make([]byte, 16) fe := c.NewCFBEncrypter(iv) fe.XORKeyStream(tmp, pt) - if bytes.Compare(tmp, ct) != 0 { + if !bytes.Equal(tmp, ct) { t.Fatal("encryption failed") } fd := c.NewCFBDecrypter(iv) fd.XORKeyStream(tmp, ct) - if bytes.Compare(tmp, pt) != 0 { + if !bytes.Equal(tmp, pt) { t.Fatal("decryption failed") } } @@ -65,7 +65,7 @@ func TestCFBRandom(t *testing.T) { fd := c.NewCFBDecrypter(iv[:]) pt2 := make([]byte, len(ct)) fd.XORKeyStream(pt2, ct) - return bytes.Compare(pt2, pt) == 0 + return bytes.Equal(pt2, pt) } if err := quick.Check(f, nil); err != nil { t.Error(err)