Documentation
¶
Index ¶
- Variables
- func CreatPadding(paddingLens, paddingGaps [][3]int) (length int, lens []int, gaps []time.Duration)
- func DecodeHeader(h []byte) (l int, err error)
- func DecodeLength(b []byte) int
- func EncodeHeader(h []byte, l int)
- func EncodeLength(l int) []byte
- func IncreaseNonce(nonce []byte) []byte
- func NewCTR(key, iv []byte) cipher.Stream
- func ParsePadding(padding string, paddingLens, paddingGaps *[][3]int) (err error)
- type AEAD
- type ClientInstance
- type CommonConn
- type ServerInstance
- type ServerSession
- type XorConn
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxNonce = bytes.Repeat([]byte{255}, 12)
Functions ¶
func CreatPadding ¶
func DecodeHeader ¶
func DecodeLength ¶
func EncodeHeader ¶
func EncodeLength ¶
func IncreaseNonce ¶
func ParsePadding ¶
Types ¶
type ClientInstance ¶
type ClientInstance struct {
NfsPKeys []any
NfsPKeysBytes [][]byte
Hash32s [][32]byte
RelaysLength int
XorMode uint32
Seconds uint32
PaddingLens [][3]int
PaddingGaps [][3]int
RWLock sync.RWMutex
Expire time.Time
PfsKey []byte
Ticket []byte
}
func (*ClientInstance) Handshake ¶
func (i *ClientInstance) Handshake(conn net.Conn) (*CommonConn, error)
type CommonConn ¶
type CommonConn struct {
net.Conn
UseAES bool
Client *ClientInstance
UnitedKey []byte
PreWrite []byte
AEAD *AEAD
PeerAEAD *AEAD
PeerPadding []byte
// contains filtered or unexported fields
}
func NewCommonConn ¶
func NewCommonConn(conn net.Conn, useAES bool) *CommonConn
type ServerInstance ¶
type ServerInstance struct {
NfsSKeys []any
NfsPKeysBytes [][]byte
Hash32s [][32]byte
RelaysLength int
XorMode uint32
SecondsFrom int64
SecondsTo int64
PaddingLens [][3]int
PaddingGaps [][3]int
RWLock sync.RWMutex
Closed bool
Lasts map[int64][16]byte
Tickets [][16]byte
Sessions map[[16]byte]*ServerSession
}
func (*ServerInstance) Close ¶
func (i *ServerInstance) Close() (err error)
func (*ServerInstance) Handshake ¶
func (i *ServerInstance) Handshake(conn net.Conn, fallback *[]byte) (*CommonConn, error)
type ServerSession ¶
Click to show internal directories.
Click to hide internal directories.