mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
hmac
This commit is contained in:
19
hmac/hmac_test.go
Normal file
19
hmac/hmac_test.go
Normal file
@ -0,0 +1,19 @@
|
||||
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)))
|
||||
}
|
Reference in New Issue
Block a user