github.com/cosmos/cosmos-sdk@v0.50.1/crypto/keys/secp256k1/keys.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cosmos/crypto/secp256k1/keys.proto
     3  
     4  package secp256k1
     5  
     6  import (
     7  	fmt "fmt"
     8  	_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
     9  	_ "github.com/cosmos/gogoproto/gogoproto"
    10  	proto "github.com/cosmos/gogoproto/proto"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  // PubKey defines a secp256k1 public key
    28  // Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
    29  // if the y-coordinate is the lexicographically largest of the two associated with
    30  // the x-coordinate. Otherwise the first byte is a 0x03.
    31  // This prefix is followed with the x-coordinate.
    32  type PubKey struct {
    33  	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
    34  }
    35  
    36  func (m *PubKey) Reset()      { *m = PubKey{} }
    37  func (*PubKey) ProtoMessage() {}
    38  func (*PubKey) Descriptor() ([]byte, []int) {
    39  	return fileDescriptor_e0835e68ebdcb224, []int{0}
    40  }
    41  func (m *PubKey) XXX_Unmarshal(b []byte) error {
    42  	return m.Unmarshal(b)
    43  }
    44  func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    45  	if deterministic {
    46  		return xxx_messageInfo_PubKey.Marshal(b, m, deterministic)
    47  	} else {
    48  		b = b[:cap(b)]
    49  		n, err := m.MarshalToSizedBuffer(b)
    50  		if err != nil {
    51  			return nil, err
    52  		}
    53  		return b[:n], nil
    54  	}
    55  }
    56  func (m *PubKey) XXX_Merge(src proto.Message) {
    57  	xxx_messageInfo_PubKey.Merge(m, src)
    58  }
    59  func (m *PubKey) XXX_Size() int {
    60  	return m.Size()
    61  }
    62  func (m *PubKey) XXX_DiscardUnknown() {
    63  	xxx_messageInfo_PubKey.DiscardUnknown(m)
    64  }
    65  
    66  var xxx_messageInfo_PubKey proto.InternalMessageInfo
    67  
    68  func (m *PubKey) GetKey() []byte {
    69  	if m != nil {
    70  		return m.Key
    71  	}
    72  	return nil
    73  }
    74  
    75  // PrivKey defines a secp256k1 private key.
    76  type PrivKey struct {
    77  	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
    78  }
    79  
    80  func (m *PrivKey) Reset()         { *m = PrivKey{} }
    81  func (m *PrivKey) String() string { return proto.CompactTextString(m) }
    82  func (*PrivKey) ProtoMessage()    {}
    83  func (*PrivKey) Descriptor() ([]byte, []int) {
    84  	return fileDescriptor_e0835e68ebdcb224, []int{1}
    85  }
    86  func (m *PrivKey) XXX_Unmarshal(b []byte) error {
    87  	return m.Unmarshal(b)
    88  }
    89  func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    90  	if deterministic {
    91  		return xxx_messageInfo_PrivKey.Marshal(b, m, deterministic)
    92  	} else {
    93  		b = b[:cap(b)]
    94  		n, err := m.MarshalToSizedBuffer(b)
    95  		if err != nil {
    96  			return nil, err
    97  		}
    98  		return b[:n], nil
    99  	}
   100  }
   101  func (m *PrivKey) XXX_Merge(src proto.Message) {
   102  	xxx_messageInfo_PrivKey.Merge(m, src)
   103  }
   104  func (m *PrivKey) XXX_Size() int {
   105  	return m.Size()
   106  }
   107  func (m *PrivKey) XXX_DiscardUnknown() {
   108  	xxx_messageInfo_PrivKey.DiscardUnknown(m)
   109  }
   110  
   111  var xxx_messageInfo_PrivKey proto.InternalMessageInfo
   112  
   113  func (m *PrivKey) GetKey() []byte {
   114  	if m != nil {
   115  		return m.Key
   116  	}
   117  	return nil
   118  }
   119  
   120  func init() {
   121  	proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256k1.PubKey")
   122  	proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256k1.PrivKey")
   123  }
   124  
   125  func init() {
   126  	proto.RegisterFile("cosmos/crypto/secp256k1/keys.proto", fileDescriptor_e0835e68ebdcb224)
   127  }
   128  
   129  var fileDescriptor_e0835e68ebdcb224 = []byte{
   130  	// 244 bytes of a gzipped FileDescriptorProto
   131  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce,
   132  	0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32,
   133  	0x35, 0xcb, 0x36, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12,
   134  	0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7,
   135  	0x07, 0x93, 0x10, 0xb5, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11,
   136  	0x55, 0xf2, 0xe5, 0x62, 0x0b, 0x28, 0x4d, 0xf2, 0x4e, 0xad, 0x14, 0x12, 0xe0, 0x62, 0xce, 0x4e,
   137  	0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0x31, 0xad, 0x0c, 0x67, 0x2c, 0x90, 0x67,
   138  	0xe8, 0x7a, 0xbe, 0x41, 0x4b, 0xaa, 0x24, 0x35, 0x2f, 0x25, 0xb5, 0x28, 0x37, 0x33, 0xaf, 0x44,
   139  	0x1f, 0xa2, 0x3a, 0x18, 0x66, 0xd3, 0xa4, 0xe7, 0x1b, 0xb4, 0x38, 0xb3, 0x53, 0x2b, 0xe3, 0xd3,
   140  	0x32, 0x53, 0x73, 0x52, 0x94, 0xbc, 0xb9, 0xd8, 0x03, 0x8a, 0x32, 0xcb, 0xb0, 0x9b, 0xa7, 0x07,
   141  	0x32, 0x4b, 0x1a, 0xd9, 0x2c, 0x88, 0x52, 0x1c, 0x86, 0x39, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78,
   142  	0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7,
   143  	0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e,
   144  	0xae, 0x3e, 0x2c, 0x98, 0xc0, 0x94, 0x6e, 0x71, 0x4a, 0x36, 0x2c, 0xc4, 0x40, 0xe1, 0x84, 0x08,
   145  	0xb6, 0x24, 0x36, 0xb0, 0x87, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0x42, 0xbc, 0x00,
   146  	0x58, 0x01, 0x00, 0x00,
   147  }
   148  
   149  func (m *PubKey) Marshal() (dAtA []byte, err error) {
   150  	size := m.Size()
   151  	dAtA = make([]byte, size)
   152  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   153  	if err != nil {
   154  		return nil, err
   155  	}
   156  	return dAtA[:n], nil
   157  }
   158  
   159  func (m *PubKey) MarshalTo(dAtA []byte) (int, error) {
   160  	size := m.Size()
   161  	return m.MarshalToSizedBuffer(dAtA[:size])
   162  }
   163  
   164  func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   165  	i := len(dAtA)
   166  	_ = i
   167  	var l int
   168  	_ = l
   169  	if len(m.Key) > 0 {
   170  		i -= len(m.Key)
   171  		copy(dAtA[i:], m.Key)
   172  		i = encodeVarintKeys(dAtA, i, uint64(len(m.Key)))
   173  		i--
   174  		dAtA[i] = 0xa
   175  	}
   176  	return len(dAtA) - i, nil
   177  }
   178  
   179  func (m *PrivKey) Marshal() (dAtA []byte, err error) {
   180  	size := m.Size()
   181  	dAtA = make([]byte, size)
   182  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   183  	if err != nil {
   184  		return nil, err
   185  	}
   186  	return dAtA[:n], nil
   187  }
   188  
   189  func (m *PrivKey) MarshalTo(dAtA []byte) (int, error) {
   190  	size := m.Size()
   191  	return m.MarshalToSizedBuffer(dAtA[:size])
   192  }
   193  
   194  func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   195  	i := len(dAtA)
   196  	_ = i
   197  	var l int
   198  	_ = l
   199  	if len(m.Key) > 0 {
   200  		i -= len(m.Key)
   201  		copy(dAtA[i:], m.Key)
   202  		i = encodeVarintKeys(dAtA, i, uint64(len(m.Key)))
   203  		i--
   204  		dAtA[i] = 0xa
   205  	}
   206  	return len(dAtA) - i, nil
   207  }
   208  
   209  func encodeVarintKeys(dAtA []byte, offset int, v uint64) int {
   210  	offset -= sovKeys(v)
   211  	base := offset
   212  	for v >= 1<<7 {
   213  		dAtA[offset] = uint8(v&0x7f | 0x80)
   214  		v >>= 7
   215  		offset++
   216  	}
   217  	dAtA[offset] = uint8(v)
   218  	return base
   219  }
   220  func (m *PubKey) Size() (n int) {
   221  	if m == nil {
   222  		return 0
   223  	}
   224  	var l int
   225  	_ = l
   226  	l = len(m.Key)
   227  	if l > 0 {
   228  		n += 1 + l + sovKeys(uint64(l))
   229  	}
   230  	return n
   231  }
   232  
   233  func (m *PrivKey) Size() (n int) {
   234  	if m == nil {
   235  		return 0
   236  	}
   237  	var l int
   238  	_ = l
   239  	l = len(m.Key)
   240  	if l > 0 {
   241  		n += 1 + l + sovKeys(uint64(l))
   242  	}
   243  	return n
   244  }
   245  
   246  func sovKeys(x uint64) (n int) {
   247  	return (math_bits.Len64(x|1) + 6) / 7
   248  }
   249  func sozKeys(x uint64) (n int) {
   250  	return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   251  }
   252  func (m *PubKey) Unmarshal(dAtA []byte) error {
   253  	l := len(dAtA)
   254  	iNdEx := 0
   255  	for iNdEx < l {
   256  		preIndex := iNdEx
   257  		var wire uint64
   258  		for shift := uint(0); ; shift += 7 {
   259  			if shift >= 64 {
   260  				return ErrIntOverflowKeys
   261  			}
   262  			if iNdEx >= l {
   263  				return io.ErrUnexpectedEOF
   264  			}
   265  			b := dAtA[iNdEx]
   266  			iNdEx++
   267  			wire |= uint64(b&0x7F) << shift
   268  			if b < 0x80 {
   269  				break
   270  			}
   271  		}
   272  		fieldNum := int32(wire >> 3)
   273  		wireType := int(wire & 0x7)
   274  		if wireType == 4 {
   275  			return fmt.Errorf("proto: PubKey: wiretype end group for non-group")
   276  		}
   277  		if fieldNum <= 0 {
   278  			return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire)
   279  		}
   280  		switch fieldNum {
   281  		case 1:
   282  			if wireType != 2 {
   283  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   284  			}
   285  			var byteLen int
   286  			for shift := uint(0); ; shift += 7 {
   287  				if shift >= 64 {
   288  					return ErrIntOverflowKeys
   289  				}
   290  				if iNdEx >= l {
   291  					return io.ErrUnexpectedEOF
   292  				}
   293  				b := dAtA[iNdEx]
   294  				iNdEx++
   295  				byteLen |= int(b&0x7F) << shift
   296  				if b < 0x80 {
   297  					break
   298  				}
   299  			}
   300  			if byteLen < 0 {
   301  				return ErrInvalidLengthKeys
   302  			}
   303  			postIndex := iNdEx + byteLen
   304  			if postIndex < 0 {
   305  				return ErrInvalidLengthKeys
   306  			}
   307  			if postIndex > l {
   308  				return io.ErrUnexpectedEOF
   309  			}
   310  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   311  			if m.Key == nil {
   312  				m.Key = []byte{}
   313  			}
   314  			iNdEx = postIndex
   315  		default:
   316  			iNdEx = preIndex
   317  			skippy, err := skipKeys(dAtA[iNdEx:])
   318  			if err != nil {
   319  				return err
   320  			}
   321  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   322  				return ErrInvalidLengthKeys
   323  			}
   324  			if (iNdEx + skippy) > l {
   325  				return io.ErrUnexpectedEOF
   326  			}
   327  			iNdEx += skippy
   328  		}
   329  	}
   330  
   331  	if iNdEx > l {
   332  		return io.ErrUnexpectedEOF
   333  	}
   334  	return nil
   335  }
   336  func (m *PrivKey) Unmarshal(dAtA []byte) error {
   337  	l := len(dAtA)
   338  	iNdEx := 0
   339  	for iNdEx < l {
   340  		preIndex := iNdEx
   341  		var wire uint64
   342  		for shift := uint(0); ; shift += 7 {
   343  			if shift >= 64 {
   344  				return ErrIntOverflowKeys
   345  			}
   346  			if iNdEx >= l {
   347  				return io.ErrUnexpectedEOF
   348  			}
   349  			b := dAtA[iNdEx]
   350  			iNdEx++
   351  			wire |= uint64(b&0x7F) << shift
   352  			if b < 0x80 {
   353  				break
   354  			}
   355  		}
   356  		fieldNum := int32(wire >> 3)
   357  		wireType := int(wire & 0x7)
   358  		if wireType == 4 {
   359  			return fmt.Errorf("proto: PrivKey: wiretype end group for non-group")
   360  		}
   361  		if fieldNum <= 0 {
   362  			return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire)
   363  		}
   364  		switch fieldNum {
   365  		case 1:
   366  			if wireType != 2 {
   367  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   368  			}
   369  			var byteLen int
   370  			for shift := uint(0); ; shift += 7 {
   371  				if shift >= 64 {
   372  					return ErrIntOverflowKeys
   373  				}
   374  				if iNdEx >= l {
   375  					return io.ErrUnexpectedEOF
   376  				}
   377  				b := dAtA[iNdEx]
   378  				iNdEx++
   379  				byteLen |= int(b&0x7F) << shift
   380  				if b < 0x80 {
   381  					break
   382  				}
   383  			}
   384  			if byteLen < 0 {
   385  				return ErrInvalidLengthKeys
   386  			}
   387  			postIndex := iNdEx + byteLen
   388  			if postIndex < 0 {
   389  				return ErrInvalidLengthKeys
   390  			}
   391  			if postIndex > l {
   392  				return io.ErrUnexpectedEOF
   393  			}
   394  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   395  			if m.Key == nil {
   396  				m.Key = []byte{}
   397  			}
   398  			iNdEx = postIndex
   399  		default:
   400  			iNdEx = preIndex
   401  			skippy, err := skipKeys(dAtA[iNdEx:])
   402  			if err != nil {
   403  				return err
   404  			}
   405  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   406  				return ErrInvalidLengthKeys
   407  			}
   408  			if (iNdEx + skippy) > l {
   409  				return io.ErrUnexpectedEOF
   410  			}
   411  			iNdEx += skippy
   412  		}
   413  	}
   414  
   415  	if iNdEx > l {
   416  		return io.ErrUnexpectedEOF
   417  	}
   418  	return nil
   419  }
   420  func skipKeys(dAtA []byte) (n int, err error) {
   421  	l := len(dAtA)
   422  	iNdEx := 0
   423  	depth := 0
   424  	for iNdEx < l {
   425  		var wire uint64
   426  		for shift := uint(0); ; shift += 7 {
   427  			if shift >= 64 {
   428  				return 0, ErrIntOverflowKeys
   429  			}
   430  			if iNdEx >= l {
   431  				return 0, io.ErrUnexpectedEOF
   432  			}
   433  			b := dAtA[iNdEx]
   434  			iNdEx++
   435  			wire |= (uint64(b) & 0x7F) << shift
   436  			if b < 0x80 {
   437  				break
   438  			}
   439  		}
   440  		wireType := int(wire & 0x7)
   441  		switch wireType {
   442  		case 0:
   443  			for shift := uint(0); ; shift += 7 {
   444  				if shift >= 64 {
   445  					return 0, ErrIntOverflowKeys
   446  				}
   447  				if iNdEx >= l {
   448  					return 0, io.ErrUnexpectedEOF
   449  				}
   450  				iNdEx++
   451  				if dAtA[iNdEx-1] < 0x80 {
   452  					break
   453  				}
   454  			}
   455  		case 1:
   456  			iNdEx += 8
   457  		case 2:
   458  			var length int
   459  			for shift := uint(0); ; shift += 7 {
   460  				if shift >= 64 {
   461  					return 0, ErrIntOverflowKeys
   462  				}
   463  				if iNdEx >= l {
   464  					return 0, io.ErrUnexpectedEOF
   465  				}
   466  				b := dAtA[iNdEx]
   467  				iNdEx++
   468  				length |= (int(b) & 0x7F) << shift
   469  				if b < 0x80 {
   470  					break
   471  				}
   472  			}
   473  			if length < 0 {
   474  				return 0, ErrInvalidLengthKeys
   475  			}
   476  			iNdEx += length
   477  		case 3:
   478  			depth++
   479  		case 4:
   480  			if depth == 0 {
   481  				return 0, ErrUnexpectedEndOfGroupKeys
   482  			}
   483  			depth--
   484  		case 5:
   485  			iNdEx += 4
   486  		default:
   487  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   488  		}
   489  		if iNdEx < 0 {
   490  			return 0, ErrInvalidLengthKeys
   491  		}
   492  		if depth == 0 {
   493  			return iNdEx, nil
   494  		}
   495  	}
   496  	return 0, io.ErrUnexpectedEOF
   497  }
   498  
   499  var (
   500  	ErrInvalidLengthKeys        = fmt.Errorf("proto: negative length found during unmarshaling")
   501  	ErrIntOverflowKeys          = fmt.Errorf("proto: integer overflow")
   502  	ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group")
   503  )