]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost28147/ctr_test.go
ESPTREE
[gogost.git] / src / cypherpunks.ru / gogost / gost28147 / ctr_test.go
index 357d15c0ec8148607165dca258b31dffdd80f19a..27806427bcba65888ee92780936936a5d9dd23d7 100644 (file)
@@ -3,8 +3,7 @@
 //
 // 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
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// the Free Software Foundation, version 3 of the License.
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -106,12 +105,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 +146,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")
        }
 }