]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost28147/ctr_test.go
FailNow() must be used instead of just marking Fail()
[gogost.git] / src / cypherpunks.ru / gogost / gost28147 / ctr_test.go
index 357d15c0ec8148607165dca258b31dffdd80f19a..139bbb984e762e235e32a9c7d237de205841d0cc 100644 (file)
@@ -106,12 +106,12 @@ func TestCTRGCL3Vector(t *testing.T) {
        tmp := make([]byte, len(plaintext))
        ctr.XORKeyStream(tmp, plaintext)
        if bytes.Compare(tmp, ciphertext) != 0 {
-               t.Fail()
+               t.Fatal("encryption failed")
        }
        ctr = c.NewCTR(iv)
        ctr.XORKeyStream(tmp, tmp)
        if bytes.Compare(tmp, plaintext) != 0 {
-               t.Fail()
+               t.Fatal("decryption failed")
        }
 }
 
@@ -147,12 +147,12 @@ func TestCTRGCL2Vector(t *testing.T) {
        tmp := make([]byte, len(plaintext))
        ctr.XORKeyStream(tmp, plaintext)
        if bytes.Compare(tmp, ciphertext) != 0 {
-               t.Fail()
+               t.Fatal("encryption failed")
        }
        ctr = c.NewCTR(iv[:])
        ctr.XORKeyStream(tmp, tmp)
        if bytes.Compare(tmp, plaintext) != 0 {
-               t.Fail()
+               t.Fatal("decryption failed")
        }
 }