1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-29 01:00:00 -04:00

prototype of vpndialer

This commit is contained in:
Darien Raymond
2017-04-30 23:37:30 +02:00
parent 61b6b6fff5
commit c5aa4acb35
8 changed files with 307 additions and 1 deletions

View File

@@ -60,6 +60,13 @@ func (v *AEADAuthenticator) Seal(dst, plainText []byte) ([]byte, error) {
return v.AEAD.Seal(dst, iv, plainText, additionalData), nil
}
type StreamMode int
const (
ModeStream StreamMode = iota
ModePacket
)
type AuthenticationReader struct {
auth Authenticator
buffer *buf.Buffer

View File

@@ -20,6 +20,13 @@ func BytesToUint32(value []byte) uint32 {
uint32(value[3])
}
func BytesToInt(value []byte) int {
return int(value[0])<<24 |
int(value[1])<<16 |
int(value[2])<<8 |
int(value[3])
}
// BytesToInt64 deserializes a byte array to an int64 in big endian order. The byte array must have at least 8 elements.
func BytesToInt64(value []byte) int64 {
return int64(value[0])<<56 |