Exemplo n.º 1
0
func testHmac(t *testing.T, en platform.Encryptor, s1 []byte) {
	b1 := en.Sum(s1)
	b2 := en.Sum(s1)
	t.Logf("HMAC(%s)=%s", s1, hex.EncodeToString(b1))
	t.Logf("HMAC(%s)=%s", s1, hex.EncodeToString(b2))
	if !en.Equal(s1, b1) {
		t.Fatalf("error on check")
	}
}