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