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:
@@ -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
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user