init: v1.0.0

This commit is contained in:
yaole
2026-05-27 23:03:00 +08:00
commit 8d97f750eb
466 changed files with 80067 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package cbcmac
import (
"fmt"
"testing"
"xdx.jelly/xgcl/sm/sm4"
)
func TestCbcMac(t *testing.T) {
key := make([]byte, 16)
msg := make([]byte, 16)
c, err := sm4.NewCipher(key)
if err != nil {
t.Fatal(err)
}
mac, err := New(c)
if err != nil {
t.Fatal(err)
}
mac.Write(msg)
m := mac.Sum(nil)
if len(m) == 0 {
t.Fatal("compute mac error")
}
fmt.Printf("%x\n", m)
}