1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 13:05:28 -05:00

more security types in vmess.

This commit is contained in:
Darien Raymond
2016-12-07 17:32:40 +01:00
parent 6d0915cc8c
commit 85163d4b47
13 changed files with 333 additions and 314 deletions

View File

@@ -0,0 +1,24 @@
package encoding_test
import (
"crypto/rand"
"testing"
. "v2ray.com/core/proxy/vmess/encoding"
"v2ray.com/core/testing/assert"
)
func TestFnvAuth(t *testing.T) {
assert := assert.On(t)
fnvAuth := new(FnvAuthenticator)
expectedText := make([]byte, 256)
rand.Read(expectedText)
buffer := make([]byte, 512)
b := fnvAuth.Seal(buffer, nil, expectedText, nil)
b, err := fnvAuth.Open(buffer, nil, b, nil)
assert.Error(err).IsNil()
assert.Int(len(b)).Equals(256)
assert.Bytes(b).Equals(expectedText)
}