Documentation ¶
Index ¶
- Constants
- Variables
- func Blake3KeyedHash(reader io.Reader) io.Reader
- func Key(key []byte, keyLength int) []byte
- func NewMethod(ctx context.Context, methodName string, options C.MethodOptions) (C.Method, error)
- func SessionKey(psk []byte, salt []byte, keyLength int) []byte
- type Method
- type SlidingWindow
Constants ¶
View Source
const ( HeaderTypeClient = 0 HeaderTypeServer = 1 MaxPaddingLength = 900 PacketNonceSize = 24 RequestHeaderFixedChunkLength = 1 + 8 + 2 PacketMinimalHeaderSize = 30 )
Variables ¶
View Source
var ( ErrNoEIH = E.New("Shadowsocks 2022 EIH support only available in AES ciphers") ErrBadHeaderType = E.New("bad header type") ErrBadTimestamp = E.New("bad timestamp") ErrBadRequestSalt = E.New("bad request salt") ErrSaltNotUnique = E.New("salt not unique") ErrBadClientSessionId = E.New("bad client session id") ErrPacketIdNotUnique = E.New("packet id not unique") ErrTooManyServerSessions = E.New("server session changed more than once during the last minute") )
View Source
var MethodList = []string{
"2022-blake3-aes-128-gcm",
"2022-blake3-aes-256-gcm",
"2022-blake3-chacha20-poly1305",
}
Functions ¶
Types ¶
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
func (*Method) DialEarlyConn ¶
func (*Method) DialPacketConn ¶
func (m *Method) DialPacketConn(conn net.Conn) N.NetPacketConn
type SlidingWindow ¶
type SlidingWindow struct {
// contains filtered or unexported fields
}
SlidingWindow maintains a sliding window of uint64 counters.
func (*SlidingWindow) Add ¶
func (f *SlidingWindow) Add(counter uint64)
Add adds counter to the sliding window without checking if the counter is valid. Call Check beforehand to make sure the counter is valid.
func (*SlidingWindow) Check ¶
func (f *SlidingWindow) Check(counter uint64) bool
Check checks whether counter can be accepted by the sliding window filter.
func (*SlidingWindow) Reset ¶
func (f *SlidingWindow) Reset()
Reset resets the filter to its initial state.
Click to show internal directories.
Click to hide internal directories.