aead

package
v5.57.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 15 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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