github.com/supragya/TendermintConnector@v0.0.0-20210619045051-113e32b84fb1/chains/iris/proto/tendermint/crypto/keys.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: tendermint/crypto/keys.proto 3 4 package crypto 5 6 import ( 7 bytes "bytes" 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 // PublicKey defines the keys available for use with Tendermint Validators 28 type PublicKey struct { 29 // Types that are valid to be assigned to Sum: 30 // *PublicKey_Ed25519 31 // *PublicKey_Secp256K1 32 Sum isPublicKey_Sum `protobuf_oneof:"sum"` 33 } 34 35 func (m *PublicKey) Reset() { *m = PublicKey{} } 36 func (m *PublicKey) String() string { return proto.CompactTextString(m) } 37 func (*PublicKey) ProtoMessage() {} 38 func (*PublicKey) Descriptor() ([]byte, []int) { 39 return fileDescriptor_cb048658b234868c, []int{0} 40 } 41 func (m *PublicKey) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_PublicKey.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 *PublicKey) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_PublicKey.Merge(m, src) 58 } 59 func (m *PublicKey) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *PublicKey) XXX_DiscardUnknown() { 63 xxx_messageInfo_PublicKey.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_PublicKey proto.InternalMessageInfo 67 68 type isPublicKey_Sum interface { 69 isPublicKey_Sum() 70 Equal(interface{}) bool 71 MarshalTo([]byte) (int, error) 72 Size() int 73 Compare(interface{}) int 74 } 75 76 type PublicKey_Ed25519 struct { 77 Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"` 78 } 79 type PublicKey_Secp256K1 struct { 80 Secp256K1 []byte `protobuf:"bytes,2,opt,name=secp256k1,proto3,oneof" json:"secp256k1,omitempty"` 81 } 82 83 func (*PublicKey_Ed25519) isPublicKey_Sum() {} 84 func (*PublicKey_Secp256K1) isPublicKey_Sum() {} 85 86 func (m *PublicKey) GetSum() isPublicKey_Sum { 87 if m != nil { 88 return m.Sum 89 } 90 return nil 91 } 92 93 func (m *PublicKey) GetEd25519() []byte { 94 if x, ok := m.GetSum().(*PublicKey_Ed25519); ok { 95 return x.Ed25519 96 } 97 return nil 98 } 99 100 func (m *PublicKey) GetSecp256K1() []byte { 101 if x, ok := m.GetSum().(*PublicKey_Secp256K1); ok { 102 return x.Secp256K1 103 } 104 return nil 105 } 106 107 // XXX_OneofWrappers is for the internal use of the proto package. 108 func (*PublicKey) XXX_OneofWrappers() []interface{} { 109 return []interface{}{ 110 (*PublicKey_Ed25519)(nil), 111 (*PublicKey_Secp256K1)(nil), 112 } 113 } 114 115 func init() { 116 proto.RegisterType((*PublicKey)(nil), "tendermint.crypto.PublicKey") 117 } 118 119 func init() { proto.RegisterFile("tendermint/crypto/keys.proto", fileDescriptor_cb048658b234868c) } 120 121 var fileDescriptor_cb048658b234868c = []byte{ 122 // 229 bytes of a gzipped FileDescriptorProto 123 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x49, 0xcd, 0x4b, 124 0x49, 0x2d, 0xca, 0xcd, 0xcc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0xbf, 0x24, 0xd7, 0xd8, 0x44, 0x1f, 0xe2, 0x72, 136 0x0c, 0x4f, 0x27, 0xb1, 0x81, 0x25, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, 0x88, 0x1e, 137 0x2e, 0x10, 0x01, 0x00, 0x00, 138 } 139 140 func (this *PublicKey) Compare(that interface{}) int { 141 if that == nil { 142 if this == nil { 143 return 0 144 } 145 return 1 146 } 147 148 that1, ok := that.(*PublicKey) 149 if !ok { 150 that2, ok := that.(PublicKey) 151 if ok { 152 that1 = &that2 153 } else { 154 return 1 155 } 156 } 157 if that1 == nil { 158 if this == nil { 159 return 0 160 } 161 return 1 162 } else if this == nil { 163 return -1 164 } 165 if that1.Sum == nil { 166 if this.Sum != nil { 167 return 1 168 } 169 } else if this.Sum == nil { 170 return -1 171 } else { 172 thisType := -1 173 switch this.Sum.(type) { 174 case *PublicKey_Ed25519: 175 thisType = 0 176 case *PublicKey_Secp256K1: 177 thisType = 1 178 default: 179 panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum)) 180 } 181 that1Type := -1 182 switch that1.Sum.(type) { 183 case *PublicKey_Ed25519: 184 that1Type = 0 185 case *PublicKey_Secp256K1: 186 that1Type = 1 187 default: 188 panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum)) 189 } 190 if thisType == that1Type { 191 if c := this.Sum.Compare(that1.Sum); c != 0 { 192 return c 193 } 194 } else if thisType < that1Type { 195 return -1 196 } else if thisType > that1Type { 197 return 1 198 } 199 } 200 return 0 201 } 202 func (this *PublicKey_Ed25519) Compare(that interface{}) int { 203 if that == nil { 204 if this == nil { 205 return 0 206 } 207 return 1 208 } 209 210 that1, ok := that.(*PublicKey_Ed25519) 211 if !ok { 212 that2, ok := that.(PublicKey_Ed25519) 213 if ok { 214 that1 = &that2 215 } else { 216 return 1 217 } 218 } 219 if that1 == nil { 220 if this == nil { 221 return 0 222 } 223 return 1 224 } else if this == nil { 225 return -1 226 } 227 if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 { 228 return c 229 } 230 return 0 231 } 232 func (this *PublicKey_Secp256K1) Compare(that interface{}) int { 233 if that == nil { 234 if this == nil { 235 return 0 236 } 237 return 1 238 } 239 240 that1, ok := that.(*PublicKey_Secp256K1) 241 if !ok { 242 that2, ok := that.(PublicKey_Secp256K1) 243 if ok { 244 that1 = &that2 245 } else { 246 return 1 247 } 248 } 249 if that1 == nil { 250 if this == nil { 251 return 0 252 } 253 return 1 254 } else if this == nil { 255 return -1 256 } 257 if c := bytes.Compare(this.Secp256K1, that1.Secp256K1); c != 0 { 258 return c 259 } 260 return 0 261 } 262 func (this *PublicKey) Equal(that interface{}) bool { 263 if that == nil { 264 return this == nil 265 } 266 267 that1, ok := that.(*PublicKey) 268 if !ok { 269 that2, ok := that.(PublicKey) 270 if ok { 271 that1 = &that2 272 } else { 273 return false 274 } 275 } 276 if that1 == nil { 277 return this == nil 278 } else if this == nil { 279 return false 280 } 281 if that1.Sum == nil { 282 if this.Sum != nil { 283 return false 284 } 285 } else if this.Sum == nil { 286 return false 287 } else if !this.Sum.Equal(that1.Sum) { 288 return false 289 } 290 return true 291 } 292 func (this *PublicKey_Ed25519) Equal(that interface{}) bool { 293 if that == nil { 294 return this == nil 295 } 296 297 that1, ok := that.(*PublicKey_Ed25519) 298 if !ok { 299 that2, ok := that.(PublicKey_Ed25519) 300 if ok { 301 that1 = &that2 302 } else { 303 return false 304 } 305 } 306 if that1 == nil { 307 return this == nil 308 } else if this == nil { 309 return false 310 } 311 if !bytes.Equal(this.Ed25519, that1.Ed25519) { 312 return false 313 } 314 return true 315 } 316 func (this *PublicKey_Secp256K1) Equal(that interface{}) bool { 317 if that == nil { 318 return this == nil 319 } 320 321 that1, ok := that.(*PublicKey_Secp256K1) 322 if !ok { 323 that2, ok := that.(PublicKey_Secp256K1) 324 if ok { 325 that1 = &that2 326 } else { 327 return false 328 } 329 } 330 if that1 == nil { 331 return this == nil 332 } else if this == nil { 333 return false 334 } 335 if !bytes.Equal(this.Secp256K1, that1.Secp256K1) { 336 return false 337 } 338 return true 339 } 340 func (m *PublicKey) Marshal() (dAtA []byte, err error) { 341 size := m.Size() 342 dAtA = make([]byte, size) 343 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 344 if err != nil { 345 return nil, err 346 } 347 return dAtA[:n], nil 348 } 349 350 func (m *PublicKey) MarshalTo(dAtA []byte) (int, error) { 351 size := m.Size() 352 return m.MarshalToSizedBuffer(dAtA[:size]) 353 } 354 355 func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { 356 i := len(dAtA) 357 _ = i 358 var l int 359 _ = l 360 if m.Sum != nil { 361 { 362 size := m.Sum.Size() 363 i -= size 364 if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { 365 return 0, err 366 } 367 } 368 } 369 return len(dAtA) - i, nil 370 } 371 372 func (m *PublicKey_Ed25519) MarshalTo(dAtA []byte) (int, error) { 373 size := m.Size() 374 return m.MarshalToSizedBuffer(dAtA[:size]) 375 } 376 377 func (m *PublicKey_Ed25519) MarshalToSizedBuffer(dAtA []byte) (int, error) { 378 i := len(dAtA) 379 if m.Ed25519 != nil { 380 i -= len(m.Ed25519) 381 copy(dAtA[i:], m.Ed25519) 382 i = encodeVarintKeys(dAtA, i, uint64(len(m.Ed25519))) 383 i-- 384 dAtA[i] = 0xa 385 } 386 return len(dAtA) - i, nil 387 } 388 func (m *PublicKey_Secp256K1) MarshalTo(dAtA []byte) (int, error) { 389 size := m.Size() 390 return m.MarshalToSizedBuffer(dAtA[:size]) 391 } 392 393 func (m *PublicKey_Secp256K1) MarshalToSizedBuffer(dAtA []byte) (int, error) { 394 i := len(dAtA) 395 if m.Secp256K1 != nil { 396 i -= len(m.Secp256K1) 397 copy(dAtA[i:], m.Secp256K1) 398 i = encodeVarintKeys(dAtA, i, uint64(len(m.Secp256K1))) 399 i-- 400 dAtA[i] = 0x12 401 } 402 return len(dAtA) - i, nil 403 } 404 func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { 405 offset -= sovKeys(v) 406 base := offset 407 for v >= 1<<7 { 408 dAtA[offset] = uint8(v&0x7f | 0x80) 409 v >>= 7 410 offset++ 411 } 412 dAtA[offset] = uint8(v) 413 return base 414 } 415 func (m *PublicKey) Size() (n int) { 416 if m == nil { 417 return 0 418 } 419 var l int 420 _ = l 421 if m.Sum != nil { 422 n += m.Sum.Size() 423 } 424 return n 425 } 426 427 func (m *PublicKey_Ed25519) Size() (n int) { 428 if m == nil { 429 return 0 430 } 431 var l int 432 _ = l 433 if m.Ed25519 != nil { 434 l = len(m.Ed25519) 435 n += 1 + l + sovKeys(uint64(l)) 436 } 437 return n 438 } 439 func (m *PublicKey_Secp256K1) Size() (n int) { 440 if m == nil { 441 return 0 442 } 443 var l int 444 _ = l 445 if m.Secp256K1 != nil { 446 l = len(m.Secp256K1) 447 n += 1 + l + sovKeys(uint64(l)) 448 } 449 return n 450 } 451 452 func sovKeys(x uint64) (n int) { 453 return (math_bits.Len64(x|1) + 6) / 7 454 } 455 func sozKeys(x uint64) (n int) { 456 return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 457 } 458 func (m *PublicKey) Unmarshal(dAtA []byte) error { 459 l := len(dAtA) 460 iNdEx := 0 461 for iNdEx < l { 462 preIndex := iNdEx 463 var wire uint64 464 for shift := uint(0); ; shift += 7 { 465 if shift >= 64 { 466 return ErrIntOverflowKeys 467 } 468 if iNdEx >= l { 469 return io.ErrUnexpectedEOF 470 } 471 b := dAtA[iNdEx] 472 iNdEx++ 473 wire |= uint64(b&0x7F) << shift 474 if b < 0x80 { 475 break 476 } 477 } 478 fieldNum := int32(wire >> 3) 479 wireType := int(wire & 0x7) 480 if wireType == 4 { 481 return fmt.Errorf("proto: PublicKey: wiretype end group for non-group") 482 } 483 if fieldNum <= 0 { 484 return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) 485 } 486 switch fieldNum { 487 case 1: 488 if wireType != 2 { 489 return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType) 490 } 491 var byteLen int 492 for shift := uint(0); ; shift += 7 { 493 if shift >= 64 { 494 return ErrIntOverflowKeys 495 } 496 if iNdEx >= l { 497 return io.ErrUnexpectedEOF 498 } 499 b := dAtA[iNdEx] 500 iNdEx++ 501 byteLen |= int(b&0x7F) << shift 502 if b < 0x80 { 503 break 504 } 505 } 506 if byteLen < 0 { 507 return ErrInvalidLengthKeys 508 } 509 postIndex := iNdEx + byteLen 510 if postIndex < 0 { 511 return ErrInvalidLengthKeys 512 } 513 if postIndex > l { 514 return io.ErrUnexpectedEOF 515 } 516 v := make([]byte, postIndex-iNdEx) 517 copy(v, dAtA[iNdEx:postIndex]) 518 m.Sum = &PublicKey_Ed25519{v} 519 iNdEx = postIndex 520 case 2: 521 if wireType != 2 { 522 return fmt.Errorf("proto: wrong wireType = %d for field Secp256K1", wireType) 523 } 524 var byteLen int 525 for shift := uint(0); ; shift += 7 { 526 if shift >= 64 { 527 return ErrIntOverflowKeys 528 } 529 if iNdEx >= l { 530 return io.ErrUnexpectedEOF 531 } 532 b := dAtA[iNdEx] 533 iNdEx++ 534 byteLen |= int(b&0x7F) << shift 535 if b < 0x80 { 536 break 537 } 538 } 539 if byteLen < 0 { 540 return ErrInvalidLengthKeys 541 } 542 postIndex := iNdEx + byteLen 543 if postIndex < 0 { 544 return ErrInvalidLengthKeys 545 } 546 if postIndex > l { 547 return io.ErrUnexpectedEOF 548 } 549 v := make([]byte, postIndex-iNdEx) 550 copy(v, dAtA[iNdEx:postIndex]) 551 m.Sum = &PublicKey_Secp256K1{v} 552 iNdEx = postIndex 553 default: 554 iNdEx = preIndex 555 skippy, err := skipKeys(dAtA[iNdEx:]) 556 if err != nil { 557 return err 558 } 559 if (skippy < 0) || (iNdEx+skippy) < 0 { 560 return ErrInvalidLengthKeys 561 } 562 if (iNdEx + skippy) > l { 563 return io.ErrUnexpectedEOF 564 } 565 iNdEx += skippy 566 } 567 } 568 569 if iNdEx > l { 570 return io.ErrUnexpectedEOF 571 } 572 return nil 573 } 574 func skipKeys(dAtA []byte) (n int, err error) { 575 l := len(dAtA) 576 iNdEx := 0 577 depth := 0 578 for iNdEx < l { 579 var wire uint64 580 for shift := uint(0); ; shift += 7 { 581 if shift >= 64 { 582 return 0, ErrIntOverflowKeys 583 } 584 if iNdEx >= l { 585 return 0, io.ErrUnexpectedEOF 586 } 587 b := dAtA[iNdEx] 588 iNdEx++ 589 wire |= (uint64(b) & 0x7F) << shift 590 if b < 0x80 { 591 break 592 } 593 } 594 wireType := int(wire & 0x7) 595 switch wireType { 596 case 0: 597 for shift := uint(0); ; shift += 7 { 598 if shift >= 64 { 599 return 0, ErrIntOverflowKeys 600 } 601 if iNdEx >= l { 602 return 0, io.ErrUnexpectedEOF 603 } 604 iNdEx++ 605 if dAtA[iNdEx-1] < 0x80 { 606 break 607 } 608 } 609 case 1: 610 iNdEx += 8 611 case 2: 612 var length int 613 for shift := uint(0); ; shift += 7 { 614 if shift >= 64 { 615 return 0, ErrIntOverflowKeys 616 } 617 if iNdEx >= l { 618 return 0, io.ErrUnexpectedEOF 619 } 620 b := dAtA[iNdEx] 621 iNdEx++ 622 length |= (int(b) & 0x7F) << shift 623 if b < 0x80 { 624 break 625 } 626 } 627 if length < 0 { 628 return 0, ErrInvalidLengthKeys 629 } 630 iNdEx += length 631 case 3: 632 depth++ 633 case 4: 634 if depth == 0 { 635 return 0, ErrUnexpectedEndOfGroupKeys 636 } 637 depth-- 638 case 5: 639 iNdEx += 4 640 default: 641 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 642 } 643 if iNdEx < 0 { 644 return 0, ErrInvalidLengthKeys 645 } 646 if depth == 0 { 647 return iNdEx, nil 648 } 649 } 650 return 0, io.ErrUnexpectedEOF 651 } 652 653 var ( 654 ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") 655 ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") 656 ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") 657 )