]> Cypherpunks.ru repositories - gogost.git/blobdiff - gost28147/cfb_test.go
Use more modern Go version
[gogost.git] / gost28147 / cfb_test.go
index 1f40e45d1c23619526141f05ce89ef4def7f3b17..1e2fad04a7136df871c64324b5acb460277c68c5 100644 (file)
@@ -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)