cipher

package
v0.0.0-...-fa48a8f Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MsgLenFieldSize is the byte size of the frame length field of a
	// framed message.
	MsgLenFieldSize = 4
	// The bytes size limit for a ALTS record message.
	RecordLengthLimit = 1024 * 1024 // 1 MiB
	// The default bytes size of a ALTS record message.
	RecordDefaultLength = 4 * 1024 // 4KiB
	// The initial write buffer size.
	WriteBufferInitialSize = 32 * 1024 // 32KiB
	// The maximum write buffer size. This *must* be multiple of
	// altsRecordDefaultLength.
	WriteBufferMaxSize = 512 * 1024 // 512KiB
)

Variables

This section is empty.

Functions

func Aes256GCM

func Aes256GCM() func(sharedKey []byte) (cipher.AEAD, error)

AEAD via. AES-256 GCM (Galois Counter Mode).

func DeriveAEAD

func DeriveAEAD(
	suiteFn suiteFn, hashFn hashFn, ephemeralSharedKey []byte, context []byte,
) (cipher.AEAD, []byte, error)

Types

type ProtocolAEAD

type ProtocolAEAD struct{}

func NewAEAD

func NewAEAD() ProtocolAEAD

func (ProtocolAEAD) Client

func (ProtocolAEAD) Client(
	info noise.Info, ctx context.Context, auth string, conn net.Conn,
) (net.Conn, error)

func (ProtocolAEAD) Server

func (ProtocolAEAD) Server(info noise.Info, conn net.Conn) (net.Conn, error)

Jump to

Keyboard shortcuts

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