Help us shape the future of Go! Take the 2026 Go Developer Survey

aead

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KDFSaltConstAuthIDEncryptionKey             = "AES Auth ID Encryption"
	KDFSaltConstAEADRespHeaderLenKey            = "AEAD Resp Header Len Key"
	KDFSaltConstAEADRespHeaderLenIV             = "AEAD Resp Header Len IV"
	KDFSaltConstAEADRespHeaderPayloadKey        = "AEAD Resp Header Key"
	KDFSaltConstAEADRespHeaderPayloadIV         = "AEAD Resp Header IV"
	KDFSaltConstVMessAEADKDF                    = "VMess AEAD KDF"
	KDFSaltConstVMessHeaderPayloadAEADKey       = "VMess Header AEAD Key"
	KDFSaltConstVMessHeaderPayloadAEADIV        = "VMess Header AEAD Nonce"
	KDFSaltConstVMessHeaderPayloadLengthAEADKey = "VMess Header AEAD Key_Length"
	KDFSaltConstVMessHeaderPayloadLengthAEADIV  = "VMess Header AEAD Nonce_Length"
)

Variables

View Source
var (
	ErrNotFound = errors.New("user do not exist")
	ErrReplay   = errors.New("replayed request")
)

Functions

func CreateAuthID

func CreateAuthID(cmdKey []byte, time int64) [16]byte

func KDF

func KDF(key []byte, path ...string) []byte

func KDF16

func KDF16(key []byte, path ...string) []byte

func NewCipherFromKey

func NewCipherFromKey(cmdKey []byte) cipher.Block

func OpenVMessAEADHeader

func OpenVMessAEADHeader(key [16]byte, authid [16]byte, data io.Reader) ([]byte, bool, int, error)

func SealVMessAEADHeader

func SealVMessAEADHeader(key [16]byte, data []byte) []byte

Types

type AuthIDDecoder

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

func NewAuthIDDecoder

func NewAuthIDDecoder(cmdKey []byte) *AuthIDDecoder

func (*AuthIDDecoder) Decode

func (aidd *AuthIDDecoder) Decode(data [16]byte) (int64, uint32, int32, []byte)

type AuthIDDecoderHolder

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

func NewAuthIDDecoderHolder

func NewAuthIDDecoderHolder() *AuthIDDecoderHolder

func (*AuthIDDecoderHolder) AddUser

func (a *AuthIDDecoderHolder) AddUser(key [16]byte, ticket interface{})

func (*AuthIDDecoderHolder) Match

func (a *AuthIDDecoderHolder) Match(authID [16]byte) (interface{}, error)

func (*AuthIDDecoderHolder) RemoveUser

func (a *AuthIDDecoderHolder) RemoveUser(key [16]byte)

type AuthIDDecoderItem

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

func NewAuthIDDecoderItem

func NewAuthIDDecoderItem(key [16]byte, ticket interface{}) *AuthIDDecoderItem

Jump to

Keyboard shortcuts

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