pb

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthHandshake        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHandshake          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHandshake = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group")
)

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"`
}

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 (*Act1Message) Descriptor

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

func (*Act1Message) Equal

func (this *Act1Message) Equal(that interface{}) bool

func (*Act1Message) GetNonce

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

func (*Act1Message) GoString

func (this *Act1Message) GoString() string

func (*Act1Message) Marshal

func (m *Act1Message) Marshal() (dAtA []byte, err error)

func (*Act1Message) MarshalTo

func (m *Act1Message) MarshalTo(dAtA []byte) (int, error)

func (*Act1Message) MarshalToSizedBuffer

func (m *Act1Message) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Act1Message) ProtoMessage

func (*Act1Message) ProtoMessage()

func (*Act1Message) Reset

func (m *Act1Message) Reset()

func (*Act1Message) Size

func (m *Act1Message) Size() (n int)

func (*Act1Message) String

func (this *Act1Message) String() string

func (*Act1Message) Unmarshal

func (m *Act1Message) Unmarshal(dAtA []byte) error

func (*Act1Message) XXX_DiscardUnknown

func (m *Act1Message) XXX_DiscardUnknown()

func (*Act1Message) XXX_Marshal

func (m *Act1Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Act1Message) XXX_Merge

func (m *Act1Message) XXX_Merge(src proto.Message)

func (*Act1Message) XXX_Size

func (m *Act1Message) XXX_Size() int

func (*Act1Message) XXX_Unmarshal

func (m *Act1Message) XXX_Unmarshal(b []byte) error

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"`
}

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`.

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

func (*Act2Message) Descriptor

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

func (*Act2Message) Equal

func (this *Act2Message) Equal(that interface{}) bool

func (*Act2Message) GetChallenge

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

func (*Act2Message) GetNonce

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

func (*Act2Message) GoString

func (this *Act2Message) GoString() string

func (*Act2Message) Marshal

func (m *Act2Message) Marshal() (dAtA []byte, err error)

func (*Act2Message) MarshalTo

func (m *Act2Message) MarshalTo(dAtA []byte) (int, error)

func (*Act2Message) MarshalToSizedBuffer

func (m *Act2Message) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Act2Message) ProtoMessage

func (*Act2Message) ProtoMessage()

func (*Act2Message) Reset

func (m *Act2Message) Reset()

func (*Act2Message) Size

func (m *Act2Message) Size() (n int)

func (*Act2Message) String

func (this *Act2Message) String() string

func (*Act2Message) Unmarshal

func (m *Act2Message) Unmarshal(dAtA []byte) error

func (*Act2Message) XXX_DiscardUnknown

func (m *Act2Message) XXX_DiscardUnknown()

func (*Act2Message) XXX_Marshal

func (m *Act2Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Act2Message) XXX_Merge

func (m *Act2Message) XXX_Merge(src proto.Message)

func (*Act2Message) XXX_Size

func (m *Act2Message) XXX_Size() int

func (*Act2Message) XXX_Unmarshal

func (m *Act2Message) XXX_Unmarshal(b []byte) error

type Act3Message

type Act3Message struct {
	// bytes of sha256(nonce1||nonce2)
	Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
}

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

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

func (*Act3Message) Equal

func (this *Act3Message) Equal(that interface{}) bool

func (*Act3Message) GetChallenge

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

func (*Act3Message) GoString

func (this *Act3Message) GoString() string

func (*Act3Message) Marshal

func (m *Act3Message) Marshal() (dAtA []byte, err error)

func (*Act3Message) MarshalTo

func (m *Act3Message) MarshalTo(dAtA []byte) (int, error)

func (*Act3Message) MarshalToSizedBuffer

func (m *Act3Message) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Act3Message) ProtoMessage

func (*Act3Message) ProtoMessage()

func (*Act3Message) Reset

func (m *Act3Message) Reset()

func (*Act3Message) Size

func (m *Act3Message) Size() (n int)

func (*Act3Message) String

func (this *Act3Message) String() string

func (*Act3Message) Unmarshal

func (m *Act3Message) Unmarshal(dAtA []byte) error

func (*Act3Message) XXX_DiscardUnknown

func (m *Act3Message) XXX_DiscardUnknown()

func (*Act3Message) XXX_Marshal

func (m *Act3Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Act3Message) XXX_Merge

func (m *Act3Message) XXX_Merge(src proto.Message)

func (*Act3Message) XXX_Size

func (m *Act3Message) XXX_Size() int

func (*Act3Message) XXX_Unmarshal

func (m *Act3Message) XXX_Unmarshal(b []byte) error

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"`
}

BroadcastNetworkMessage represents a network message used by broadcast channels.

func (*BroadcastNetworkMessage) Descriptor

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

func (*BroadcastNetworkMessage) Equal

func (this *BroadcastNetworkMessage) Equal(that interface{}) bool

func (*BroadcastNetworkMessage) GetPayload

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

func (*BroadcastNetworkMessage) GetSender

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

func (*BroadcastNetworkMessage) GetSequenceNumber

func (m *BroadcastNetworkMessage) GetSequenceNumber() uint64

func (*BroadcastNetworkMessage) GetType

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

func (*BroadcastNetworkMessage) GoString

func (this *BroadcastNetworkMessage) GoString() string

func (*BroadcastNetworkMessage) Marshal

func (m *BroadcastNetworkMessage) Marshal() (dAtA []byte, err error)

func (*BroadcastNetworkMessage) MarshalTo

func (m *BroadcastNetworkMessage) MarshalTo(dAtA []byte) (int, error)

func (*BroadcastNetworkMessage) MarshalToSizedBuffer

func (m *BroadcastNetworkMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BroadcastNetworkMessage) ProtoMessage

func (*BroadcastNetworkMessage) ProtoMessage()

func (*BroadcastNetworkMessage) Reset

func (m *BroadcastNetworkMessage) Reset()

func (*BroadcastNetworkMessage) Size

func (m *BroadcastNetworkMessage) Size() (n int)

func (*BroadcastNetworkMessage) String

func (this *BroadcastNetworkMessage) String() string

func (*BroadcastNetworkMessage) Unmarshal

func (m *BroadcastNetworkMessage) Unmarshal(dAtA []byte) error

func (*BroadcastNetworkMessage) XXX_DiscardUnknown

func (m *BroadcastNetworkMessage) XXX_DiscardUnknown()

func (*BroadcastNetworkMessage) XXX_Marshal

func (m *BroadcastNetworkMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BroadcastNetworkMessage) XXX_Merge

func (m *BroadcastNetworkMessage) XXX_Merge(src proto.Message)

func (*BroadcastNetworkMessage) XXX_Size

func (m *BroadcastNetworkMessage) XXX_Size() int

func (*BroadcastNetworkMessage) XXX_Unmarshal

func (m *BroadcastNetworkMessage) XXX_Unmarshal(b []byte) error

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"`
}

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

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

func (*HandshakeEnvelope) Equal

func (this *HandshakeEnvelope) Equal(that interface{}) bool

func (*HandshakeEnvelope) GetMessage

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

func (*HandshakeEnvelope) GetPeerID

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

func (*HandshakeEnvelope) GetSignature

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

func (*HandshakeEnvelope) GoString

func (this *HandshakeEnvelope) GoString() string

func (*HandshakeEnvelope) Marshal

func (m *HandshakeEnvelope) Marshal() (dAtA []byte, err error)

func (*HandshakeEnvelope) MarshalTo

func (m *HandshakeEnvelope) MarshalTo(dAtA []byte) (int, error)

func (*HandshakeEnvelope) MarshalToSizedBuffer

func (m *HandshakeEnvelope) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HandshakeEnvelope) ProtoMessage

func (*HandshakeEnvelope) ProtoMessage()

func (*HandshakeEnvelope) Reset

func (m *HandshakeEnvelope) Reset()

func (*HandshakeEnvelope) Size

func (m *HandshakeEnvelope) Size() (n int)

func (*HandshakeEnvelope) String

func (this *HandshakeEnvelope) String() string

func (*HandshakeEnvelope) Unmarshal

func (m *HandshakeEnvelope) Unmarshal(dAtA []byte) error

func (*HandshakeEnvelope) XXX_DiscardUnknown

func (m *HandshakeEnvelope) XXX_DiscardUnknown()

func (*HandshakeEnvelope) XXX_Marshal

func (m *HandshakeEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HandshakeEnvelope) XXX_Merge

func (m *HandshakeEnvelope) XXX_Merge(src proto.Message)

func (*HandshakeEnvelope) XXX_Size

func (m *HandshakeEnvelope) XXX_Size() int

func (*HandshakeEnvelope) XXX_Unmarshal

func (m *HandshakeEnvelope) XXX_Unmarshal(b []byte) error

type Identity

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

func (*Identity) Descriptor

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

func (*Identity) Equal

func (this *Identity) Equal(that interface{}) bool

func (*Identity) GetPubKey

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

func (*Identity) GoString

func (this *Identity) GoString() string

func (*Identity) Marshal

func (m *Identity) Marshal() (dAtA []byte, err error)

func (*Identity) MarshalTo

func (m *Identity) MarshalTo(dAtA []byte) (int, error)

func (*Identity) MarshalToSizedBuffer

func (m *Identity) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) Reset

func (m *Identity) Reset()

func (*Identity) Size

func (m *Identity) Size() (n int)

func (*Identity) String

func (this *Identity) String() string

func (*Identity) Unmarshal

func (m *Identity) Unmarshal(dAtA []byte) error

func (*Identity) XXX_DiscardUnknown

func (m *Identity) XXX_DiscardUnknown()

func (*Identity) XXX_Marshal

func (m *Identity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Identity) XXX_Merge

func (m *Identity) XXX_Merge(src proto.Message)

func (*Identity) XXX_Size

func (m *Identity) XXX_Size() int

func (*Identity) XXX_Unmarshal

func (m *Identity) XXX_Unmarshal(b []byte) error

type UnicastNetworkMessage

type UnicastNetworkMessage 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"`
	// Message signature.
	Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
}

UnicastNetworkMessage represents a network message used by unicast channels.

func (*UnicastNetworkMessage) Descriptor

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

func (*UnicastNetworkMessage) Equal

func (this *UnicastNetworkMessage) Equal(that interface{}) bool

func (*UnicastNetworkMessage) GetPayload

func (m *UnicastNetworkMessage) GetPayload() []byte

func (*UnicastNetworkMessage) GetSender

func (m *UnicastNetworkMessage) GetSender() []byte

func (*UnicastNetworkMessage) GetSignature

func (m *UnicastNetworkMessage) GetSignature() []byte

func (*UnicastNetworkMessage) GetType

func (m *UnicastNetworkMessage) GetType() []byte

func (*UnicastNetworkMessage) GoString

func (this *UnicastNetworkMessage) GoString() string

func (*UnicastNetworkMessage) Marshal

func (m *UnicastNetworkMessage) Marshal() (dAtA []byte, err error)

func (*UnicastNetworkMessage) MarshalTo

func (m *UnicastNetworkMessage) MarshalTo(dAtA []byte) (int, error)

func (*UnicastNetworkMessage) MarshalToSizedBuffer

func (m *UnicastNetworkMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UnicastNetworkMessage) ProtoMessage

func (*UnicastNetworkMessage) ProtoMessage()

func (*UnicastNetworkMessage) Reset

func (m *UnicastNetworkMessage) Reset()

func (*UnicastNetworkMessage) Size

func (m *UnicastNetworkMessage) Size() (n int)

func (*UnicastNetworkMessage) String

func (this *UnicastNetworkMessage) String() string

func (*UnicastNetworkMessage) Unmarshal

func (m *UnicastNetworkMessage) Unmarshal(dAtA []byte) error

func (*UnicastNetworkMessage) XXX_DiscardUnknown

func (m *UnicastNetworkMessage) XXX_DiscardUnknown()

func (*UnicastNetworkMessage) XXX_Marshal

func (m *UnicastNetworkMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnicastNetworkMessage) XXX_Merge

func (m *UnicastNetworkMessage) XXX_Merge(src proto.Message)

func (*UnicastNetworkMessage) XXX_Size

func (m *UnicastNetworkMessage) XXX_Size() int

func (*UnicastNetworkMessage) XXX_Unmarshal

func (m *UnicastNetworkMessage) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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