shadowaead

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConn

func NewConn(connection net.Conn, aead aeadCipher, saltFilter SaltFilter) net.Conn

NewConn wraps a stream net.Conn connection with a cipher.

func NewPacketConn

func NewPacketConn(connection net.PacketConn, aead aeadCipher, saltFilter SaltFilter) net.PacketConn

NewPacketConn wraps a net.PacketConn with a cipher.

Types

type AEADCipherAdapter added in v0.3.0

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

func AESGCM

func AESGCM(preSharedKey []byte) *AEADCipherAdapter

AESGCM creates a new Cipher with a pre-shared key of 16 or 32 bytes.

func Chacha20Poly1305

func Chacha20Poly1305(preSharedKey []byte) *AEADCipherAdapter

Chacha20Poly1305 creates a new Cipher with a pre-shared key of 32 bytes.

func (*AEADCipherAdapter) Crypt added in v0.3.0

func (c *AEADCipherAdapter) Crypt(salt []byte) (cipher.AEAD, error)

func (*AEADCipherAdapter) GetSaltSize added in v0.3.0

func (c *AEADCipherAdapter) GetSaltSize() int

type SaltFilter added in v0.5.0

type SaltFilter interface {
	AddSalt(b []byte)
	IsSaltRepeated(b []byte) bool
}

SaltFilter is used to mitigate replay attacks by detecting repeated salts.

Jump to

Keyboard shortcuts

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