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