// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: protocol_message.proto package encryption import ( fmt "fmt" proto "github.com/golang/protobuf/proto" io "io" math "math" math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type SignedPreKey struct { SignedPreKey []byte `protobuf:"bytes,1,opt,name=signed_pre_key,json=signedPreKey,proto3" json:"signed_pre_key,omitempty"` Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` ProtocolVersion uint32 `protobuf:"varint,3,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SignedPreKey) Reset() { *m = SignedPreKey{} } func (m *SignedPreKey) String() string { return proto.CompactTextString(m) } func (*SignedPreKey) ProtoMessage() {} func (*SignedPreKey) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{0} } func (m *SignedPreKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SignedPreKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SignedPreKey.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *SignedPreKey) XXX_Merge(src proto.Message) { xxx_messageInfo_SignedPreKey.Merge(m, src) } func (m *SignedPreKey) XXX_Size() int { return m.Size() } func (m *SignedPreKey) XXX_DiscardUnknown() { xxx_messageInfo_SignedPreKey.DiscardUnknown(m) } var xxx_messageInfo_SignedPreKey proto.InternalMessageInfo func (m *SignedPreKey) GetSignedPreKey() []byte { if m != nil { return m.SignedPreKey } return nil } func (m *SignedPreKey) GetVersion() uint32 { if m != nil { return m.Version } return 0 } func (m *SignedPreKey) GetProtocolVersion() uint32 { if m != nil { return m.ProtocolVersion } return 0 } // X3DH prekey bundle type Bundle struct { // Identity key Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // Installation id SignedPreKeys map[string]*SignedPreKey `protobuf:"bytes,2,rep,name=signed_pre_keys,json=signedPreKeys,proto3" json:"signed_pre_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Prekey signature Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` // When the bundle was created locally Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Bundle) Reset() { *m = Bundle{} } func (m *Bundle) String() string { return proto.CompactTextString(m) } func (*Bundle) ProtoMessage() {} func (*Bundle) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{1} } func (m *Bundle) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Bundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bundle.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Bundle) XXX_Merge(src proto.Message) { xxx_messageInfo_Bundle.Merge(m, src) } func (m *Bundle) XXX_Size() int { return m.Size() } func (m *Bundle) XXX_DiscardUnknown() { xxx_messageInfo_Bundle.DiscardUnknown(m) } var xxx_messageInfo_Bundle proto.InternalMessageInfo func (m *Bundle) GetIdentity() []byte { if m != nil { return m.Identity } return nil } func (m *Bundle) GetSignedPreKeys() map[string]*SignedPreKey { if m != nil { return m.SignedPreKeys } return nil } func (m *Bundle) GetSignature() []byte { if m != nil { return m.Signature } return nil } func (m *Bundle) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } type BundleContainer struct { // X3DH prekey bundle Bundle *Bundle `protobuf:"bytes,1,opt,name=bundle,proto3" json:"bundle,omitempty"` // Private signed prekey PrivateSignedPreKey []byte `protobuf:"bytes,2,opt,name=private_signed_pre_key,json=privateSignedPreKey,proto3" json:"private_signed_pre_key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *BundleContainer) Reset() { *m = BundleContainer{} } func (m *BundleContainer) String() string { return proto.CompactTextString(m) } func (*BundleContainer) ProtoMessage() {} func (*BundleContainer) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{2} } func (m *BundleContainer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *BundleContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_BundleContainer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *BundleContainer) XXX_Merge(src proto.Message) { xxx_messageInfo_BundleContainer.Merge(m, src) } func (m *BundleContainer) XXX_Size() int { return m.Size() } func (m *BundleContainer) XXX_DiscardUnknown() { xxx_messageInfo_BundleContainer.DiscardUnknown(m) } var xxx_messageInfo_BundleContainer proto.InternalMessageInfo func (m *BundleContainer) GetBundle() *Bundle { if m != nil { return m.Bundle } return nil } func (m *BundleContainer) GetPrivateSignedPreKey() []byte { if m != nil { return m.PrivateSignedPreKey } return nil } type DRHeader struct { // Current ratchet public key Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Number of the message in the sending chain N uint32 `protobuf:"varint,2,opt,name=n,proto3" json:"n,omitempty"` // Length of the previous sending chain Pn uint32 `protobuf:"varint,3,opt,name=pn,proto3" json:"pn,omitempty"` // Bundle ID Id []byte `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DRHeader) Reset() { *m = DRHeader{} } func (m *DRHeader) String() string { return proto.CompactTextString(m) } func (*DRHeader) ProtoMessage() {} func (*DRHeader) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{3} } func (m *DRHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DRHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DRHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DRHeader) XXX_Merge(src proto.Message) { xxx_messageInfo_DRHeader.Merge(m, src) } func (m *DRHeader) XXX_Size() int { return m.Size() } func (m *DRHeader) XXX_DiscardUnknown() { xxx_messageInfo_DRHeader.DiscardUnknown(m) } var xxx_messageInfo_DRHeader proto.InternalMessageInfo func (m *DRHeader) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *DRHeader) GetN() uint32 { if m != nil { return m.N } return 0 } func (m *DRHeader) GetPn() uint32 { if m != nil { return m.Pn } return 0 } func (m *DRHeader) GetId() []byte { if m != nil { return m.Id } return nil } type DHHeader struct { // Compressed ephemeral public key Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DHHeader) Reset() { *m = DHHeader{} } func (m *DHHeader) String() string { return proto.CompactTextString(m) } func (*DHHeader) ProtoMessage() {} func (*DHHeader) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{4} } func (m *DHHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DHHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DHHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DHHeader) XXX_Merge(src proto.Message) { xxx_messageInfo_DHHeader.Merge(m, src) } func (m *DHHeader) XXX_Size() int { return m.Size() } func (m *DHHeader) XXX_DiscardUnknown() { xxx_messageInfo_DHHeader.DiscardUnknown(m) } var xxx_messageInfo_DHHeader proto.InternalMessageInfo func (m *DHHeader) GetKey() []byte { if m != nil { return m.Key } return nil } type X3DHHeader struct { // Ephemeral key used Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Used bundle's signed prekey Id []byte `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *X3DHHeader) Reset() { *m = X3DHHeader{} } func (m *X3DHHeader) String() string { return proto.CompactTextString(m) } func (*X3DHHeader) ProtoMessage() {} func (*X3DHHeader) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{5} } func (m *X3DHHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *X3DHHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_X3DHHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *X3DHHeader) XXX_Merge(src proto.Message) { xxx_messageInfo_X3DHHeader.Merge(m, src) } func (m *X3DHHeader) XXX_Size() int { return m.Size() } func (m *X3DHHeader) XXX_DiscardUnknown() { xxx_messageInfo_X3DHHeader.DiscardUnknown(m) } var xxx_messageInfo_X3DHHeader proto.InternalMessageInfo func (m *X3DHHeader) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *X3DHHeader) GetId() []byte { if m != nil { return m.Id } return nil } // Hash Ratchet Header type HRHeader struct { // community key ID KeyId uint32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` // Community message number for this key_id SeqNo uint32 `protobuf:"varint,2,opt,name=seq_no,json=seqNo,proto3" json:"seq_no,omitempty"` // Community ID GroupId string `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *HRHeader) Reset() { *m = HRHeader{} } func (m *HRHeader) String() string { return proto.CompactTextString(m) } func (*HRHeader) ProtoMessage() {} func (*HRHeader) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{6} } func (m *HRHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *HRHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_HRHeader.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *HRHeader) XXX_Merge(src proto.Message) { xxx_messageInfo_HRHeader.Merge(m, src) } func (m *HRHeader) XXX_Size() int { return m.Size() } func (m *HRHeader) XXX_DiscardUnknown() { xxx_messageInfo_HRHeader.DiscardUnknown(m) } var xxx_messageInfo_HRHeader proto.InternalMessageInfo func (m *HRHeader) GetKeyId() uint32 { if m != nil { return m.KeyId } return 0 } func (m *HRHeader) GetSeqNo() uint32 { if m != nil { return m.SeqNo } return 0 } func (m *HRHeader) GetGroupId() string { if m != nil { return m.GroupId } return "" } // Direct message value type EncryptedMessageProtocol struct { X3DHHeader *X3DHHeader `protobuf:"bytes,1,opt,name=X3DH_header,json=X3DHHeader,proto3" json:"X3DH_header,omitempty"` DRHeader *DRHeader `protobuf:"bytes,2,opt,name=DR_header,json=DRHeader,proto3" json:"DR_header,omitempty"` DHHeader *DHHeader `protobuf:"bytes,101,opt,name=DH_header,json=DHHeader,proto3" json:"DH_header,omitempty"` HRHeader *HRHeader `protobuf:"bytes,102,opt,name=HR_header,json=HRHeader,proto3" json:"HR_header,omitempty"` // Encrypted payload Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EncryptedMessageProtocol) Reset() { *m = EncryptedMessageProtocol{} } func (m *EncryptedMessageProtocol) String() string { return proto.CompactTextString(m) } func (*EncryptedMessageProtocol) ProtoMessage() {} func (*EncryptedMessageProtocol) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{7} } func (m *EncryptedMessageProtocol) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *EncryptedMessageProtocol) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EncryptedMessageProtocol.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *EncryptedMessageProtocol) XXX_Merge(src proto.Message) { xxx_messageInfo_EncryptedMessageProtocol.Merge(m, src) } func (m *EncryptedMessageProtocol) XXX_Size() int { return m.Size() } func (m *EncryptedMessageProtocol) XXX_DiscardUnknown() { xxx_messageInfo_EncryptedMessageProtocol.DiscardUnknown(m) } var xxx_messageInfo_EncryptedMessageProtocol proto.InternalMessageInfo func (m *EncryptedMessageProtocol) GetX3DHHeader() *X3DHHeader { if m != nil { return m.X3DHHeader } return nil } func (m *EncryptedMessageProtocol) GetDRHeader() *DRHeader { if m != nil { return m.DRHeader } return nil } func (m *EncryptedMessageProtocol) GetDHHeader() *DHHeader { if m != nil { return m.DHHeader } return nil } func (m *EncryptedMessageProtocol) GetHRHeader() *HRHeader { if m != nil { return m.HRHeader } return nil } func (m *EncryptedMessageProtocol) GetPayload() []byte { if m != nil { return m.Payload } return nil } // Top-level protocol message type ProtocolMessage struct { // The device id of the sender InstallationId string `protobuf:"bytes,2,opt,name=installation_id,json=installationId,proto3" json:"installation_id,omitempty"` // List of bundles Bundles []*Bundle `protobuf:"bytes,3,rep,name=bundles,proto3" json:"bundles,omitempty"` // One to one message, encrypted, indexed by installation_id // TODO map here is redundant in case of community messages EncryptedMessage map[string]*EncryptedMessageProtocol `protobuf:"bytes,101,rep,name=encrypted_message,json=encryptedMessage,proto3" json:"encrypted_message,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Public chats, not encrypted PublicMessage []byte `protobuf:"bytes,102,opt,name=public_message,json=publicMessage,proto3" json:"public_message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ProtocolMessage) Reset() { *m = ProtocolMessage{} } func (m *ProtocolMessage) String() string { return proto.CompactTextString(m) } func (*ProtocolMessage) ProtoMessage() {} func (*ProtocolMessage) Descriptor() ([]byte, []int) { return fileDescriptor_4e37b52004a72e16, []int{8} } func (m *ProtocolMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ProtocolMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ProtocolMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ProtocolMessage) XXX_Merge(src proto.Message) { xxx_messageInfo_ProtocolMessage.Merge(m, src) } func (m *ProtocolMessage) XXX_Size() int { return m.Size() } func (m *ProtocolMessage) XXX_DiscardUnknown() { xxx_messageInfo_ProtocolMessage.DiscardUnknown(m) } var xxx_messageInfo_ProtocolMessage proto.InternalMessageInfo func (m *ProtocolMessage) GetInstallationId() string { if m != nil { return m.InstallationId } return "" } func (m *ProtocolMessage) GetBundles() []*Bundle { if m != nil { return m.Bundles } return nil } func (m *ProtocolMessage) GetEncryptedMessage() map[string]*EncryptedMessageProtocol { if m != nil { return m.EncryptedMessage } return nil } func (m *ProtocolMessage) GetPublicMessage() []byte { if m != nil { return m.PublicMessage } return nil } func init() { proto.RegisterType((*SignedPreKey)(nil), "encryption.SignedPreKey") proto.RegisterType((*Bundle)(nil), "encryption.Bundle") proto.RegisterMapType((map[string]*SignedPreKey)(nil), "encryption.Bundle.SignedPreKeysEntry") proto.RegisterType((*BundleContainer)(nil), "encryption.BundleContainer") proto.RegisterType((*DRHeader)(nil), "encryption.DRHeader") proto.RegisterType((*DHHeader)(nil), "encryption.DHHeader") proto.RegisterType((*X3DHHeader)(nil), "encryption.X3DHHeader") proto.RegisterType((*HRHeader)(nil), "encryption.HRHeader") proto.RegisterType((*EncryptedMessageProtocol)(nil), "encryption.EncryptedMessageProtocol") proto.RegisterType((*ProtocolMessage)(nil), "encryption.ProtocolMessage") proto.RegisterMapType((map[string]*EncryptedMessageProtocol)(nil), "encryption.ProtocolMessage.EncryptedMessageEntry") } func init() { proto.RegisterFile("protocol_message.proto", fileDescriptor_4e37b52004a72e16) } var fileDescriptor_4e37b52004a72e16 = []byte{ // 668 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xdd, 0x4e, 0xdb, 0x4a, 0x10, 0x3e, 0xb6, 0xc9, 0x0f, 0x93, 0xdf, 0xb3, 0xe7, 0x80, 0x7c, 0x10, 0x8a, 0x22, 0x0b, 0x74, 0xd2, 0xaa, 0x32, 0x05, 0x2a, 0xb5, 0xe2, 0x92, 0x82, 0x14, 0xa8, 0xa8, 0xd0, 0x22, 0x55, 0x15, 0x17, 0xb5, 0x9c, 0x78, 0x08, 0x2b, 0x1c, 0xdb, 0x78, 0x1d, 0x54, 0xbf, 0x40, 0x6f, 0xfa, 0x02, 0x7d, 0xa4, 0x5e, 0xf6, 0xba, 0x57, 0x15, 0x7d, 0x91, 0xca, 0x6b, 0xaf, 0xb3, 0x84, 0x70, 0x97, 0xf9, 0x3c, 0x33, 0xdf, 0x7c, 0xdf, 0xec, 0x04, 0xd6, 0xa3, 0x38, 0x4c, 0xc2, 0x71, 0xe8, 0x3b, 0x53, 0xe4, 0xdc, 0x9d, 0xa0, 0x2d, 0x00, 0x02, 0x18, 0x8c, 0xe3, 0x34, 0x4a, 0x58, 0x18, 0x58, 0x29, 0x34, 0x2f, 0xd8, 0x24, 0x40, 0xef, 0x3c, 0xc6, 0x77, 0x98, 0x92, 0x2d, 0x68, 0x73, 0x11, 0x3b, 0x51, 0x8c, 0xce, 0x0d, 0xa6, 0xa6, 0xd6, 0xd7, 0x06, 0x4d, 0xda, 0xe4, 0x6a, 0x96, 0x09, 0xb5, 0x3b, 0x8c, 0x39, 0x0b, 0x03, 0x53, 0xef, 0x6b, 0x83, 0x16, 0x95, 0x21, 0x79, 0x06, 0xdd, 0x92, 0x55, 0xa6, 0x18, 0x22, 0xa5, 0x23, 0xf1, 0x0f, 0x39, 0x6c, 0x7d, 0xd5, 0xa1, 0x7a, 0x38, 0x0b, 0x3c, 0x1f, 0xc9, 0x06, 0xd4, 0x99, 0x87, 0x41, 0xc2, 0x12, 0xc9, 0x57, 0xc6, 0xe4, 0x0c, 0x3a, 0x0f, 0x27, 0xe2, 0xa6, 0xde, 0x37, 0x06, 0x8d, 0xbd, 0x6d, 0x7b, 0xae, 0xc3, 0xce, 0x1b, 0xd9, 0xaa, 0x16, 0x7e, 0x1c, 0x24, 0x71, 0x4a, 0x5b, 0xea, 0xe4, 0x9c, 0x6c, 0xc2, 0x6a, 0x06, 0xb8, 0xc9, 0x2c, 0x46, 0x73, 0x45, 0x70, 0xcd, 0x81, 0xec, 0x6b, 0xc2, 0xa6, 0xc8, 0x13, 0x77, 0x1a, 0x99, 0x95, 0xbe, 0x36, 0x30, 0xe8, 0x1c, 0xd8, 0xb8, 0x04, 0xf2, 0x98, 0x80, 0x74, 0xc1, 0x90, 0x3e, 0xad, 0xd2, 0xec, 0x27, 0xb1, 0xa1, 0x72, 0xe7, 0xfa, 0x33, 0x14, 0xe6, 0x34, 0xf6, 0x4c, 0x75, 0x50, 0xb5, 0x01, 0xcd, 0xd3, 0x0e, 0xf4, 0x37, 0x9a, 0xf5, 0x19, 0x3a, 0xb9, 0x86, 0xb7, 0x61, 0x90, 0xb8, 0x2c, 0xc0, 0x98, 0x3c, 0x87, 0xea, 0x48, 0x40, 0xa2, 0x77, 0x63, 0x8f, 0x3c, 0x16, 0x4c, 0x8b, 0x0c, 0xb2, 0x9f, 0x6d, 0x9b, 0xdd, 0xb9, 0x09, 0x3a, 0x0b, 0xfb, 0xd3, 0x85, 0xc6, 0x7f, 0x8a, 0xaf, 0x2a, 0xfd, 0xe9, 0x4a, 0xdd, 0xe8, 0xae, 0x58, 0xa7, 0x50, 0x3f, 0xa2, 0x43, 0x74, 0x3d, 0x8c, 0x55, 0x2d, 0xcd, 0x5c, 0x4b, 0x13, 0x34, 0xb9, 0x64, 0x2d, 0x20, 0x6d, 0xd0, 0x23, 0xb9, 0x50, 0x3d, 0x12, 0x31, 0xf3, 0x0a, 0x1b, 0x75, 0xe6, 0x59, 0x9b, 0x50, 0x3f, 0x1a, 0x3e, 0xd5, 0xcb, 0x7a, 0x05, 0xf0, 0x71, 0xff, 0xe9, 0xef, 0x8b, 0xdd, 0x8a, 0xf9, 0x2e, 0xa0, 0x3e, 0x94, 0xf3, 0xad, 0x41, 0xf5, 0x06, 0x53, 0x87, 0x79, 0xa2, 0xac, 0x45, 0x2b, 0x37, 0x98, 0x9e, 0x78, 0x19, 0xcc, 0xf1, 0xd6, 0x09, 0xc2, 0x62, 0xd2, 0x0a, 0xc7, 0xdb, 0xf7, 0x21, 0xf9, 0x0f, 0xea, 0x93, 0x38, 0x9c, 0x45, 0x59, 0xbe, 0x21, 0xd6, 0x53, 0x13, 0xf1, 0x89, 0x67, 0x7d, 0xd1, 0xc1, 0x3c, 0xce, 0xdd, 0x44, 0xef, 0x2c, 0x3f, 0x8f, 0xf3, 0xe2, 0x81, 0x92, 0xd7, 0xd0, 0xc8, 0xe6, 0x74, 0xae, 0x05, 0x69, 0xe1, 0xfe, 0xba, 0xea, 0xfe, 0x5c, 0x06, 0x55, 0x25, 0xed, 0xc2, 0xea, 0x11, 0x95, 0x65, 0xf9, 0xf2, 0xff, 0x55, 0xcb, 0xa4, 0xcf, 0x74, 0xee, 0x78, 0x56, 0x52, 0x32, 0xe1, 0x92, 0x92, 0x61, 0x59, 0xa2, 0xb0, 0x0c, 0x4b, 0x96, 0xab, 0xc7, 0x25, 0xc3, 0x92, 0xa5, 0xf4, 0xcd, 0x84, 0x5a, 0xe4, 0xa6, 0x7e, 0xe8, 0xe6, 0x46, 0x34, 0xa9, 0x0c, 0xad, 0x9f, 0x3a, 0x74, 0xa4, 0xf0, 0xc2, 0x07, 0xf2, 0x3f, 0x74, 0x58, 0xc0, 0x13, 0xd7, 0xf7, 0xdd, 0xac, 0x61, 0x66, 0x9f, 0x2e, 0xec, 0x6b, 0xab, 0xf0, 0x89, 0x47, 0x5e, 0x40, 0x2d, 0x7f, 0x7f, 0xdc, 0x34, 0xc4, 0x4d, 0x2e, 0x7b, 0xa2, 0x32, 0x85, 0x7c, 0x82, 0xbf, 0x51, 0x5a, 0x2e, 0xff, 0x92, 0x4c, 0x14, 0x75, 0xbb, 0x6a, 0xdd, 0xc2, 0x38, 0xf6, 0xe2, 0x9e, 0xf2, 0xbb, 0xee, 0xe2, 0x02, 0x4c, 0xb6, 0xa1, 0x1d, 0xcd, 0x46, 0x3e, 0x1b, 0x97, 0xcd, 0xaf, 0x84, 0xd6, 0x56, 0x8e, 0x16, 0x69, 0x1b, 0x0c, 0xd6, 0x96, 0x76, 0x5c, 0x72, 0xc8, 0x07, 0x0f, 0x0f, 0x79, 0x4b, 0x9d, 0xf2, 0xa9, 0xd7, 0xa3, 0x1c, 0xf5, 0xe1, 0xcb, 0xef, 0xf7, 0x3d, 0xed, 0xc7, 0x7d, 0x4f, 0xfb, 0x75, 0xdf, 0xd3, 0xbe, 0xfd, 0xee, 0xfd, 0x75, 0xd9, 0x9b, 0xb0, 0xe4, 0x7a, 0x36, 0xb2, 0xc7, 0xe1, 0x74, 0x47, 0xfe, 0x21, 0xee, 0xcc, 0xbb, 0x8e, 0xaa, 0x02, 0xdc, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xea, 0x62, 0x21, 0xec, 0xbc, 0x05, 0x00, 0x00, } func (m *SignedPreKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SignedPreKey) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SignedPreKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if m.ProtocolVersion != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.ProtocolVersion)) i-- dAtA[i] = 0x18 } if m.Version != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x10 } if len(m.SignedPreKey) > 0 { i -= len(m.SignedPreKey) copy(dAtA[i:], m.SignedPreKey) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.SignedPreKey))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Bundle) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Bundle) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Bundle) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if m.Timestamp != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x28 } if len(m.Signature) > 0 { i -= len(m.Signature) copy(dAtA[i:], m.Signature) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Signature))) i-- dAtA[i] = 0x22 } if len(m.SignedPreKeys) > 0 { for k := range m.SignedPreKeys { v := m.SignedPreKeys[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintProtocolMessage(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } } if len(m.Identity) > 0 { i -= len(m.Identity) copy(dAtA[i:], m.Identity) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Identity))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *BundleContainer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *BundleContainer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *BundleContainer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.PrivateSignedPreKey) > 0 { i -= len(m.PrivateSignedPreKey) copy(dAtA[i:], m.PrivateSignedPreKey) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.PrivateSignedPreKey))) i-- dAtA[i] = 0x12 } if m.Bundle != nil { { size, err := m.Bundle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DRHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DRHeader) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DRHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0x22 } if m.Pn != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.Pn)) i-- dAtA[i] = 0x18 } if m.N != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.N)) i-- dAtA[i] = 0x10 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DHHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DHHeader) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DHHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *X3DHHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *X3DHHeader) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *X3DHHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0x22 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *HRHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *HRHeader) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HRHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.GroupId) > 0 { i -= len(m.GroupId) copy(dAtA[i:], m.GroupId) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.GroupId))) i-- dAtA[i] = 0x1a } if m.SeqNo != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.SeqNo)) i-- dAtA[i] = 0x10 } if m.KeyId != 0 { i = encodeVarintProtocolMessage(dAtA, i, uint64(m.KeyId)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *EncryptedMessageProtocol) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *EncryptedMessageProtocol) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *EncryptedMessageProtocol) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if m.HRHeader != nil { { size, err := m.HRHeader.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x6 i-- dAtA[i] = 0xb2 } if m.DHHeader != nil { { size, err := m.DHHeader.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x6 i-- dAtA[i] = 0xaa } if len(m.Payload) > 0 { i -= len(m.Payload) copy(dAtA[i:], m.Payload) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.Payload))) i-- dAtA[i] = 0x1a } if m.DRHeader != nil { { size, err := m.DRHeader.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X3DHHeader != nil { { size, err := m.X3DHHeader.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ProtocolMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ProtocolMessage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ProtocolMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.PublicMessage) > 0 { i -= len(m.PublicMessage) copy(dAtA[i:], m.PublicMessage) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.PublicMessage))) i-- dAtA[i] = 0x6 i-- dAtA[i] = 0xb2 } if len(m.EncryptedMessage) > 0 { for k := range m.EncryptedMessage { v := m.EncryptedMessage[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintProtocolMessage(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x6 i-- dAtA[i] = 0xaa } } if len(m.Bundles) > 0 { for iNdEx := len(m.Bundles) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Bundles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintProtocolMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.InstallationId) > 0 { i -= len(m.InstallationId) copy(dAtA[i:], m.InstallationId) i = encodeVarintProtocolMessage(dAtA, i, uint64(len(m.InstallationId))) i-- dAtA[i] = 0x12 } return len(dAtA) - i, nil } func encodeVarintProtocolMessage(dAtA []byte, offset int, v uint64) int { offset -= sovProtocolMessage(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *SignedPreKey) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.SignedPreKey) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.Version != 0 { n += 1 + sovProtocolMessage(uint64(m.Version)) } if m.ProtocolVersion != 0 { n += 1 + sovProtocolMessage(uint64(m.ProtocolVersion)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Bundle) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Identity) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if len(m.SignedPreKeys) > 0 { for k, v := range m.SignedPreKeys { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovProtocolMessage(uint64(l)) } mapEntrySize := 1 + len(k) + sovProtocolMessage(uint64(len(k))) + l n += mapEntrySize + 1 + sovProtocolMessage(uint64(mapEntrySize)) } } l = len(m.Signature) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.Timestamp != 0 { n += 1 + sovProtocolMessage(uint64(m.Timestamp)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *BundleContainer) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Bundle != nil { l = m.Bundle.Size() n += 1 + l + sovProtocolMessage(uint64(l)) } l = len(m.PrivateSignedPreKey) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *DRHeader) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.N != 0 { n += 1 + sovProtocolMessage(uint64(m.N)) } if m.Pn != 0 { n += 1 + sovProtocolMessage(uint64(m.Pn)) } l = len(m.Id) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *DHHeader) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *X3DHHeader) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } l = len(m.Id) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *HRHeader) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.KeyId != 0 { n += 1 + sovProtocolMessage(uint64(m.KeyId)) } if m.SeqNo != 0 { n += 1 + sovProtocolMessage(uint64(m.SeqNo)) } l = len(m.GroupId) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *EncryptedMessageProtocol) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.X3DHHeader != nil { l = m.X3DHHeader.Size() n += 1 + l + sovProtocolMessage(uint64(l)) } if m.DRHeader != nil { l = m.DRHeader.Size() n += 1 + l + sovProtocolMessage(uint64(l)) } l = len(m.Payload) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if m.DHHeader != nil { l = m.DHHeader.Size() n += 2 + l + sovProtocolMessage(uint64(l)) } if m.HRHeader != nil { l = m.HRHeader.Size() n += 2 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ProtocolMessage) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.InstallationId) if l > 0 { n += 1 + l + sovProtocolMessage(uint64(l)) } if len(m.Bundles) > 0 { for _, e := range m.Bundles { l = e.Size() n += 1 + l + sovProtocolMessage(uint64(l)) } } if len(m.EncryptedMessage) > 0 { for k, v := range m.EncryptedMessage { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovProtocolMessage(uint64(l)) } mapEntrySize := 1 + len(k) + sovProtocolMessage(uint64(len(k))) + l n += mapEntrySize + 2 + sovProtocolMessage(uint64(mapEntrySize)) } } l = len(m.PublicMessage) if l > 0 { n += 2 + l + sovProtocolMessage(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovProtocolMessage(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozProtocolMessage(x uint64) (n int) { return sovProtocolMessage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *SignedPreKey) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SignedPreKey: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SignedPreKey: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SignedPreKey", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.SignedPreKey = append(m.SignedPreKey[:0], dAtA[iNdEx:postIndex]...) if m.SignedPreKey == nil { m.SignedPreKey = []byte{} } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Version |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType) } m.ProtocolVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ProtocolVersion |= uint32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Bundle) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Bundle: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Bundle: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Identity = append(m.Identity[:0], dAtA[iNdEx:postIndex]...) if m.Identity == nil { m.Identity = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SignedPreKeys", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.SignedPreKeys == nil { m.SignedPreKeys = make(map[string]*SignedPreKey) } var mapkey string var mapvalue *SignedPreKey for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthProtocolMessage } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthProtocolMessage } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthProtocolMessage } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthProtocolMessage } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &SignedPreKey{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.SignedPreKeys[mapkey] = mapvalue iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) if m.Signature == nil { m.Signature = []byte{} } iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *BundleContainer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: BundleContainer: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: BundleContainer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.Bundle == nil { m.Bundle = &Bundle{} } if err := m.Bundle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PrivateSignedPreKey", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.PrivateSignedPreKey = append(m.PrivateSignedPreKey[:0], dAtA[iNdEx:postIndex]...) if m.PrivateSignedPreKey == nil { m.PrivateSignedPreKey = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DRHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DRHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DRHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field N", wireType) } m.N = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.N |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Pn", wireType) } m.Pn = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Pn |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) if m.Id == nil { m.Id = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DHHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DHHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DHHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *X3DHHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: X3DHHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: X3DHHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) if m.Id == nil { m.Id = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *HRHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: HRHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HRHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field KeyId", wireType) } m.KeyId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.KeyId |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SeqNo", wireType) } m.SeqNo = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.SeqNo |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.GroupId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *EncryptedMessageProtocol) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: EncryptedMessageProtocol: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: EncryptedMessageProtocol: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field X3DHHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.X3DHHeader == nil { m.X3DHHeader = &X3DHHeader{} } if err := m.X3DHHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DRHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.DRHeader == nil { m.DRHeader = &DRHeader{} } if err := m.DRHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) if m.Payload == nil { m.Payload = []byte{} } iNdEx = postIndex case 101: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DHHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.DHHeader == nil { m.DHHeader = &DHHeader{} } if err := m.DHHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 102: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HRHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.HRHeader == nil { m.HRHeader = &HRHeader{} } if err := m.HRHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ProtocolMessage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ProtocolMessage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ProtocolMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InstallationId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.InstallationId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Bundles", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Bundles = append(m.Bundles, &Bundle{}) if err := m.Bundles[len(m.Bundles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 101: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EncryptedMessage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.EncryptedMessage == nil { m.EncryptedMessage = make(map[string]*EncryptedMessageProtocol) } var mapkey string var mapvalue *EncryptedMessageProtocol for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthProtocolMessage } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthProtocolMessage } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthProtocolMessage } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthProtocolMessage } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &EncryptedMessageProtocol{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.EncryptedMessage[mapkey] = mapvalue iNdEx = postIndex case 102: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicMessage", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProtocolMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthProtocolMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthProtocolMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.PublicMessage = append(m.PublicMessage[:0], dAtA[iNdEx:postIndex]...) if m.PublicMessage == nil { m.PublicMessage = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProtocolMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProtocolMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipProtocolMessage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtocolMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtocolMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowProtocolMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthProtocolMessage } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupProtocolMessage } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthProtocolMessage } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthProtocolMessage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProtocolMessage = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupProtocolMessage = fmt.Errorf("proto: unexpected end of group") )