mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
20 lines
260 B
Go
20 lines
260 B
Go
package hmac_test
|
|
|
|
import (
|
|
"crypto/hmac"
|
|
"encoding/hex"
|
|
"testing"
|
|
|
|
"github.com/tjfoc/gmsm/sm3"
|
|
)
|
|
|
|
func TestHmac(t *testing.T) {
|
|
|
|
key := []byte("")
|
|
msg := []byte("123")
|
|
|
|
h := hmac.New(sm3.New, key)
|
|
h.Write(msg)
|
|
t.Log(hex.EncodeToString(h.Sum(nil)))
|
|
}
|