crypto

package
v0.0.0-...-d361f56 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionKey

type SessionKey struct {
	CryptKey    []byte
	ChecksumKey []byte
	HmacKey     []byte
}

func DecodeSessionKey

func DecodeSessionKey(inputKey []byte) (SessionKey, error)

Decodes a byte array to a SessionKey object.

func ParseSessionKey

func ParseSessionKey(inputKey string) (SessionKey, error)

Decodes a Base64-encoded string to a SessionKey object.

func (SessionKey) Cipher

func (sk SessionKey) Cipher(input []byte, seq uint16) ([]byte, error)

Performs the cipher operation for a packet body.

func (SessionKey) GenerateChecksum

func (sk SessionKey) GenerateChecksum(input []byte) (uint32, error)

Generates a 32-bit checksum for a packet body.

func (SessionKey) GenerateIv

func (sk SessionKey) GenerateIv(seq uint16) ([]byte, error)

Generates a 16 byte initialization vector based on a sequence number.

Jump to

Keyboard shortcuts

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