package cmb

import (
	"testing"
)

func TestGenerateSM4Key(t *testing.T) {
	got, err := generateSm4Key()
	if err != nil {
		t.Error(err)
		return
	}
	t.Log(len(got))
	t.Log(len("ff875faf8b0fa394b811d62693d196f7"))
	t.Log("ff875faf8b0fa394b811d62693d196f7")
	t.Log(got)
}

func TestSM4(t *testing.T) {
	encryptKey := "NnxLrCCyaYGZtL/FtUnraQ=="
	enc, err := SM4Encrypt([]byte("Ckm2BMNUppUJBNGA"), encryptKey)
	if err != nil {
		t.Error(err)
		return
	}
	t.Log(enc)
	dec, err := SM4Decrypt(enc, encryptKey)
	if err != nil {
		t.Error(err)
		return
	}
	t.Log(dec)
}
