udwCryptoEncryptV3

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const ErrMsgDecryptKey = "decrypt key error magic buf not match"

Variables

This section is empty.

Functions

func AesMessageV6Decrypt

func AesMessageV6Decrypt(req AesMessageV6Request) (errMsg string)

func AesMessageV6Encrypt

func AesMessageV6Encrypt(req AesMessageV6Request)

func DecryptV3

func DecryptV3(key *[32]byte, data []byte) (output []byte, err error)

func DecryptV3WithBase64

func DecryptV3WithBase64(key *[32]byte, s string) (output []byte, err error)

func EncryptV3

func EncryptV3(key *[32]byte, data []byte) (output []byte)

func EncryptV3WithBase64

func EncryptV3WithBase64(key *[32]byte, input []byte) (output string)

func Get32PskFromSlice32

func Get32PskFromSlice32(b []byte) *[32]byte

func Get32PskFromString

func Get32PskFromString(s string) *[32]byte

func GetAesBlockFrom32Psk

func GetAesBlockFrom32Psk(key *[32]byte) cipher.Block

func MustSymmetryConn

func MustSymmetryConn(conn io.ReadWriteCloser, key *[32]byte) (outConn io.ReadWriteCloser)

func MustSymmetryConnEncryptOnceWithBlock

func MustSymmetryConnEncryptOnceWithBlock(src []byte, block cipher.Block, bufW *udwBytes.BufWriter)

func NewSymmetryConnWithBlock

func NewSymmetryConnWithBlock(conn io.ReadWriteCloser, block cipher.Block) io.ReadWriteCloser

func PoolGetSymmetryConnWithBlock

func PoolGetSymmetryConnWithBlock(conn io.ReadWriteCloser, block cipher.Block) io.ReadWriteCloser

func PoolPutSymmetryConnAndClose

func PoolPutSymmetryConnAndClose(rwc io.ReadWriteCloser)

func XorBytes

func XorBytes(dst, a, b []byte) int

func XorWords

func XorWords(dst, a, b []byte)

Types

type AesMessageV6KeyObject

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

func NewAesMessageV6KeyObject

func NewAesMessageV6KeyObject(key *[32]byte) AesMessageV6KeyObject

type AesMessageV6Request

type AesMessageV6Request struct {
	KeyObject  AesMessageV6KeyObject
	Data       []byte
	OutputBufW *udwBytes.BufWriter
}

type EncryptV3Obj

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

func NewUdwEncryterV3NoAlloc

func NewUdwEncryterV3NoAlloc(key *[32]byte) *EncryptV3Obj

func NewUdwEncryterV3NoAllocV2

func NewUdwEncryterV3NoAllocV2(aesBlock cipher.Block) *EncryptV3Obj

func (*EncryptV3Obj) Clone

func (obj *EncryptV3Obj) Clone() *EncryptV3Obj

func (*EncryptV3Obj) DecryptWithBuf

func (obj *EncryptV3Obj) DecryptWithBuf(data []byte, buf []byte) (output []byte, err error)

func (*EncryptV3Obj) EncryptWithBuf

func (obj *EncryptV3Obj) EncryptWithBuf(data []byte, buf []byte) []byte

func (*EncryptV3Obj) GetAesBlock

func (obj *EncryptV3Obj) GetAesBlock() cipher.Block

Jump to

Keyboard shortcuts

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