core

package
v1.18.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCipherNotSupported = errors.New("cipher not supported")

ErrCipherNotSupported occurs when a cipher is not supported (likely because of security concerns).

Functions

func Kdf

func Kdf(password string, keyLen int) []byte

key-derivation function from original Shadowsocks

func ListCipher

func ListCipher() []string

ListCipher returns a list of available cipher names sorted alphabetically.

Types

type AeadCipher

type AeadCipher struct {
	shadowaead.Cipher

	Key []byte
}

func (*AeadCipher) PacketConn

func (aead *AeadCipher) PacketConn(c N.EnhancePacketConn) N.EnhancePacketConn

func (*AeadCipher) StreamConn

func (aead *AeadCipher) StreamConn(c net.Conn) net.Conn

type Cipher

type Cipher interface {
	StreamConnCipher
	PacketConnCipher
}

func PickCipher

func PickCipher(name string, key []byte, password string) (Cipher, error)

PickCipher returns a Cipher of the given name. Derive key from password if given key is empty.

type PacketConnCipher

type PacketConnCipher interface {
	PacketConn(N.EnhancePacketConn) N.EnhancePacketConn
}

type StreamCipher

type StreamCipher struct {
	shadowstream.Cipher

	Key []byte
}

func (*StreamCipher) PacketConn

func (ciph *StreamCipher) PacketConn(c N.EnhancePacketConn) N.EnhancePacketConn

func (*StreamCipher) StreamConn

func (ciph *StreamCipher) StreamConn(c net.Conn) net.Conn

type StreamConnCipher

type StreamConnCipher interface {
	StreamConn(net.Conn) net.Conn
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL