shadowio

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Overhead
	// crypto/cipher.gcmTagSize
	// golang.org/x/crypto/chacha20poly1305.Overhead
	Overhead = 16
)
View Source
const PacketLengthBufferSize = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(upstream io.Reader, cipher cipher.AEAD) *Reader

func (*Reader) Decrypt

func (r *Reader) Decrypt(destination []byte, source []byte) error

func (*Reader) InitializeReadWaiter

func (r *Reader) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

func (*Reader) ReadBuffer

func (r *Reader) ReadBuffer(buffer *buf.Buffer) error

func (*Reader) ReadFixedBuffer

func (r *Reader) ReadFixedBuffer(pLen int) (*buf.Buffer, error)

func (*Reader) WaitReadBuffer

func (r *Reader) WaitReadBuffer() (buffer *buf.Buffer, err error)

type Writer

type Writer struct {
	WriterInterface
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(writer io.Writer, cipher cipher.AEAD, nonce []byte, maxPacketSize int) *Writer

func (*Writer) Encrypt

func (w *Writer) Encrypt(destination []byte, source []byte)

func (*Writer) TakeNonce

func (w *Writer) TakeNonce() []byte

func (*Writer) Upstream

func (w *Writer) Upstream() any

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

func (*Writer) WriteBuffer

func (w *Writer) WriteBuffer(buffer *buf.Buffer) error

type WriterInterface

type WriterInterface struct{}

func (*WriterInterface) FrontHeadroom

func (w *WriterInterface) FrontHeadroom() int

func (*WriterInterface) RearHeadroom

func (w *WriterInterface) RearHeadroom() int

Jump to

Keyboard shortcuts

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