github.com/cosmos/cosmos-sdk@v0.50.1/crypto/keys/secp256r1/keys.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/crypto/secp256r1/keys.proto 3 4 package secp256r1 5 6 import ( 7 fmt "fmt" 8 _ "github.com/cosmos/gogoproto/gogoproto" 9 proto "github.com/cosmos/gogoproto/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 25 26 // PubKey defines a secp256r1 ECDSA public key. 27 type PubKey struct { 28 // Point on secp256r1 curve in a compressed representation as specified in section 29 // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 30 Key *ecdsaPK `protobuf:"bytes,1,opt,name=key,proto3,customtype=ecdsaPK" json:"key,omitempty"` 31 } 32 33 func (m *PubKey) Reset() { *m = PubKey{} } 34 func (*PubKey) ProtoMessage() {} 35 func (*PubKey) Descriptor() ([]byte, []int) { 36 return fileDescriptor_b90c18415095c0c3, []int{0} 37 } 38 func (m *PubKey) XXX_Unmarshal(b []byte) error { 39 return m.Unmarshal(b) 40 } 41 func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 42 if deterministic { 43 return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) 44 } else { 45 b = b[:cap(b)] 46 n, err := m.MarshalToSizedBuffer(b) 47 if err != nil { 48 return nil, err 49 } 50 return b[:n], nil 51 } 52 } 53 func (m *PubKey) XXX_Merge(src proto.Message) { 54 xxx_messageInfo_PubKey.Merge(m, src) 55 } 56 func (m *PubKey) XXX_Size() int { 57 return m.Size() 58 } 59 func (m *PubKey) XXX_DiscardUnknown() { 60 xxx_messageInfo_PubKey.DiscardUnknown(m) 61 } 62 63 var xxx_messageInfo_PubKey proto.InternalMessageInfo 64 65 func (*PubKey) XXX_MessageName() string { 66 return "cosmos.crypto.secp256r1.PubKey" 67 } 68 69 // PrivKey defines a secp256r1 ECDSA private key. 70 type PrivKey struct { 71 // secret number serialized using big-endian encoding 72 Secret *ecdsaSK `protobuf:"bytes,1,opt,name=secret,proto3,customtype=ecdsaSK" json:"secret,omitempty"` 73 } 74 75 func (m *PrivKey) Reset() { *m = PrivKey{} } 76 func (*PrivKey) ProtoMessage() {} 77 func (*PrivKey) Descriptor() ([]byte, []int) { 78 return fileDescriptor_b90c18415095c0c3, []int{1} 79 } 80 func (m *PrivKey) XXX_Unmarshal(b []byte) error { 81 return m.Unmarshal(b) 82 } 83 func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 84 if deterministic { 85 return xxx_messageInfo_PrivKey.Marshal(b, m, deterministic) 86 } else { 87 b = b[:cap(b)] 88 n, err := m.MarshalToSizedBuffer(b) 89 if err != nil { 90 return nil, err 91 } 92 return b[:n], nil 93 } 94 } 95 func (m *PrivKey) XXX_Merge(src proto.Message) { 96 xxx_messageInfo_PrivKey.Merge(m, src) 97 } 98 func (m *PrivKey) XXX_Size() int { 99 return m.Size() 100 } 101 func (m *PrivKey) XXX_DiscardUnknown() { 102 xxx_messageInfo_PrivKey.DiscardUnknown(m) 103 } 104 105 var xxx_messageInfo_PrivKey proto.InternalMessageInfo 106 107 func (*PrivKey) XXX_MessageName() string { 108 return "cosmos.crypto.secp256r1.PrivKey" 109 } 110 func init() { 111 proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256r1.PubKey") 112 proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256r1.PrivKey") 113 } 114 115 func init() { 116 proto.RegisterFile("cosmos/crypto/secp256r1/keys.proto", fileDescriptor_b90c18415095c0c3) 117 } 118 119 var fileDescriptor_b90c18415095c0c3 = []byte{ 120 // 221 bytes of a gzipped FileDescriptorProto 121 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, 122 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32, 123 0x35, 0x2b, 0x32, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 124 0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 125 0xd1, 0x07, 0xb1, 0x20, 0xca, 0x95, 0xd4, 0xb9, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 126 0x64, 0xb9, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0xb8, 0x6f, 0xdd, 127 0x93, 0x67, 0x4f, 0x4d, 0x4e, 0x29, 0x4e, 0x0c, 0xf0, 0x0e, 0x02, 0x89, 0x2b, 0xe9, 0x71, 0xb1, 128 0x07, 0x14, 0x65, 0x96, 0x81, 0x54, 0x2a, 0x73, 0xb1, 0x15, 0xa7, 0x26, 0x17, 0xa5, 0x96, 0x60, 129 0x28, 0x0e, 0xf6, 0x0e, 0x82, 0x4a, 0x39, 0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 130 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 131 0x1c, 0xc3, 0x89, 0xc7, 0x72, 0x8c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 132 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xf3, 0x1c, 0x98, 0xd2, 133 0x2d, 0x4e, 0xc9, 0x86, 0xf9, 0x13, 0xe4, 0x3b, 0x84, 0x67, 0x93, 0xd8, 0xc0, 0x2e, 0x37, 0x06, 134 0x04, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x65, 0x08, 0x5c, 0x0e, 0x01, 0x00, 0x00, 135 } 136 137 func (m *PubKey) Marshal() (dAtA []byte, err error) { 138 size := m.Size() 139 dAtA = make([]byte, size) 140 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 141 if err != nil { 142 return nil, err 143 } 144 return dAtA[:n], nil 145 } 146 147 func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { 148 size := m.Size() 149 return m.MarshalToSizedBuffer(dAtA[:size]) 150 } 151 152 func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { 153 i := len(dAtA) 154 _ = i 155 var l int 156 _ = l 157 if m.Key != nil { 158 { 159 size := m.Key.Size() 160 i -= size 161 if _, err := m.Key.MarshalTo(dAtA[i:]); err != nil { 162 return 0, err 163 } 164 i = encodeVarintKeys(dAtA, i, uint64(size)) 165 } 166 i-- 167 dAtA[i] = 0xa 168 } 169 return len(dAtA) - i, nil 170 } 171 172 func (m *PrivKey) Marshal() (dAtA []byte, err error) { 173 size := m.Size() 174 dAtA = make([]byte, size) 175 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 176 if err != nil { 177 return nil, err 178 } 179 return dAtA[:n], nil 180 } 181 182 func (m *PrivKey) MarshalTo(dAtA []byte) (int, error) { 183 size := m.Size() 184 return m.MarshalToSizedBuffer(dAtA[:size]) 185 } 186 187 func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { 188 i := len(dAtA) 189 _ = i 190 var l int 191 _ = l 192 if m.Secret != nil { 193 { 194 size := m.Secret.Size() 195 i -= size 196 if _, err := m.Secret.MarshalTo(dAtA[i:]); err != nil { 197 return 0, err 198 } 199 i = encodeVarintKeys(dAtA, i, uint64(size)) 200 } 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 if m.Key != nil { 225 l = m.Key.Size() 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 if m.Secret != nil { 238 l = m.Secret.Size() 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 var v ecdsaPK 309 m.Key = &v 310 if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 311 return err 312 } 313 iNdEx = postIndex 314 default: 315 iNdEx = preIndex 316 skippy, err := skipKeys(dAtA[iNdEx:]) 317 if err != nil { 318 return err 319 } 320 if (skippy < 0) || (iNdEx+skippy) < 0 { 321 return ErrInvalidLengthKeys 322 } 323 if (iNdEx + skippy) > l { 324 return io.ErrUnexpectedEOF 325 } 326 iNdEx += skippy 327 } 328 } 329 330 if iNdEx > l { 331 return io.ErrUnexpectedEOF 332 } 333 return nil 334 } 335 func (m *PrivKey) Unmarshal(dAtA []byte) error { 336 l := len(dAtA) 337 iNdEx := 0 338 for iNdEx < l { 339 preIndex := iNdEx 340 var wire uint64 341 for shift := uint(0); ; shift += 7 { 342 if shift >= 64 { 343 return ErrIntOverflowKeys 344 } 345 if iNdEx >= l { 346 return io.ErrUnexpectedEOF 347 } 348 b := dAtA[iNdEx] 349 iNdEx++ 350 wire |= uint64(b&0x7F) << shift 351 if b < 0x80 { 352 break 353 } 354 } 355 fieldNum := int32(wire >> 3) 356 wireType := int(wire & 0x7) 357 if wireType == 4 { 358 return fmt.Errorf("proto: PrivKey: wiretype end group for non-group") 359 } 360 if fieldNum <= 0 { 361 return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) 362 } 363 switch fieldNum { 364 case 1: 365 if wireType != 2 { 366 return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) 367 } 368 var byteLen int 369 for shift := uint(0); ; shift += 7 { 370 if shift >= 64 { 371 return ErrIntOverflowKeys 372 } 373 if iNdEx >= l { 374 return io.ErrUnexpectedEOF 375 } 376 b := dAtA[iNdEx] 377 iNdEx++ 378 byteLen |= int(b&0x7F) << shift 379 if b < 0x80 { 380 break 381 } 382 } 383 if byteLen < 0 { 384 return ErrInvalidLengthKeys 385 } 386 postIndex := iNdEx + byteLen 387 if postIndex < 0 { 388 return ErrInvalidLengthKeys 389 } 390 if postIndex > l { 391 return io.ErrUnexpectedEOF 392 } 393 var v ecdsaSK 394 m.Secret = &v 395 if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 396 return err 397 } 398 iNdEx = postIndex 399 default: 400 iNdEx = preIndex 401 skippy, err := skipKeys(dAtA[iNdEx:]) 402 if err != nil { 403 return err 404 } 405 if (skippy < 0) || (iNdEx+skippy) < 0 { 406 return ErrInvalidLengthKeys 407 } 408 if (iNdEx + skippy) > l { 409 return io.ErrUnexpectedEOF 410 } 411 iNdEx += skippy 412 } 413 } 414 415 if iNdEx > l { 416 return io.ErrUnexpectedEOF 417 } 418 return nil 419 } 420 func skipKeys(dAtA []byte) (n int, err error) { 421 l := len(dAtA) 422 iNdEx := 0 423 depth := 0 424 for iNdEx < l { 425 var wire uint64 426 for shift := uint(0); ; shift += 7 { 427 if shift >= 64 { 428 return 0, ErrIntOverflowKeys 429 } 430 if iNdEx >= l { 431 return 0, io.ErrUnexpectedEOF 432 } 433 b := dAtA[iNdEx] 434 iNdEx++ 435 wire |= (uint64(b) & 0x7F) << shift 436 if b < 0x80 { 437 break 438 } 439 } 440 wireType := int(wire & 0x7) 441 switch wireType { 442 case 0: 443 for shift := uint(0); ; shift += 7 { 444 if shift >= 64 { 445 return 0, ErrIntOverflowKeys 446 } 447 if iNdEx >= l { 448 return 0, io.ErrUnexpectedEOF 449 } 450 iNdEx++ 451 if dAtA[iNdEx-1] < 0x80 { 452 break 453 } 454 } 455 case 1: 456 iNdEx += 8 457 case 2: 458 var length int 459 for shift := uint(0); ; shift += 7 { 460 if shift >= 64 { 461 return 0, ErrIntOverflowKeys 462 } 463 if iNdEx >= l { 464 return 0, io.ErrUnexpectedEOF 465 } 466 b := dAtA[iNdEx] 467 iNdEx++ 468 length |= (int(b) & 0x7F) << shift 469 if b < 0x80 { 470 break 471 } 472 } 473 if length < 0 { 474 return 0, ErrInvalidLengthKeys 475 } 476 iNdEx += length 477 case 3: 478 depth++ 479 case 4: 480 if depth == 0 { 481 return 0, ErrUnexpectedEndOfGroupKeys 482 } 483 depth-- 484 case 5: 485 iNdEx += 4 486 default: 487 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 488 } 489 if iNdEx < 0 { 490 return 0, ErrInvalidLengthKeys 491 } 492 if depth == 0 { 493 return iNdEx, nil 494 } 495 } 496 return 0, io.ErrUnexpectedEOF 497 } 498 499 var ( 500 ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") 501 ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") 502 ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") 503 )