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