github.com/Finschia/finschia-sdk@v0.48.1/crypto/keys/secp256r1/keys.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cosmos/crypto/secp256r1/keys.proto
     3  
     4  package secp256r1
     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 secp256r1 ECDSA public key.
    27  type PubKey struct {
    28  	// Point on secp256r1 curve in a compressed representation as specified in section
    29  	// 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998
    30  	Key *ecdsaPK `protobuf:"bytes,1,opt,name=key,proto3,customtype=ecdsaPK" json:"key,omitempty"`
    31  }
    32  
    33  func (m *PubKey) Reset()      { *m = PubKey{} }
    34  func (*PubKey) ProtoMessage() {}
    35  func (*PubKey) Descriptor() ([]byte, []int) {
    36  	return fileDescriptor_b90c18415095c0c3, []int{0}
    37  }
    38  func (m *PubKey) XXX_Unmarshal(b []byte) error {
    39  	return m.Unmarshal(b)
    40  }
    41  func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    42  	if deterministic {
    43  		return xxx_messageInfo_PubKey.Marshal(b, m, deterministic)
    44  	} else {
    45  		b = b[:cap(b)]
    46  		n, err := m.MarshalToSizedBuffer(b)
    47  		if err != nil {
    48  			return nil, err
    49  		}
    50  		return b[:n], nil
    51  	}
    52  }
    53  func (m *PubKey) XXX_Merge(src proto.Message) {
    54  	xxx_messageInfo_PubKey.Merge(m, src)
    55  }
    56  func (m *PubKey) XXX_Size() int {
    57  	return m.Size()
    58  }
    59  func (m *PubKey) XXX_DiscardUnknown() {
    60  	xxx_messageInfo_PubKey.DiscardUnknown(m)
    61  }
    62  
    63  var xxx_messageInfo_PubKey proto.InternalMessageInfo
    64  
    65  func (*PubKey) XXX_MessageName() string {
    66  	return "cosmos.crypto.secp256r1.PubKey"
    67  }
    68  
    69  // PrivKey defines a secp256r1 ECDSA private key.
    70  type PrivKey struct {
    71  	// secret number serialized using big-endian encoding
    72  	Secret *ecdsaSK `protobuf:"bytes,1,opt,name=secret,proto3,customtype=ecdsaSK" json:"secret,omitempty"`
    73  }
    74  
    75  func (m *PrivKey) Reset()      { *m = PrivKey{} }
    76  func (*PrivKey) ProtoMessage() {}
    77  func (*PrivKey) Descriptor() ([]byte, []int) {
    78  	return fileDescriptor_b90c18415095c0c3, []int{1}
    79  }
    80  func (m *PrivKey) XXX_Unmarshal(b []byte) error {
    81  	return m.Unmarshal(b)
    82  }
    83  func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    84  	if deterministic {
    85  		return xxx_messageInfo_PrivKey.Marshal(b, m, deterministic)
    86  	} else {
    87  		b = b[:cap(b)]
    88  		n, err := m.MarshalToSizedBuffer(b)
    89  		if err != nil {
    90  			return nil, err
    91  		}
    92  		return b[:n], nil
    93  	}
    94  }
    95  func (m *PrivKey) XXX_Merge(src proto.Message) {
    96  	xxx_messageInfo_PrivKey.Merge(m, src)
    97  }
    98  func (m *PrivKey) XXX_Size() int {
    99  	return m.Size()
   100  }
   101  func (m *PrivKey) XXX_DiscardUnknown() {
   102  	xxx_messageInfo_PrivKey.DiscardUnknown(m)
   103  }
   104  
   105  var xxx_messageInfo_PrivKey proto.InternalMessageInfo
   106  
   107  func (*PrivKey) XXX_MessageName() string {
   108  	return "cosmos.crypto.secp256r1.PrivKey"
   109  }
   110  func init() {
   111  	proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256r1.PubKey")
   112  	proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256r1.PrivKey")
   113  }
   114  
   115  func init() {
   116  	proto.RegisterFile("cosmos/crypto/secp256r1/keys.proto", fileDescriptor_b90c18415095c0c3)
   117  }
   118  
   119  var fileDescriptor_b90c18415095c0c3 = []byte{
   120  	// 229 bytes of a gzipped FileDescriptorProto
   121  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce,
   122  	0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32,
   123  	0x35, 0x2b, 0x32, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12,
   124  	0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab,
   125  	0xd1, 0x07, 0xb1, 0x20, 0xca, 0x95, 0xd4, 0xb9, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85,
   126  	0x64, 0xb9, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0xb8, 0x6f, 0xdd,
   127  	0x93, 0x67, 0x4f, 0x4d, 0x4e, 0x29, 0x4e, 0x0c, 0xf0, 0x0e, 0x02, 0x89, 0x2b, 0xe9, 0x71, 0xb1,
   128  	0x07, 0x14, 0x65, 0x96, 0x81, 0x54, 0x2a, 0x73, 0xb1, 0x15, 0xa7, 0x26, 0x17, 0xa5, 0x96, 0x60,
   129  	0x28, 0x0e, 0xf6, 0x0e, 0x82, 0x4a, 0x39, 0xc5, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c,
   130  	0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1,
   131  	0x1c, 0xc3, 0x89, 0xc7, 0x72, 0x8c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65,
   132  	0x96, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x96, 0x99, 0x57, 0x9c,
   133  	0x9c, 0x91, 0x99, 0xa8, 0x9f, 0x06, 0x65, 0xe8, 0x16, 0xa7, 0x64, 0xc3, 0xfc, 0x0a, 0xf2, 0x21,
   134  	0xc2, 0xc3, 0x49, 0x6c, 0x60, 0xd7, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x8b, 0xb7,
   135  	0xe3, 0x12, 0x01, 0x00, 0x00,
   136  }
   137  
   138  func (m *PubKey) Marshal() (dAtA []byte, err error) {
   139  	size := m.Size()
   140  	dAtA = make([]byte, size)
   141  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   142  	if err != nil {
   143  		return nil, err
   144  	}
   145  	return dAtA[:n], nil
   146  }
   147  
   148  func (m *PubKey) MarshalTo(dAtA []byte) (int, error) {
   149  	size := m.Size()
   150  	return m.MarshalToSizedBuffer(dAtA[:size])
   151  }
   152  
   153  func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   154  	i := len(dAtA)
   155  	_ = i
   156  	var l int
   157  	_ = l
   158  	if m.Key != nil {
   159  		{
   160  			size := m.Key.Size()
   161  			i -= size
   162  			if _, err := m.Key.MarshalTo(dAtA[i:]); err != nil {
   163  				return 0, err
   164  			}
   165  			i = encodeVarintKeys(dAtA, i, uint64(size))
   166  		}
   167  		i--
   168  		dAtA[i] = 0xa
   169  	}
   170  	return len(dAtA) - i, nil
   171  }
   172  
   173  func (m *PrivKey) Marshal() (dAtA []byte, err error) {
   174  	size := m.Size()
   175  	dAtA = make([]byte, size)
   176  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   177  	if err != nil {
   178  		return nil, err
   179  	}
   180  	return dAtA[:n], nil
   181  }
   182  
   183  func (m *PrivKey) MarshalTo(dAtA []byte) (int, error) {
   184  	size := m.Size()
   185  	return m.MarshalToSizedBuffer(dAtA[:size])
   186  }
   187  
   188  func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   189  	i := len(dAtA)
   190  	_ = i
   191  	var l int
   192  	_ = l
   193  	if m.Secret != nil {
   194  		{
   195  			size := m.Secret.Size()
   196  			i -= size
   197  			if _, err := m.Secret.MarshalTo(dAtA[i:]); err != nil {
   198  				return 0, err
   199  			}
   200  			i = encodeVarintKeys(dAtA, i, uint64(size))
   201  		}
   202  		i--
   203  		dAtA[i] = 0xa
   204  	}
   205  	return len(dAtA) - i, nil
   206  }
   207  
   208  func encodeVarintKeys(dAtA []byte, offset int, v uint64) int {
   209  	offset -= sovKeys(v)
   210  	base := offset
   211  	for v >= 1<<7 {
   212  		dAtA[offset] = uint8(v&0x7f | 0x80)
   213  		v >>= 7
   214  		offset++
   215  	}
   216  	dAtA[offset] = uint8(v)
   217  	return base
   218  }
   219  func (m *PubKey) Size() (n int) {
   220  	if m == nil {
   221  		return 0
   222  	}
   223  	var l int
   224  	_ = l
   225  	if m.Key != nil {
   226  		l = m.Key.Size()
   227  		n += 1 + l + sovKeys(uint64(l))
   228  	}
   229  	return n
   230  }
   231  
   232  func (m *PrivKey) Size() (n int) {
   233  	if m == nil {
   234  		return 0
   235  	}
   236  	var l int
   237  	_ = l
   238  	if m.Secret != nil {
   239  		l = m.Secret.Size()
   240  		n += 1 + l + sovKeys(uint64(l))
   241  	}
   242  	return n
   243  }
   244  
   245  func sovKeys(x uint64) (n int) {
   246  	return (math_bits.Len64(x|1) + 6) / 7
   247  }
   248  func sozKeys(x uint64) (n int) {
   249  	return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   250  }
   251  func (m *PubKey) Unmarshal(dAtA []byte) error {
   252  	l := len(dAtA)
   253  	iNdEx := 0
   254  	for iNdEx < l {
   255  		preIndex := iNdEx
   256  		var wire uint64
   257  		for shift := uint(0); ; shift += 7 {
   258  			if shift >= 64 {
   259  				return ErrIntOverflowKeys
   260  			}
   261  			if iNdEx >= l {
   262  				return io.ErrUnexpectedEOF
   263  			}
   264  			b := dAtA[iNdEx]
   265  			iNdEx++
   266  			wire |= uint64(b&0x7F) << shift
   267  			if b < 0x80 {
   268  				break
   269  			}
   270  		}
   271  		fieldNum := int32(wire >> 3)
   272  		wireType := int(wire & 0x7)
   273  		if wireType == 4 {
   274  			return fmt.Errorf("proto: PubKey: wiretype end group for non-group")
   275  		}
   276  		if fieldNum <= 0 {
   277  			return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire)
   278  		}
   279  		switch fieldNum {
   280  		case 1:
   281  			if wireType != 2 {
   282  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   283  			}
   284  			var byteLen int
   285  			for shift := uint(0); ; shift += 7 {
   286  				if shift >= 64 {
   287  					return ErrIntOverflowKeys
   288  				}
   289  				if iNdEx >= l {
   290  					return io.ErrUnexpectedEOF
   291  				}
   292  				b := dAtA[iNdEx]
   293  				iNdEx++
   294  				byteLen |= int(b&0x7F) << shift
   295  				if b < 0x80 {
   296  					break
   297  				}
   298  			}
   299  			if byteLen < 0 {
   300  				return ErrInvalidLengthKeys
   301  			}
   302  			postIndex := iNdEx + byteLen
   303  			if postIndex < 0 {
   304  				return ErrInvalidLengthKeys
   305  			}
   306  			if postIndex > l {
   307  				return io.ErrUnexpectedEOF
   308  			}
   309  			var v ecdsaPK
   310  			m.Key = &v
   311  			if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   312  				return err
   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 Secret", 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  			var v ecdsaSK
   395  			m.Secret = &v
   396  			if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   397  				return err
   398  			}
   399  			iNdEx = postIndex
   400  		default:
   401  			iNdEx = preIndex
   402  			skippy, err := skipKeys(dAtA[iNdEx:])
   403  			if err != nil {
   404  				return err
   405  			}
   406  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   407  				return ErrInvalidLengthKeys
   408  			}
   409  			if (iNdEx + skippy) > l {
   410  				return io.ErrUnexpectedEOF
   411  			}
   412  			iNdEx += skippy
   413  		}
   414  	}
   415  
   416  	if iNdEx > l {
   417  		return io.ErrUnexpectedEOF
   418  	}
   419  	return nil
   420  }
   421  func skipKeys(dAtA []byte) (n int, err error) {
   422  	l := len(dAtA)
   423  	iNdEx := 0
   424  	depth := 0
   425  	for iNdEx < l {
   426  		var wire uint64
   427  		for shift := uint(0); ; shift += 7 {
   428  			if shift >= 64 {
   429  				return 0, ErrIntOverflowKeys
   430  			}
   431  			if iNdEx >= l {
   432  				return 0, io.ErrUnexpectedEOF
   433  			}
   434  			b := dAtA[iNdEx]
   435  			iNdEx++
   436  			wire |= (uint64(b) & 0x7F) << shift
   437  			if b < 0x80 {
   438  				break
   439  			}
   440  		}
   441  		wireType := int(wire & 0x7)
   442  		switch wireType {
   443  		case 0:
   444  			for shift := uint(0); ; shift += 7 {
   445  				if shift >= 64 {
   446  					return 0, ErrIntOverflowKeys
   447  				}
   448  				if iNdEx >= l {
   449  					return 0, io.ErrUnexpectedEOF
   450  				}
   451  				iNdEx++
   452  				if dAtA[iNdEx-1] < 0x80 {
   453  					break
   454  				}
   455  			}
   456  		case 1:
   457  			iNdEx += 8
   458  		case 2:
   459  			var length int
   460  			for shift := uint(0); ; shift += 7 {
   461  				if shift >= 64 {
   462  					return 0, ErrIntOverflowKeys
   463  				}
   464  				if iNdEx >= l {
   465  					return 0, io.ErrUnexpectedEOF
   466  				}
   467  				b := dAtA[iNdEx]
   468  				iNdEx++
   469  				length |= (int(b) & 0x7F) << shift
   470  				if b < 0x80 {
   471  					break
   472  				}
   473  			}
   474  			if length < 0 {
   475  				return 0, ErrInvalidLengthKeys
   476  			}
   477  			iNdEx += length
   478  		case 3:
   479  			depth++
   480  		case 4:
   481  			if depth == 0 {
   482  				return 0, ErrUnexpectedEndOfGroupKeys
   483  			}
   484  			depth--
   485  		case 5:
   486  			iNdEx += 4
   487  		default:
   488  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   489  		}
   490  		if iNdEx < 0 {
   491  			return 0, ErrInvalidLengthKeys
   492  		}
   493  		if depth == 0 {
   494  			return iNdEx, nil
   495  		}
   496  	}
   497  	return 0, io.ErrUnexpectedEOF
   498  }
   499  
   500  var (
   501  	ErrInvalidLengthKeys        = fmt.Errorf("proto: negative length found during unmarshaling")
   502  	ErrIntOverflowKeys          = fmt.Errorf("proto: integer overflow")
   503  	ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group")
   504  )