ssr

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ObfsHMACSHA1Len = 10

Variables

View Source
var (
	ErrAuthSHA1v4CRC32Error                = errors.New("auth_sha1_v4 post decrypt data crc32 error")
	ErrAuthSHA1v4DataLengthError           = errors.New("auth_sha1_v4 post decrypt data length error")
	ErrAuthSHA1v4IncorrectChecksum         = errors.New("auth_sha1_v4 post decrypt incorrect checksum")
	ErrAuthAES128IncorrectHMAC             = errors.New("auth_aes128_* post decrypt incorrect hmac")
	ErrAuthAES128DataLengthError           = errors.New("auth_aes128_* post decrypt length mismatch")
	ErrAuthChainDataLengthError            = errors.New("auth_chain_* post decrypt length mismatch")
	ErrAuthChainIncorrectHMAC              = errors.New("auth_chain_* post decrypt incorrect hmac")
	ErrAuthAES128IncorrectChecksum         = errors.New("auth_aes128_* post decrypt incorrect checksum")
	ErrAuthAES128PosOutOfRange             = errors.New("auth_aes128_* post decrypt pos out of range")
	ErrTLS12TicketAuthTooShortData         = errors.New("tls1.2_ticket_auth too short data")
	ErrTLS12TicketAuthHMACError            = errors.New("tls1.2_ticket_auth hmac verifying failed")
	ErrTLS12TicketAuthIncorrectMagicNumber = errors.New("tls1.2_ticket_auth incorrect magic number")
)

Functions

func CalcAdler32

func CalcAdler32(input []byte) uint32

func CalcCRC32

func CalcCRC32(input []byte, length int) uint32

func HashSum

func HashSum(h crypto.Hash, d []byte) []byte

func Hmac

func Hmac(c crypto.Hash, key, data, buf []byte) []byte

func SetCRC32

func SetCRC32(buffer []byte, length int)

Types

type CHmac

type CHmac interface {
	hash.Hash
	ResetKey(key []byte)
	Hash() crypto.Hash
}

func NewHmac

func NewHmac(h crypto.Hash) CHmac

NewHmac returns a new HMAC hash using the given hash.Hash type and key. NewHmac functions like sha256.NewHmac from crypto/sha256 can be used as h. h must return a new Hash every time it is called. Note that unlike other hash implementations in the standard library, the returned Hash does not implement encoding.BinaryMarshaler or encoding.BinaryUnmarshaler.

type HMAC

type HMAC crypto.Hash

func (HMAC) HASH

func (h HMAC) HASH(b []byte) []byte

func (HMAC) HMAC

func (h HMAC) HMAC(key, data, buf []byte) []byte

type Info

type Info struct {
	Key    []byte
	IVSize int
}

type Shift128plusContext

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

func (*Shift128plusContext) InitFromBin

func (ctx *Shift128plusContext) InitFromBin(bin []byte)

func (*Shift128plusContext) InitFromBinDatalen

func (ctx *Shift128plusContext) InitFromBinDatalen(bin []byte, datalen int)

func (*Shift128plusContext) Next

func (ctx *Shift128plusContext) Next() uint64

Jump to

Keyboard shortcuts

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