Skip to content

Commit

Permalink
修复
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Sep 2, 2024
1 parent f37326e commit 0d758e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cipher/shacal2/shacal2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"testing"
"math/rand"
"encoding/hex"
"github.com/deatil/go-cryptobin/cipher"

cryptobin_mode "github.com/deatil/go-cryptobin/mode"
)

func fromHex(s string) []byte {
Expand Down Expand Up @@ -148,13 +149,13 @@ func Test_Check(t *testing.T) {
}

b := make([]byte, len(tt.plain))
cipher.NewECBEncrypter(c).
cryptobin_mode.NewECBEncrypter(c).
CryptBlocks(b[:], tt.plain)
if !bytes.Equal(b[:], tt.cipher) {
t.Errorf("encrypt failed: got %x, want %x", b, tt.cipher)
}

cipher.NewECBDecrypter(c).
cryptobin_mode.NewECBDecrypter(c).
CryptBlocks(b[:], tt.cipher)
if !bytes.Equal(b[:], tt.plain) {
t.Errorf("decrypt failed: got %x, want %x", b, tt.plain)
Expand Down

0 comments on commit 0d758e2

Please sign in to comment.