Documentation ¶
Overview ¶
Package message is used to create network messages for the purpose of confirming integrity and proof of work.
The main purpose of the message is the possibility of retransmission with verification by the network key.
MESSAGE FORMAT P(HM) || HM || M where HM = H(M) where P - proof of work H - hmac (auth-key) M - message bytes
Index ¶
Constants ¶
View Source
const ( CMessageHeadSize = 2*cSaltSize + symmetric.CAESBlockSize + hashing.CSHA256Size + 3*encoding.CSizeUint64 )
Variables ¶
View Source
var ( ErrUnknownType = errors.New("unknown type") ErrInvalidHeaderSize = errors.New("length of message bytes < size of header") ErrInvalidProofOfWork = errors.New("got invalid proof of work") ErrInvalidPayloadSize = errors.New("got invalid payload size") ErrInvalidAuthHash = errors.New("got invalid auth hash") ErrDecodePayload = errors.New("decode payload") )
Functions ¶
This section is empty.
Types ¶
type IMessage ¶
type IMessage interface { types.IConverter GetHash() []byte GetVoid() []byte GetSalt() [2][]byte GetProof() uint64 GetPayload() payload.IPayload }
func LoadMessage ¶
type ISettings ¶ added in v1.5.21
func NewSettings ¶ added in v1.5.21
Click to show internal directories.
Click to hide internal directories.