stream

package
v0.0.0-...-d00ae73 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_PACKET_SIZE = 64 * 1204

Variables

View Source
var ErrShortPacket = errors.New("short packet")

Functions

func GetStreamCiphers

func GetStreamCiphers() map[string]IStreamCipher

func GetStreamConnCiphers

func GetStreamConnCiphers(method string) func(string, net.Conn) (net.Conn, error)

func GetStreamPacketCiphers

func GetStreamPacketCiphers(method string) func(string, net.PacketConn) (net.PacketConn, error)

func MD5

func MD5(data []byte) []byte

Types

type IStreamCipher

type IStreamCipher interface {
	KeyLen() int
	IVLen() int
	// decryptOrEncrypt 0: encrypt 1: decrypt
	NewStream(key []byte, iv []byte, decryptOrEncrypt int) (cipher.Stream, error)
}

func GetStreamCipher

func GetStreamCipher(method string) IStreamCipher

Jump to

Keyboard shortcuts

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