github.com/lazyledger/lazyledger-core@v0.35.0-dev.0.20210613111200-4c651f053571/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 // 212 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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x00, 0xff, 0xff, 0xc9, 0x0d, 0x80, 0x75, 136 0x02, 0x01, 0x00, 0x00, 137 } 138 139 func (this *PublicKey) Compare(that interface{}) int { 140 if that == nil { 141 if this == nil { 142 return 0 143 } 144 return 1 145 } 146 147 that1, ok := that.(*PublicKey) 148 if !ok { 149 that2, ok := that.(PublicKey) 150 if ok { 151 that1 = &that2 152 } else { 153 return 1 154 } 155 } 156 if that1 == nil { 157 if this == nil { 158 return 0 159 } 160 return 1 161 } else if this == nil { 162 return -1 163 } 164 if that1.Sum == nil { 165 if this.Sum != nil { 166 return 1 167 } 168 } else if this.Sum == nil { 169 return -1 170 } else { 171 thisType := -1 172 switch this.Sum.(type) { 173 case *PublicKey_Ed25519: 174 thisType = 0 175 case *PublicKey_Secp256K1: 176 thisType = 1 177 default: 178 panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum)) 179 } 180 that1Type := -1 181 switch that1.Sum.(type) { 182 case *PublicKey_Ed25519: 183 that1Type = 0 184 case *PublicKey_Secp256K1: 185 that1Type = 1 186 default: 187 panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum)) 188 } 189 if thisType == that1Type { 190 if c := this.Sum.Compare(that1.Sum); c != 0 { 191 return c 192 } 193 } else if thisType < that1Type { 194 return -1 195 } else if thisType > that1Type { 196 return 1 197 } 198 } 199 return 0 200 } 201 func (this *PublicKey_Ed25519) Compare(that interface{}) int { 202 if that == nil { 203 if this == nil { 204 return 0 205 } 206 return 1 207 } 208 209 that1, ok := that.(*PublicKey_Ed25519) 210 if !ok { 211 that2, ok := that.(PublicKey_Ed25519) 212 if ok { 213 that1 = &that2 214 } else { 215 return 1 216 } 217 } 218 if that1 == nil { 219 if this == nil { 220 return 0 221 } 222 return 1 223 } else if this == nil { 224 return -1 225 } 226 if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 { 227 return c 228 } 229 return 0 230 } 231 func (this *PublicKey_Secp256K1) Compare(that interface{}) int { 232 if that == nil { 233 if this == nil { 234 return 0 235 } 236 return 1 237 } 238 239 that1, ok := that.(*PublicKey_Secp256K1) 240 if !ok { 241 that2, ok := that.(PublicKey_Secp256K1) 242 if ok { 243 that1 = &that2 244 } else { 245 return 1 246 } 247 } 248 if that1 == nil { 249 if this == nil { 250 return 0 251 } 252 return 1 253 } else if this == nil { 254 return -1 255 } 256 if c := bytes.Compare(this.Secp256K1, that1.Secp256K1); c != 0 { 257 return c 258 } 259 return 0 260 } 261 func (this *PublicKey) Equal(that interface{}) bool { 262 if that == nil { 263 return this == nil 264 } 265 266 that1, ok := that.(*PublicKey) 267 if !ok { 268 that2, ok := that.(PublicKey) 269 if ok { 270 that1 = &that2 271 } else { 272 return false 273 } 274 } 275 if that1 == nil { 276 return this == nil 277 } else if this == nil { 278 return false 279 } 280 if that1.Sum == nil { 281 if this.Sum != nil { 282 return false 283 } 284 } else if this.Sum == nil { 285 return false 286 } else if !this.Sum.Equal(that1.Sum) { 287 return false 288 } 289 return true 290 } 291 func (this *PublicKey_Ed25519) Equal(that interface{}) bool { 292 if that == nil { 293 return this == nil 294 } 295 296 that1, ok := that.(*PublicKey_Ed25519) 297 if !ok { 298 that2, ok := that.(PublicKey_Ed25519) 299 if ok { 300 that1 = &that2 301 } else { 302 return false 303 } 304 } 305 if that1 == nil { 306 return this == nil 307 } else if this == nil { 308 return false 309 } 310 if !bytes.Equal(this.Ed25519, that1.Ed25519) { 311 return false 312 } 313 return true 314 } 315 func (this *PublicKey_Secp256K1) Equal(that interface{}) bool { 316 if that == nil { 317 return this == nil 318 } 319 320 that1, ok := that.(*PublicKey_Secp256K1) 321 if !ok { 322 that2, ok := that.(PublicKey_Secp256K1) 323 if ok { 324 that1 = &that2 325 } else { 326 return false 327 } 328 } 329 if that1 == nil { 330 return this == nil 331 } else if this == nil { 332 return false 333 } 334 if !bytes.Equal(this.Secp256K1, that1.Secp256K1) { 335 return false 336 } 337 return true 338 } 339 func (m *PublicKey) Marshal() (dAtA []byte, err error) { 340 size := m.Size() 341 dAtA = make([]byte, size) 342 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 343 if err != nil { 344 return nil, err 345 } 346 return dAtA[:n], nil 347 } 348 349 func (m *PublicKey) MarshalTo(dAtA []byte) (int, error) { 350 size := m.Size() 351 return m.MarshalToSizedBuffer(dAtA[:size]) 352 } 353 354 func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { 355 i := len(dAtA) 356 _ = i 357 var l int 358 _ = l 359 if m.Sum != nil { 360 { 361 size := m.Sum.Size() 362 i -= size 363 if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { 364 return 0, err 365 } 366 } 367 } 368 return len(dAtA) - i, nil 369 } 370 371 func (m *PublicKey_Ed25519) MarshalTo(dAtA []byte) (int, error) { 372 size := m.Size() 373 return m.MarshalToSizedBuffer(dAtA[:size]) 374 } 375 376 func (m *PublicKey_Ed25519) MarshalToSizedBuffer(dAtA []byte) (int, error) { 377 i := len(dAtA) 378 if m.Ed25519 != nil { 379 i -= len(m.Ed25519) 380 copy(dAtA[i:], m.Ed25519) 381 i = encodeVarintKeys(dAtA, i, uint64(len(m.Ed25519))) 382 i-- 383 dAtA[i] = 0xa 384 } 385 return len(dAtA) - i, nil 386 } 387 func (m *PublicKey_Secp256K1) MarshalTo(dAtA []byte) (int, error) { 388 size := m.Size() 389 return m.MarshalToSizedBuffer(dAtA[:size]) 390 } 391 392 func (m *PublicKey_Secp256K1) MarshalToSizedBuffer(dAtA []byte) (int, error) { 393 i := len(dAtA) 394 if m.Secp256K1 != nil { 395 i -= len(m.Secp256K1) 396 copy(dAtA[i:], m.Secp256K1) 397 i = encodeVarintKeys(dAtA, i, uint64(len(m.Secp256K1))) 398 i-- 399 dAtA[i] = 0x12 400 } 401 return len(dAtA) - i, nil 402 } 403 func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { 404 offset -= sovKeys(v) 405 base := offset 406 for v >= 1<<7 { 407 dAtA[offset] = uint8(v&0x7f | 0x80) 408 v >>= 7 409 offset++ 410 } 411 dAtA[offset] = uint8(v) 412 return base 413 } 414 func (m *PublicKey) Size() (n int) { 415 if m == nil { 416 return 0 417 } 418 var l int 419 _ = l 420 if m.Sum != nil { 421 n += m.Sum.Size() 422 } 423 return n 424 } 425 426 func (m *PublicKey_Ed25519) Size() (n int) { 427 if m == nil { 428 return 0 429 } 430 var l int 431 _ = l 432 if m.Ed25519 != nil { 433 l = len(m.Ed25519) 434 n += 1 + l + sovKeys(uint64(l)) 435 } 436 return n 437 } 438 func (m *PublicKey_Secp256K1) Size() (n int) { 439 if m == nil { 440 return 0 441 } 442 var l int 443 _ = l 444 if m.Secp256K1 != nil { 445 l = len(m.Secp256K1) 446 n += 1 + l + sovKeys(uint64(l)) 447 } 448 return n 449 } 450 451 func sovKeys(x uint64) (n int) { 452 return (math_bits.Len64(x|1) + 6) / 7 453 } 454 func sozKeys(x uint64) (n int) { 455 return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 456 } 457 func (m *PublicKey) Unmarshal(dAtA []byte) error { 458 l := len(dAtA) 459 iNdEx := 0 460 for iNdEx < l { 461 preIndex := iNdEx 462 var wire uint64 463 for shift := uint(0); ; shift += 7 { 464 if shift >= 64 { 465 return ErrIntOverflowKeys 466 } 467 if iNdEx >= l { 468 return io.ErrUnexpectedEOF 469 } 470 b := dAtA[iNdEx] 471 iNdEx++ 472 wire |= uint64(b&0x7F) << shift 473 if b < 0x80 { 474 break 475 } 476 } 477 fieldNum := int32(wire >> 3) 478 wireType := int(wire & 0x7) 479 if wireType == 4 { 480 return fmt.Errorf("proto: PublicKey: wiretype end group for non-group") 481 } 482 if fieldNum <= 0 { 483 return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) 484 } 485 switch fieldNum { 486 case 1: 487 if wireType != 2 { 488 return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType) 489 } 490 var byteLen int 491 for shift := uint(0); ; shift += 7 { 492 if shift >= 64 { 493 return ErrIntOverflowKeys 494 } 495 if iNdEx >= l { 496 return io.ErrUnexpectedEOF 497 } 498 b := dAtA[iNdEx] 499 iNdEx++ 500 byteLen |= int(b&0x7F) << shift 501 if b < 0x80 { 502 break 503 } 504 } 505 if byteLen < 0 { 506 return ErrInvalidLengthKeys 507 } 508 postIndex := iNdEx + byteLen 509 if postIndex < 0 { 510 return ErrInvalidLengthKeys 511 } 512 if postIndex > l { 513 return io.ErrUnexpectedEOF 514 } 515 v := make([]byte, postIndex-iNdEx) 516 copy(v, dAtA[iNdEx:postIndex]) 517 m.Sum = &PublicKey_Ed25519{v} 518 iNdEx = postIndex 519 case 2: 520 if wireType != 2 { 521 return fmt.Errorf("proto: wrong wireType = %d for field Secp256K1", wireType) 522 } 523 var byteLen int 524 for shift := uint(0); ; shift += 7 { 525 if shift >= 64 { 526 return ErrIntOverflowKeys 527 } 528 if iNdEx >= l { 529 return io.ErrUnexpectedEOF 530 } 531 b := dAtA[iNdEx] 532 iNdEx++ 533 byteLen |= int(b&0x7F) << shift 534 if b < 0x80 { 535 break 536 } 537 } 538 if byteLen < 0 { 539 return ErrInvalidLengthKeys 540 } 541 postIndex := iNdEx + byteLen 542 if postIndex < 0 { 543 return ErrInvalidLengthKeys 544 } 545 if postIndex > l { 546 return io.ErrUnexpectedEOF 547 } 548 v := make([]byte, postIndex-iNdEx) 549 copy(v, dAtA[iNdEx:postIndex]) 550 m.Sum = &PublicKey_Secp256K1{v} 551 iNdEx = postIndex 552 default: 553 iNdEx = preIndex 554 skippy, err := skipKeys(dAtA[iNdEx:]) 555 if err != nil { 556 return err 557 } 558 if skippy < 0 { 559 return ErrInvalidLengthKeys 560 } 561 if (iNdEx + skippy) < 0 { 562 return ErrInvalidLengthKeys 563 } 564 if (iNdEx + skippy) > l { 565 return io.ErrUnexpectedEOF 566 } 567 iNdEx += skippy 568 } 569 } 570 571 if iNdEx > l { 572 return io.ErrUnexpectedEOF 573 } 574 return nil 575 } 576 func skipKeys(dAtA []byte) (n int, err error) { 577 l := len(dAtA) 578 iNdEx := 0 579 depth := 0 580 for iNdEx < l { 581 var wire uint64 582 for shift := uint(0); ; shift += 7 { 583 if shift >= 64 { 584 return 0, ErrIntOverflowKeys 585 } 586 if iNdEx >= l { 587 return 0, io.ErrUnexpectedEOF 588 } 589 b := dAtA[iNdEx] 590 iNdEx++ 591 wire |= (uint64(b) & 0x7F) << shift 592 if b < 0x80 { 593 break 594 } 595 } 596 wireType := int(wire & 0x7) 597 switch wireType { 598 case 0: 599 for shift := uint(0); ; shift += 7 { 600 if shift >= 64 { 601 return 0, ErrIntOverflowKeys 602 } 603 if iNdEx >= l { 604 return 0, io.ErrUnexpectedEOF 605 } 606 iNdEx++ 607 if dAtA[iNdEx-1] < 0x80 { 608 break 609 } 610 } 611 case 1: 612 iNdEx += 8 613 case 2: 614 var length int 615 for shift := uint(0); ; shift += 7 { 616 if shift >= 64 { 617 return 0, ErrIntOverflowKeys 618 } 619 if iNdEx >= l { 620 return 0, io.ErrUnexpectedEOF 621 } 622 b := dAtA[iNdEx] 623 iNdEx++ 624 length |= (int(b) & 0x7F) << shift 625 if b < 0x80 { 626 break 627 } 628 } 629 if length < 0 { 630 return 0, ErrInvalidLengthKeys 631 } 632 iNdEx += length 633 case 3: 634 depth++ 635 case 4: 636 if depth == 0 { 637 return 0, ErrUnexpectedEndOfGroupKeys 638 } 639 depth-- 640 case 5: 641 iNdEx += 4 642 default: 643 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 644 } 645 if iNdEx < 0 { 646 return 0, ErrInvalidLengthKeys 647 } 648 if depth == 0 { 649 return iNdEx, nil 650 } 651 } 652 return 0, io.ErrUnexpectedEOF 653 } 654 655 var ( 656 ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") 657 ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") 658 ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") 659 )