pb

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 4 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_net_gen_pb_handshake_proto protoreflect.FileDescriptor
View Source
var File_pkg_net_gen_pb_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Act1Message

type Act1Message struct {

	// nonce by initiator; 8-byte (64-bit) nonce as bytes
	Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// the identifier of the protocol the initiator is executing
	Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

Act1Message is sent in the first handshake act by the initiator to the responder. It contains randomly generated `nonce1`, an 8-byte (64-bit) unsigned integer, and the protocol identifier.

Act1Message should be signed with initiator's static private key.

func (*Act1Message) Descriptor deprecated

func (*Act1Message) Descriptor() ([]byte, []int)

Deprecated: Use Act1Message.ProtoReflect.Descriptor instead.

func (*Act1Message) GetNonce

func (x *Act1Message) GetNonce() []byte

func (*Act1Message) GetProtocol added in v1.2.0

func (x *Act1Message) GetProtocol() string

func (*Act1Message) ProtoMessage

func (*Act1Message) ProtoMessage()

func (*Act1Message) ProtoReflect added in v1.21.0

func (x *Act1Message) ProtoReflect() protoreflect.Message

func (*Act1Message) Reset

func (x *Act1Message) Reset()

func (*Act1Message) String

func (x *Act1Message) String() string

type Act2Message

type Act2Message struct {

	// nonce from responder; 8-byte (64-bit) nonce as bytes
	Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// bytes of sha256(nonce1||nonce2)
	Challenge []byte `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"`
	// the identifier of the protocol the responder is executing
	Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

Act2Message is sent in the second handshake act by the responder to the initiator. It contains randomly generated `nonce2`, an 8-byte unsigned integer and `challenge` which is a result of SHA256 on the concatenated bytes of `nonce1` and `nonce2`, and the protocol identifier.

Act2Message should be signed with responder's static private key.

func (*Act2Message) Descriptor deprecated

func (*Act2Message) Descriptor() ([]byte, []int)

Deprecated: Use Act2Message.ProtoReflect.Descriptor instead.

func (*Act2Message) GetChallenge

func (x *Act2Message) GetChallenge() []byte

func (*Act2Message) GetNonce

func (x *Act2Message) GetNonce() []byte

func (*Act2Message) GetProtocol added in v1.2.0

func (x *Act2Message) GetProtocol() string

func (*Act2Message) ProtoMessage

func (*Act2Message) ProtoMessage()

func (*Act2Message) ProtoReflect added in v1.21.0

func (x *Act2Message) ProtoReflect() protoreflect.Message

func (*Act2Message) Reset

func (x *Act2Message) Reset()

func (*Act2Message) String

func (x *Act2Message) String() string

type Act3Message

type Act3Message struct {

	// bytes of sha256(nonce1||nonce2)
	Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
	// contains filtered or unexported fields
}

Act1Message is sent in the first handshake act by the initiator to the responder. It contains randomly generated `nonce1`, an 8-byte (64-bit) unsigned integer.

Act1Message should be signed with initiator's static private key.

func (*Act3Message) Descriptor deprecated

func (*Act3Message) Descriptor() ([]byte, []int)

Deprecated: Use Act3Message.ProtoReflect.Descriptor instead.

func (*Act3Message) GetChallenge

func (x *Act3Message) GetChallenge() []byte

func (*Act3Message) ProtoMessage

func (*Act3Message) ProtoMessage()

func (*Act3Message) ProtoReflect added in v1.21.0

func (x *Act3Message) ProtoReflect() protoreflect.Message

func (*Act3Message) Reset

func (x *Act3Message) Reset()

func (*Act3Message) String

func (x *Act3Message) String() string

type BroadcastNetworkMessage

type BroadcastNetworkMessage struct {

	// The PublicKey of the sender.
	Sender []byte `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// A marshaled Protocol Message.
	Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// Type of the message as registered by the protocol.
	Type []byte `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Sequence number of the message. Retransmissions have the same sequence
	// number as the original message.
	SequenceNumber uint64 `protobuf:"varint,4,opt,name=sequenceNumber,proto3" json:"sequenceNumber,omitempty"`
	// contains filtered or unexported fields
}

BroadcastNetworkMessage represents a network message used by broadcast channels.

func (*BroadcastNetworkMessage) Descriptor deprecated

func (*BroadcastNetworkMessage) Descriptor() ([]byte, []int)

Deprecated: Use BroadcastNetworkMessage.ProtoReflect.Descriptor instead.

func (*BroadcastNetworkMessage) GetPayload

func (x *BroadcastNetworkMessage) GetPayload() []byte

func (*BroadcastNetworkMessage) GetSender

func (x *BroadcastNetworkMessage) GetSender() []byte

func (*BroadcastNetworkMessage) GetSequenceNumber

func (x *BroadcastNetworkMessage) GetSequenceNumber() uint64

func (*BroadcastNetworkMessage) GetType

func (x *BroadcastNetworkMessage) GetType() []byte

func (*BroadcastNetworkMessage) ProtoMessage

func (*BroadcastNetworkMessage) ProtoMessage()

func (*BroadcastNetworkMessage) ProtoReflect added in v1.21.0

func (x *BroadcastNetworkMessage) ProtoReflect() protoreflect.Message

func (*BroadcastNetworkMessage) Reset

func (x *BroadcastNetworkMessage) Reset()

func (*BroadcastNetworkMessage) String

func (x *BroadcastNetworkMessage) String() string

type HandshakeEnvelope

type HandshakeEnvelope struct {

	// The marshalled message.
	Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// Signature of the message.
	Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// Peer id of the message creator
	PeerID []byte `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"`
	// contains filtered or unexported fields
}

Envelope contains a marshalled message, as well as a signature over the the contents of the message (to ensure an adversary hasn't tampered with the contents).

func (*HandshakeEnvelope) Descriptor deprecated

func (*HandshakeEnvelope) Descriptor() ([]byte, []int)

Deprecated: Use HandshakeEnvelope.ProtoReflect.Descriptor instead.

func (*HandshakeEnvelope) GetMessage

func (x *HandshakeEnvelope) GetMessage() []byte

func (*HandshakeEnvelope) GetPeerID

func (x *HandshakeEnvelope) GetPeerID() []byte

func (*HandshakeEnvelope) GetSignature

func (x *HandshakeEnvelope) GetSignature() []byte

func (*HandshakeEnvelope) ProtoMessage

func (*HandshakeEnvelope) ProtoMessage()

func (*HandshakeEnvelope) ProtoReflect added in v1.21.0

func (x *HandshakeEnvelope) ProtoReflect() protoreflect.Message

func (*HandshakeEnvelope) Reset

func (x *HandshakeEnvelope) Reset()

func (*HandshakeEnvelope) String

func (x *HandshakeEnvelope) String() string

type Identity

type Identity struct {
	PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
	// contains filtered or unexported fields
}

func (*Identity) Descriptor deprecated

func (*Identity) Descriptor() ([]byte, []int)

Deprecated: Use Identity.ProtoReflect.Descriptor instead.

func (*Identity) GetPubKey

func (x *Identity) GetPubKey() []byte

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) ProtoReflect added in v1.21.0

func (x *Identity) ProtoReflect() protoreflect.Message

func (*Identity) Reset

func (x *Identity) Reset()

func (*Identity) String

func (x *Identity) String() string

Jump to

Keyboard shortcuts

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