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

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cosmos/crypto/ed25519/keys.proto
     3  
     4  package ed25519
     5  
     6  import (
     7  	crypto_ed25519 "crypto/ed25519"
     8  	fmt "fmt"
     9  	_ "github.com/gogo/protobuf/gogoproto"
    10  	proto "github.com/gogo/protobuf/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 is an ed25519 public key for handling Tendermint keys in SDK.
    28  // It's needed for Any serialization and SDK compatibility.
    29  // It must not be used in a non Tendermint key context because it doesn't implement
    30  // ADR-28. Nevertheless, you will like to use ed25519 in app user level
    31  // then you must create a new proto message and follow ADR-28 for Address construction.
    32  type PubKey struct {
    33  	Key crypto_ed25519.PublicKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PublicKey" 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_48fe3336771e732d, []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() crypto_ed25519.PublicKey {
    69  	if m != nil {
    70  		return m.Key
    71  	}
    72  	return nil
    73  }
    74  
    75  // Deprecated: PrivKey defines a ed25519 private key.
    76  // NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context.
    77  type PrivKey struct {
    78  	Key crypto_ed25519.PrivateKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PrivateKey" json:"key,omitempty"`
    79  }
    80  
    81  func (m *PrivKey) Reset()         { *m = PrivKey{} }
    82  func (m *PrivKey) String() string { return proto.CompactTextString(m) }
    83  func (*PrivKey) ProtoMessage()    {}
    84  func (*PrivKey) Descriptor() ([]byte, []int) {
    85  	return fileDescriptor_48fe3336771e732d, []int{1}
    86  }
    87  func (m *PrivKey) XXX_Unmarshal(b []byte) error {
    88  	return m.Unmarshal(b)
    89  }
    90  func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    91  	if deterministic {
    92  		return xxx_messageInfo_PrivKey.Marshal(b, m, deterministic)
    93  	} else {
    94  		b = b[:cap(b)]
    95  		n, err := m.MarshalToSizedBuffer(b)
    96  		if err != nil {
    97  			return nil, err
    98  		}
    99  		return b[:n], nil
   100  	}
   101  }
   102  func (m *PrivKey) XXX_Merge(src proto.Message) {
   103  	xxx_messageInfo_PrivKey.Merge(m, src)
   104  }
   105  func (m *PrivKey) XXX_Size() int {
   106  	return m.Size()
   107  }
   108  func (m *PrivKey) XXX_DiscardUnknown() {
   109  	xxx_messageInfo_PrivKey.DiscardUnknown(m)
   110  }
   111  
   112  var xxx_messageInfo_PrivKey proto.InternalMessageInfo
   113  
   114  func (m *PrivKey) GetKey() crypto_ed25519.PrivateKey {
   115  	if m != nil {
   116  		return m.Key
   117  	}
   118  	return nil
   119  }
   120  
   121  func init() {
   122  	proto.RegisterType((*PubKey)(nil), "cosmos.crypto.ed25519.PubKey")
   123  	proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.ed25519.PrivKey")
   124  }
   125  
   126  func init() { proto.RegisterFile("cosmos/crypto/ed25519/keys.proto", fileDescriptor_48fe3336771e732d) }
   127  
   128  var fileDescriptor_48fe3336771e732d = []byte{
   129  	// 229 bytes of a gzipped FileDescriptorProto
   130  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce,
   131  	0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x4f, 0x4d, 0x31, 0x32, 0x35, 0x35,
   132  	0xb4, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8,
   133  	0xd0, 0x83, 0xa8, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07,
   134  	0xb1, 0x20, 0x8a, 0x95, 0xec, 0xb8, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 0xf4, 0xb8,
   135  	0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0x64, 0x7e, 0xdd, 0x93, 0x97,
   136  	0x40, 0xb5, 0x42, 0x2f, 0xa0, 0x34, 0x29, 0x27, 0x33, 0xd9, 0x3b, 0xb5, 0x32, 0x08, 0xa4, 0xd0,
   137  	0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x25, 0x2b, 0x2e, 0xf6, 0x80, 0xa2, 0xcc, 0x32, 0x90, 0x01,
   138  	0xfa, 0xc8, 0x06, 0xc8, 0xfe, 0xba, 0x27, 0x2f, 0x89, 0x6e, 0x40, 0x51, 0x66, 0x59, 0x62, 0x49,
   139  	0x2a, 0xcc, 0x04, 0x27, 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48,
   140  	0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32,
   141  	0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0xcb, 0xcc, 0x2b, 0x4e,
   142  	0xce, 0xc8, 0x4c, 0xd4, 0x4f, 0x83, 0x32, 0x74, 0x8b, 0x53, 0xb2, 0x61, 0xde, 0x07, 0x79, 0x1b,
   143  	0x66, 0x7e, 0x12, 0x1b, 0xd8, 0x4b, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x2a, 0xcf,
   144  	0x80, 0x23, 0x01, 0x00, 0x00,
   145  }
   146  
   147  func (m *PubKey) Marshal() (dAtA []byte, err error) {
   148  	size := m.Size()
   149  	dAtA = make([]byte, size)
   150  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   151  	if err != nil {
   152  		return nil, err
   153  	}
   154  	return dAtA[:n], nil
   155  }
   156  
   157  func (m *PubKey) MarshalTo(dAtA []byte) (int, error) {
   158  	size := m.Size()
   159  	return m.MarshalToSizedBuffer(dAtA[:size])
   160  }
   161  
   162  func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   163  	i := len(dAtA)
   164  	_ = i
   165  	var l int
   166  	_ = l
   167  	if len(m.Key) > 0 {
   168  		i -= len(m.Key)
   169  		copy(dAtA[i:], m.Key)
   170  		i = encodeVarintKeys(dAtA, i, uint64(len(m.Key)))
   171  		i--
   172  		dAtA[i] = 0xa
   173  	}
   174  	return len(dAtA) - i, nil
   175  }
   176  
   177  func (m *PrivKey) Marshal() (dAtA []byte, err error) {
   178  	size := m.Size()
   179  	dAtA = make([]byte, size)
   180  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   181  	if err != nil {
   182  		return nil, err
   183  	}
   184  	return dAtA[:n], nil
   185  }
   186  
   187  func (m *PrivKey) MarshalTo(dAtA []byte) (int, error) {
   188  	size := m.Size()
   189  	return m.MarshalToSizedBuffer(dAtA[:size])
   190  }
   191  
   192  func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   193  	i := len(dAtA)
   194  	_ = i
   195  	var l int
   196  	_ = l
   197  	if len(m.Key) > 0 {
   198  		i -= len(m.Key)
   199  		copy(dAtA[i:], m.Key)
   200  		i = encodeVarintKeys(dAtA, i, uint64(len(m.Key)))
   201  		i--
   202  		dAtA[i] = 0xa
   203  	}
   204  	return len(dAtA) - i, nil
   205  }
   206  
   207  func encodeVarintKeys(dAtA []byte, offset int, v uint64) int {
   208  	offset -= sovKeys(v)
   209  	base := offset
   210  	for v >= 1<<7 {
   211  		dAtA[offset] = uint8(v&0x7f | 0x80)
   212  		v >>= 7
   213  		offset++
   214  	}
   215  	dAtA[offset] = uint8(v)
   216  	return base
   217  }
   218  func (m *PubKey) Size() (n int) {
   219  	if m == nil {
   220  		return 0
   221  	}
   222  	var l int
   223  	_ = l
   224  	l = len(m.Key)
   225  	if l > 0 {
   226  		n += 1 + l + sovKeys(uint64(l))
   227  	}
   228  	return n
   229  }
   230  
   231  func (m *PrivKey) Size() (n int) {
   232  	if m == nil {
   233  		return 0
   234  	}
   235  	var l int
   236  	_ = l
   237  	l = len(m.Key)
   238  	if l > 0 {
   239  		n += 1 + l + sovKeys(uint64(l))
   240  	}
   241  	return n
   242  }
   243  
   244  func sovKeys(x uint64) (n int) {
   245  	return (math_bits.Len64(x|1) + 6) / 7
   246  }
   247  func sozKeys(x uint64) (n int) {
   248  	return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   249  }
   250  func (m *PubKey) Unmarshal(dAtA []byte) error {
   251  	l := len(dAtA)
   252  	iNdEx := 0
   253  	for iNdEx < l {
   254  		preIndex := iNdEx
   255  		var wire uint64
   256  		for shift := uint(0); ; shift += 7 {
   257  			if shift >= 64 {
   258  				return ErrIntOverflowKeys
   259  			}
   260  			if iNdEx >= l {
   261  				return io.ErrUnexpectedEOF
   262  			}
   263  			b := dAtA[iNdEx]
   264  			iNdEx++
   265  			wire |= uint64(b&0x7F) << shift
   266  			if b < 0x80 {
   267  				break
   268  			}
   269  		}
   270  		fieldNum := int32(wire >> 3)
   271  		wireType := int(wire & 0x7)
   272  		if wireType == 4 {
   273  			return fmt.Errorf("proto: PubKey: wiretype end group for non-group")
   274  		}
   275  		if fieldNum <= 0 {
   276  			return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire)
   277  		}
   278  		switch fieldNum {
   279  		case 1:
   280  			if wireType != 2 {
   281  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   282  			}
   283  			var byteLen int
   284  			for shift := uint(0); ; shift += 7 {
   285  				if shift >= 64 {
   286  					return ErrIntOverflowKeys
   287  				}
   288  				if iNdEx >= l {
   289  					return io.ErrUnexpectedEOF
   290  				}
   291  				b := dAtA[iNdEx]
   292  				iNdEx++
   293  				byteLen |= int(b&0x7F) << shift
   294  				if b < 0x80 {
   295  					break
   296  				}
   297  			}
   298  			if byteLen < 0 {
   299  				return ErrInvalidLengthKeys
   300  			}
   301  			postIndex := iNdEx + byteLen
   302  			if postIndex < 0 {
   303  				return ErrInvalidLengthKeys
   304  			}
   305  			if postIndex > l {
   306  				return io.ErrUnexpectedEOF
   307  			}
   308  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   309  			if m.Key == nil {
   310  				m.Key = []byte{}
   311  			}
   312  			iNdEx = postIndex
   313  		default:
   314  			iNdEx = preIndex
   315  			skippy, err := skipKeys(dAtA[iNdEx:])
   316  			if err != nil {
   317  				return err
   318  			}
   319  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   320  				return ErrInvalidLengthKeys
   321  			}
   322  			if (iNdEx + skippy) > l {
   323  				return io.ErrUnexpectedEOF
   324  			}
   325  			iNdEx += skippy
   326  		}
   327  	}
   328  
   329  	if iNdEx > l {
   330  		return io.ErrUnexpectedEOF
   331  	}
   332  	return nil
   333  }
   334  func (m *PrivKey) Unmarshal(dAtA []byte) error {
   335  	l := len(dAtA)
   336  	iNdEx := 0
   337  	for iNdEx < l {
   338  		preIndex := iNdEx
   339  		var wire uint64
   340  		for shift := uint(0); ; shift += 7 {
   341  			if shift >= 64 {
   342  				return ErrIntOverflowKeys
   343  			}
   344  			if iNdEx >= l {
   345  				return io.ErrUnexpectedEOF
   346  			}
   347  			b := dAtA[iNdEx]
   348  			iNdEx++
   349  			wire |= uint64(b&0x7F) << shift
   350  			if b < 0x80 {
   351  				break
   352  			}
   353  		}
   354  		fieldNum := int32(wire >> 3)
   355  		wireType := int(wire & 0x7)
   356  		if wireType == 4 {
   357  			return fmt.Errorf("proto: PrivKey: wiretype end group for non-group")
   358  		}
   359  		if fieldNum <= 0 {
   360  			return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire)
   361  		}
   362  		switch fieldNum {
   363  		case 1:
   364  			if wireType != 2 {
   365  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   366  			}
   367  			var byteLen int
   368  			for shift := uint(0); ; shift += 7 {
   369  				if shift >= 64 {
   370  					return ErrIntOverflowKeys
   371  				}
   372  				if iNdEx >= l {
   373  					return io.ErrUnexpectedEOF
   374  				}
   375  				b := dAtA[iNdEx]
   376  				iNdEx++
   377  				byteLen |= int(b&0x7F) << shift
   378  				if b < 0x80 {
   379  					break
   380  				}
   381  			}
   382  			if byteLen < 0 {
   383  				return ErrInvalidLengthKeys
   384  			}
   385  			postIndex := iNdEx + byteLen
   386  			if postIndex < 0 {
   387  				return ErrInvalidLengthKeys
   388  			}
   389  			if postIndex > l {
   390  				return io.ErrUnexpectedEOF
   391  			}
   392  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   393  			if m.Key == nil {
   394  				m.Key = []byte{}
   395  			}
   396  			iNdEx = postIndex
   397  		default:
   398  			iNdEx = preIndex
   399  			skippy, err := skipKeys(dAtA[iNdEx:])
   400  			if err != nil {
   401  				return err
   402  			}
   403  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   404  				return ErrInvalidLengthKeys
   405  			}
   406  			if (iNdEx + skippy) > l {
   407  				return io.ErrUnexpectedEOF
   408  			}
   409  			iNdEx += skippy
   410  		}
   411  	}
   412  
   413  	if iNdEx > l {
   414  		return io.ErrUnexpectedEOF
   415  	}
   416  	return nil
   417  }
   418  func skipKeys(dAtA []byte) (n int, err error) {
   419  	l := len(dAtA)
   420  	iNdEx := 0
   421  	depth := 0
   422  	for iNdEx < l {
   423  		var wire uint64
   424  		for shift := uint(0); ; shift += 7 {
   425  			if shift >= 64 {
   426  				return 0, ErrIntOverflowKeys
   427  			}
   428  			if iNdEx >= l {
   429  				return 0, io.ErrUnexpectedEOF
   430  			}
   431  			b := dAtA[iNdEx]
   432  			iNdEx++
   433  			wire |= (uint64(b) & 0x7F) << shift
   434  			if b < 0x80 {
   435  				break
   436  			}
   437  		}
   438  		wireType := int(wire & 0x7)
   439  		switch wireType {
   440  		case 0:
   441  			for shift := uint(0); ; shift += 7 {
   442  				if shift >= 64 {
   443  					return 0, ErrIntOverflowKeys
   444  				}
   445  				if iNdEx >= l {
   446  					return 0, io.ErrUnexpectedEOF
   447  				}
   448  				iNdEx++
   449  				if dAtA[iNdEx-1] < 0x80 {
   450  					break
   451  				}
   452  			}
   453  		case 1:
   454  			iNdEx += 8
   455  		case 2:
   456  			var length int
   457  			for shift := uint(0); ; shift += 7 {
   458  				if shift >= 64 {
   459  					return 0, ErrIntOverflowKeys
   460  				}
   461  				if iNdEx >= l {
   462  					return 0, io.ErrUnexpectedEOF
   463  				}
   464  				b := dAtA[iNdEx]
   465  				iNdEx++
   466  				length |= (int(b) & 0x7F) << shift
   467  				if b < 0x80 {
   468  					break
   469  				}
   470  			}
   471  			if length < 0 {
   472  				return 0, ErrInvalidLengthKeys
   473  			}
   474  			iNdEx += length
   475  		case 3:
   476  			depth++
   477  		case 4:
   478  			if depth == 0 {
   479  				return 0, ErrUnexpectedEndOfGroupKeys
   480  			}
   481  			depth--
   482  		case 5:
   483  			iNdEx += 4
   484  		default:
   485  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   486  		}
   487  		if iNdEx < 0 {
   488  			return 0, ErrInvalidLengthKeys
   489  		}
   490  		if depth == 0 {
   491  			return iNdEx, nil
   492  		}
   493  	}
   494  	return 0, io.ErrUnexpectedEOF
   495  }
   496  
   497  var (
   498  	ErrInvalidLengthKeys        = fmt.Errorf("proto: negative length found during unmarshaling")
   499  	ErrIntOverflowKeys          = fmt.Errorf("proto: integer overflow")
   500  	ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group")
   501  )