github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/proxy/shadowsocksr/utils/tool_test.go (about)

     1  package ssr
     2  
     3  import (
     4  	"crypto"
     5  	"testing"
     6  
     7  	"github.com/Asutorufa/yuhaiin/pkg/net/proxy/shadowsocks/core"
     8  )
     9  
    10  func TestKDF(t *testing.T) {
    11  	t.Log(core.KDF("12345678", 16))
    12  }
    13  
    14  func TestMd5Hmac(t *testing.T) {
    15  	t.Log(Hmac(crypto.MD5, []byte("12345678"), []byte("12345678"), nil))
    16  	// t.Log(HmacMD52([]byte("12345678"), []byte("12345678")))
    17  	t.Log(Hmac(crypto.MD5, []byte("xxxx"), []byte("xxxx"), nil))
    18  	// t.Log(HmacMD52([]byte("xxxx"), []byte("xxxx")))
    19  	t.Log(Hmac(crypto.MD5, []byte("12345678"), []byte("12345678xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), nil))
    20  	// t.Log(HmacMD52([]byte("12345678"), []byte("12345678xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")))
    21  	t.Log(Hmac(crypto.MD5, []byte("xxxx"), []byte("xxxx"), nil))
    22  	// t.Log(HmacMD52([]byte("xxxx"), []byte("xxxx")))
    23  }