msg

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgSignLen                = types.P2pSignatureLength + types.P2pAddressBech32Length + types.P2pPublicKeyLength
	ThresholdToHashBeforeSign = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageSign added in v0.10.0

type MessageSign struct {
	Signature  []byte
	P2pAddress string
	P2pPubKey  []byte
	Signer     Signer
}

MessageSign

func (*MessageSign) Decode added in v0.10.0

func (s *MessageSign) Decode(sign []byte) int

func (*MessageSign) Encode added in v0.10.0

func (s *MessageSign) Encode(sign []byte) int

func (*MessageSign) Sign added in v0.10.0

func (s *MessageSign) Sign(hb []byte) error

func (*MessageSign) Verify added in v0.10.0

func (s *MessageSign) Verify(hb []byte, remoteP2pAddr string) error

type RelayMsgBuf

type RelayMsgBuf struct {
	PacketId int64
	MSGHead  header.MessageHead
	MSGSign  MessageSign
	MSGBody  []byte
	MSGData  []byte

	Alloc *[]byte
}

RelayMsgBuf application layer internal buffer for msg,

func (*RelayMsgBuf) GetBytesAfterHeader added in v0.10.0

func (r *RelayMsgBuf) GetBytesAfterHeader() []byte

func (*RelayMsgBuf) GetHeader added in v0.10.0

func (r *RelayMsgBuf) GetHeader() []byte

func (*RelayMsgBuf) PutIntoBuffer added in v0.10.0

func (r *RelayMsgBuf) PutIntoBuffer(msg *RelayMsgBuf) int

type Signer added in v0.10.0

type Signer func([]byte) []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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