You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

792 lines
18 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: crypto/merkle/merkle.proto
  3. package merkle
  4. import proto "github.com/gogo/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "github.com/gogo/protobuf/gogoproto"
  8. import bytes "bytes"
  9. import io "io"
  10. // Reference imports to suppress errors if they are not otherwise used.
  11. var _ = proto.Marshal
  12. var _ = fmt.Errorf
  13. var _ = math.Inf
  14. // This is a compile-time assertion to ensure that this generated file
  15. // is compatible with the proto package it is being compiled against.
  16. // A compilation error at this line likely means your copy of the
  17. // proto package needs to be updated.
  18. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  19. // ProofOp defines an operation used for calculating Merkle root
  20. // The data could be arbitrary format, providing nessecary data
  21. // for example neighbouring node hash
  22. type ProofOp struct {
  23. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
  24. Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  25. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
  26. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  27. XXX_unrecognized []byte `json:"-"`
  28. XXX_sizecache int32 `json:"-"`
  29. }
  30. func (m *ProofOp) Reset() { *m = ProofOp{} }
  31. func (m *ProofOp) String() string { return proto.CompactTextString(m) }
  32. func (*ProofOp) ProtoMessage() {}
  33. func (*ProofOp) Descriptor() ([]byte, []int) {
  34. return fileDescriptor_merkle_5d3f6051907285da, []int{0}
  35. }
  36. func (m *ProofOp) XXX_Unmarshal(b []byte) error {
  37. return m.Unmarshal(b)
  38. }
  39. func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  40. if deterministic {
  41. return xxx_messageInfo_ProofOp.Marshal(b, m, deterministic)
  42. } else {
  43. b = b[:cap(b)]
  44. n, err := m.MarshalTo(b)
  45. if err != nil {
  46. return nil, err
  47. }
  48. return b[:n], nil
  49. }
  50. }
  51. func (dst *ProofOp) XXX_Merge(src proto.Message) {
  52. xxx_messageInfo_ProofOp.Merge(dst, src)
  53. }
  54. func (m *ProofOp) XXX_Size() int {
  55. return m.Size()
  56. }
  57. func (m *ProofOp) XXX_DiscardUnknown() {
  58. xxx_messageInfo_ProofOp.DiscardUnknown(m)
  59. }
  60. var xxx_messageInfo_ProofOp proto.InternalMessageInfo
  61. func (m *ProofOp) GetType() string {
  62. if m != nil {
  63. return m.Type
  64. }
  65. return ""
  66. }
  67. func (m *ProofOp) GetKey() []byte {
  68. if m != nil {
  69. return m.Key
  70. }
  71. return nil
  72. }
  73. func (m *ProofOp) GetData() []byte {
  74. if m != nil {
  75. return m.Data
  76. }
  77. return nil
  78. }
  79. // Proof is Merkle proof defined by the list of ProofOps
  80. type Proof struct {
  81. Ops []ProofOp `protobuf:"bytes,1,rep,name=ops" json:"ops"`
  82. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  83. XXX_unrecognized []byte `json:"-"`
  84. XXX_sizecache int32 `json:"-"`
  85. }
  86. func (m *Proof) Reset() { *m = Proof{} }
  87. func (m *Proof) String() string { return proto.CompactTextString(m) }
  88. func (*Proof) ProtoMessage() {}
  89. func (*Proof) Descriptor() ([]byte, []int) {
  90. return fileDescriptor_merkle_5d3f6051907285da, []int{1}
  91. }
  92. func (m *Proof) XXX_Unmarshal(b []byte) error {
  93. return m.Unmarshal(b)
  94. }
  95. func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  96. if deterministic {
  97. return xxx_messageInfo_Proof.Marshal(b, m, deterministic)
  98. } else {
  99. b = b[:cap(b)]
  100. n, err := m.MarshalTo(b)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return b[:n], nil
  105. }
  106. }
  107. func (dst *Proof) XXX_Merge(src proto.Message) {
  108. xxx_messageInfo_Proof.Merge(dst, src)
  109. }
  110. func (m *Proof) XXX_Size() int {
  111. return m.Size()
  112. }
  113. func (m *Proof) XXX_DiscardUnknown() {
  114. xxx_messageInfo_Proof.DiscardUnknown(m)
  115. }
  116. var xxx_messageInfo_Proof proto.InternalMessageInfo
  117. func (m *Proof) GetOps() []ProofOp {
  118. if m != nil {
  119. return m.Ops
  120. }
  121. return nil
  122. }
  123. func init() {
  124. proto.RegisterType((*ProofOp)(nil), "merkle.ProofOp")
  125. proto.RegisterType((*Proof)(nil), "merkle.Proof")
  126. }
  127. func (this *ProofOp) Equal(that interface{}) bool {
  128. if that == nil {
  129. return this == nil
  130. }
  131. that1, ok := that.(*ProofOp)
  132. if !ok {
  133. that2, ok := that.(ProofOp)
  134. if ok {
  135. that1 = &that2
  136. } else {
  137. return false
  138. }
  139. }
  140. if that1 == nil {
  141. return this == nil
  142. } else if this == nil {
  143. return false
  144. }
  145. if this.Type != that1.Type {
  146. return false
  147. }
  148. if !bytes.Equal(this.Key, that1.Key) {
  149. return false
  150. }
  151. if !bytes.Equal(this.Data, that1.Data) {
  152. return false
  153. }
  154. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  155. return false
  156. }
  157. return true
  158. }
  159. func (this *Proof) Equal(that interface{}) bool {
  160. if that == nil {
  161. return this == nil
  162. }
  163. that1, ok := that.(*Proof)
  164. if !ok {
  165. that2, ok := that.(Proof)
  166. if ok {
  167. that1 = &that2
  168. } else {
  169. return false
  170. }
  171. }
  172. if that1 == nil {
  173. return this == nil
  174. } else if this == nil {
  175. return false
  176. }
  177. if len(this.Ops) != len(that1.Ops) {
  178. return false
  179. }
  180. for i := range this.Ops {
  181. if !this.Ops[i].Equal(&that1.Ops[i]) {
  182. return false
  183. }
  184. }
  185. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  186. return false
  187. }
  188. return true
  189. }
  190. func (m *ProofOp) Marshal() (dAtA []byte, err error) {
  191. size := m.Size()
  192. dAtA = make([]byte, size)
  193. n, err := m.MarshalTo(dAtA)
  194. if err != nil {
  195. return nil, err
  196. }
  197. return dAtA[:n], nil
  198. }
  199. func (m *ProofOp) MarshalTo(dAtA []byte) (int, error) {
  200. var i int
  201. _ = i
  202. var l int
  203. _ = l
  204. if len(m.Type) > 0 {
  205. dAtA[i] = 0xa
  206. i++
  207. i = encodeVarintMerkle(dAtA, i, uint64(len(m.Type)))
  208. i += copy(dAtA[i:], m.Type)
  209. }
  210. if len(m.Key) > 0 {
  211. dAtA[i] = 0x12
  212. i++
  213. i = encodeVarintMerkle(dAtA, i, uint64(len(m.Key)))
  214. i += copy(dAtA[i:], m.Key)
  215. }
  216. if len(m.Data) > 0 {
  217. dAtA[i] = 0x1a
  218. i++
  219. i = encodeVarintMerkle(dAtA, i, uint64(len(m.Data)))
  220. i += copy(dAtA[i:], m.Data)
  221. }
  222. if m.XXX_unrecognized != nil {
  223. i += copy(dAtA[i:], m.XXX_unrecognized)
  224. }
  225. return i, nil
  226. }
  227. func (m *Proof) Marshal() (dAtA []byte, err error) {
  228. size := m.Size()
  229. dAtA = make([]byte, size)
  230. n, err := m.MarshalTo(dAtA)
  231. if err != nil {
  232. return nil, err
  233. }
  234. return dAtA[:n], nil
  235. }
  236. func (m *Proof) MarshalTo(dAtA []byte) (int, error) {
  237. var i int
  238. _ = i
  239. var l int
  240. _ = l
  241. if len(m.Ops) > 0 {
  242. for _, msg := range m.Ops {
  243. dAtA[i] = 0xa
  244. i++
  245. i = encodeVarintMerkle(dAtA, i, uint64(msg.Size()))
  246. n, err := msg.MarshalTo(dAtA[i:])
  247. if err != nil {
  248. return 0, err
  249. }
  250. i += n
  251. }
  252. }
  253. if m.XXX_unrecognized != nil {
  254. i += copy(dAtA[i:], m.XXX_unrecognized)
  255. }
  256. return i, nil
  257. }
  258. func encodeVarintMerkle(dAtA []byte, offset int, v uint64) int {
  259. for v >= 1<<7 {
  260. dAtA[offset] = uint8(v&0x7f | 0x80)
  261. v >>= 7
  262. offset++
  263. }
  264. dAtA[offset] = uint8(v)
  265. return offset + 1
  266. }
  267. func NewPopulatedProofOp(r randyMerkle, easy bool) *ProofOp {
  268. this := &ProofOp{}
  269. this.Type = string(randStringMerkle(r))
  270. v1 := r.Intn(100)
  271. this.Key = make([]byte, v1)
  272. for i := 0; i < v1; i++ {
  273. this.Key[i] = byte(r.Intn(256))
  274. }
  275. v2 := r.Intn(100)
  276. this.Data = make([]byte, v2)
  277. for i := 0; i < v2; i++ {
  278. this.Data[i] = byte(r.Intn(256))
  279. }
  280. if !easy && r.Intn(10) != 0 {
  281. this.XXX_unrecognized = randUnrecognizedMerkle(r, 4)
  282. }
  283. return this
  284. }
  285. func NewPopulatedProof(r randyMerkle, easy bool) *Proof {
  286. this := &Proof{}
  287. if r.Intn(10) != 0 {
  288. v3 := r.Intn(5)
  289. this.Ops = make([]ProofOp, v3)
  290. for i := 0; i < v3; i++ {
  291. v4 := NewPopulatedProofOp(r, easy)
  292. this.Ops[i] = *v4
  293. }
  294. }
  295. if !easy && r.Intn(10) != 0 {
  296. this.XXX_unrecognized = randUnrecognizedMerkle(r, 2)
  297. }
  298. return this
  299. }
  300. type randyMerkle interface {
  301. Float32() float32
  302. Float64() float64
  303. Int63() int64
  304. Int31() int32
  305. Uint32() uint32
  306. Intn(n int) int
  307. }
  308. func randUTF8RuneMerkle(r randyMerkle) rune {
  309. ru := r.Intn(62)
  310. if ru < 10 {
  311. return rune(ru + 48)
  312. } else if ru < 36 {
  313. return rune(ru + 55)
  314. }
  315. return rune(ru + 61)
  316. }
  317. func randStringMerkle(r randyMerkle) string {
  318. v5 := r.Intn(100)
  319. tmps := make([]rune, v5)
  320. for i := 0; i < v5; i++ {
  321. tmps[i] = randUTF8RuneMerkle(r)
  322. }
  323. return string(tmps)
  324. }
  325. func randUnrecognizedMerkle(r randyMerkle, maxFieldNumber int) (dAtA []byte) {
  326. l := r.Intn(5)
  327. for i := 0; i < l; i++ {
  328. wire := r.Intn(4)
  329. if wire == 3 {
  330. wire = 5
  331. }
  332. fieldNumber := maxFieldNumber + r.Intn(100)
  333. dAtA = randFieldMerkle(dAtA, r, fieldNumber, wire)
  334. }
  335. return dAtA
  336. }
  337. func randFieldMerkle(dAtA []byte, r randyMerkle, fieldNumber int, wire int) []byte {
  338. key := uint32(fieldNumber)<<3 | uint32(wire)
  339. switch wire {
  340. case 0:
  341. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
  342. v6 := r.Int63()
  343. if r.Intn(2) == 0 {
  344. v6 *= -1
  345. }
  346. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(v6))
  347. case 1:
  348. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
  349. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  350. case 2:
  351. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
  352. ll := r.Intn(100)
  353. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(ll))
  354. for j := 0; j < ll; j++ {
  355. dAtA = append(dAtA, byte(r.Intn(256)))
  356. }
  357. default:
  358. dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
  359. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  360. }
  361. return dAtA
  362. }
  363. func encodeVarintPopulateMerkle(dAtA []byte, v uint64) []byte {
  364. for v >= 1<<7 {
  365. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  366. v >>= 7
  367. }
  368. dAtA = append(dAtA, uint8(v))
  369. return dAtA
  370. }
  371. func (m *ProofOp) Size() (n int) {
  372. var l int
  373. _ = l
  374. l = len(m.Type)
  375. if l > 0 {
  376. n += 1 + l + sovMerkle(uint64(l))
  377. }
  378. l = len(m.Key)
  379. if l > 0 {
  380. n += 1 + l + sovMerkle(uint64(l))
  381. }
  382. l = len(m.Data)
  383. if l > 0 {
  384. n += 1 + l + sovMerkle(uint64(l))
  385. }
  386. if m.XXX_unrecognized != nil {
  387. n += len(m.XXX_unrecognized)
  388. }
  389. return n
  390. }
  391. func (m *Proof) Size() (n int) {
  392. var l int
  393. _ = l
  394. if len(m.Ops) > 0 {
  395. for _, e := range m.Ops {
  396. l = e.Size()
  397. n += 1 + l + sovMerkle(uint64(l))
  398. }
  399. }
  400. if m.XXX_unrecognized != nil {
  401. n += len(m.XXX_unrecognized)
  402. }
  403. return n
  404. }
  405. func sovMerkle(x uint64) (n int) {
  406. for {
  407. n++
  408. x >>= 7
  409. if x == 0 {
  410. break
  411. }
  412. }
  413. return n
  414. }
  415. func sozMerkle(x uint64) (n int) {
  416. return sovMerkle(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  417. }
  418. func (m *ProofOp) Unmarshal(dAtA []byte) error {
  419. l := len(dAtA)
  420. iNdEx := 0
  421. for iNdEx < l {
  422. preIndex := iNdEx
  423. var wire uint64
  424. for shift := uint(0); ; shift += 7 {
  425. if shift >= 64 {
  426. return ErrIntOverflowMerkle
  427. }
  428. if iNdEx >= l {
  429. return io.ErrUnexpectedEOF
  430. }
  431. b := dAtA[iNdEx]
  432. iNdEx++
  433. wire |= (uint64(b) & 0x7F) << shift
  434. if b < 0x80 {
  435. break
  436. }
  437. }
  438. fieldNum := int32(wire >> 3)
  439. wireType := int(wire & 0x7)
  440. if wireType == 4 {
  441. return fmt.Errorf("proto: ProofOp: wiretype end group for non-group")
  442. }
  443. if fieldNum <= 0 {
  444. return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire)
  445. }
  446. switch fieldNum {
  447. case 1:
  448. if wireType != 2 {
  449. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  450. }
  451. var stringLen uint64
  452. for shift := uint(0); ; shift += 7 {
  453. if shift >= 64 {
  454. return ErrIntOverflowMerkle
  455. }
  456. if iNdEx >= l {
  457. return io.ErrUnexpectedEOF
  458. }
  459. b := dAtA[iNdEx]
  460. iNdEx++
  461. stringLen |= (uint64(b) & 0x7F) << shift
  462. if b < 0x80 {
  463. break
  464. }
  465. }
  466. intStringLen := int(stringLen)
  467. if intStringLen < 0 {
  468. return ErrInvalidLengthMerkle
  469. }
  470. postIndex := iNdEx + intStringLen
  471. if postIndex > l {
  472. return io.ErrUnexpectedEOF
  473. }
  474. m.Type = string(dAtA[iNdEx:postIndex])
  475. iNdEx = postIndex
  476. case 2:
  477. if wireType != 2 {
  478. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  479. }
  480. var byteLen int
  481. for shift := uint(0); ; shift += 7 {
  482. if shift >= 64 {
  483. return ErrIntOverflowMerkle
  484. }
  485. if iNdEx >= l {
  486. return io.ErrUnexpectedEOF
  487. }
  488. b := dAtA[iNdEx]
  489. iNdEx++
  490. byteLen |= (int(b) & 0x7F) << shift
  491. if b < 0x80 {
  492. break
  493. }
  494. }
  495. if byteLen < 0 {
  496. return ErrInvalidLengthMerkle
  497. }
  498. postIndex := iNdEx + byteLen
  499. if postIndex > l {
  500. return io.ErrUnexpectedEOF
  501. }
  502. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  503. if m.Key == nil {
  504. m.Key = []byte{}
  505. }
  506. iNdEx = postIndex
  507. case 3:
  508. if wireType != 2 {
  509. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  510. }
  511. var byteLen int
  512. for shift := uint(0); ; shift += 7 {
  513. if shift >= 64 {
  514. return ErrIntOverflowMerkle
  515. }
  516. if iNdEx >= l {
  517. return io.ErrUnexpectedEOF
  518. }
  519. b := dAtA[iNdEx]
  520. iNdEx++
  521. byteLen |= (int(b) & 0x7F) << shift
  522. if b < 0x80 {
  523. break
  524. }
  525. }
  526. if byteLen < 0 {
  527. return ErrInvalidLengthMerkle
  528. }
  529. postIndex := iNdEx + byteLen
  530. if postIndex > l {
  531. return io.ErrUnexpectedEOF
  532. }
  533. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  534. if m.Data == nil {
  535. m.Data = []byte{}
  536. }
  537. iNdEx = postIndex
  538. default:
  539. iNdEx = preIndex
  540. skippy, err := skipMerkle(dAtA[iNdEx:])
  541. if err != nil {
  542. return err
  543. }
  544. if skippy < 0 {
  545. return ErrInvalidLengthMerkle
  546. }
  547. if (iNdEx + skippy) > l {
  548. return io.ErrUnexpectedEOF
  549. }
  550. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  551. iNdEx += skippy
  552. }
  553. }
  554. if iNdEx > l {
  555. return io.ErrUnexpectedEOF
  556. }
  557. return nil
  558. }
  559. func (m *Proof) Unmarshal(dAtA []byte) error {
  560. l := len(dAtA)
  561. iNdEx := 0
  562. for iNdEx < l {
  563. preIndex := iNdEx
  564. var wire uint64
  565. for shift := uint(0); ; shift += 7 {
  566. if shift >= 64 {
  567. return ErrIntOverflowMerkle
  568. }
  569. if iNdEx >= l {
  570. return io.ErrUnexpectedEOF
  571. }
  572. b := dAtA[iNdEx]
  573. iNdEx++
  574. wire |= (uint64(b) & 0x7F) << shift
  575. if b < 0x80 {
  576. break
  577. }
  578. }
  579. fieldNum := int32(wire >> 3)
  580. wireType := int(wire & 0x7)
  581. if wireType == 4 {
  582. return fmt.Errorf("proto: Proof: wiretype end group for non-group")
  583. }
  584. if fieldNum <= 0 {
  585. return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire)
  586. }
  587. switch fieldNum {
  588. case 1:
  589. if wireType != 2 {
  590. return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType)
  591. }
  592. var msglen int
  593. for shift := uint(0); ; shift += 7 {
  594. if shift >= 64 {
  595. return ErrIntOverflowMerkle
  596. }
  597. if iNdEx >= l {
  598. return io.ErrUnexpectedEOF
  599. }
  600. b := dAtA[iNdEx]
  601. iNdEx++
  602. msglen |= (int(b) & 0x7F) << shift
  603. if b < 0x80 {
  604. break
  605. }
  606. }
  607. if msglen < 0 {
  608. return ErrInvalidLengthMerkle
  609. }
  610. postIndex := iNdEx + msglen
  611. if postIndex > l {
  612. return io.ErrUnexpectedEOF
  613. }
  614. m.Ops = append(m.Ops, ProofOp{})
  615. if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  616. return err
  617. }
  618. iNdEx = postIndex
  619. default:
  620. iNdEx = preIndex
  621. skippy, err := skipMerkle(dAtA[iNdEx:])
  622. if err != nil {
  623. return err
  624. }
  625. if skippy < 0 {
  626. return ErrInvalidLengthMerkle
  627. }
  628. if (iNdEx + skippy) > l {
  629. return io.ErrUnexpectedEOF
  630. }
  631. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  632. iNdEx += skippy
  633. }
  634. }
  635. if iNdEx > l {
  636. return io.ErrUnexpectedEOF
  637. }
  638. return nil
  639. }
  640. func skipMerkle(dAtA []byte) (n int, err error) {
  641. l := len(dAtA)
  642. iNdEx := 0
  643. for iNdEx < l {
  644. var wire uint64
  645. for shift := uint(0); ; shift += 7 {
  646. if shift >= 64 {
  647. return 0, ErrIntOverflowMerkle
  648. }
  649. if iNdEx >= l {
  650. return 0, io.ErrUnexpectedEOF
  651. }
  652. b := dAtA[iNdEx]
  653. iNdEx++
  654. wire |= (uint64(b) & 0x7F) << shift
  655. if b < 0x80 {
  656. break
  657. }
  658. }
  659. wireType := int(wire & 0x7)
  660. switch wireType {
  661. case 0:
  662. for shift := uint(0); ; shift += 7 {
  663. if shift >= 64 {
  664. return 0, ErrIntOverflowMerkle
  665. }
  666. if iNdEx >= l {
  667. return 0, io.ErrUnexpectedEOF
  668. }
  669. iNdEx++
  670. if dAtA[iNdEx-1] < 0x80 {
  671. break
  672. }
  673. }
  674. return iNdEx, nil
  675. case 1:
  676. iNdEx += 8
  677. return iNdEx, nil
  678. case 2:
  679. var length int
  680. for shift := uint(0); ; shift += 7 {
  681. if shift >= 64 {
  682. return 0, ErrIntOverflowMerkle
  683. }
  684. if iNdEx >= l {
  685. return 0, io.ErrUnexpectedEOF
  686. }
  687. b := dAtA[iNdEx]
  688. iNdEx++
  689. length |= (int(b) & 0x7F) << shift
  690. if b < 0x80 {
  691. break
  692. }
  693. }
  694. iNdEx += length
  695. if length < 0 {
  696. return 0, ErrInvalidLengthMerkle
  697. }
  698. return iNdEx, nil
  699. case 3:
  700. for {
  701. var innerWire uint64
  702. var start int = iNdEx
  703. for shift := uint(0); ; shift += 7 {
  704. if shift >= 64 {
  705. return 0, ErrIntOverflowMerkle
  706. }
  707. if iNdEx >= l {
  708. return 0, io.ErrUnexpectedEOF
  709. }
  710. b := dAtA[iNdEx]
  711. iNdEx++
  712. innerWire |= (uint64(b) & 0x7F) << shift
  713. if b < 0x80 {
  714. break
  715. }
  716. }
  717. innerWireType := int(innerWire & 0x7)
  718. if innerWireType == 4 {
  719. break
  720. }
  721. next, err := skipMerkle(dAtA[start:])
  722. if err != nil {
  723. return 0, err
  724. }
  725. iNdEx = start + next
  726. }
  727. return iNdEx, nil
  728. case 4:
  729. return iNdEx, nil
  730. case 5:
  731. iNdEx += 4
  732. return iNdEx, nil
  733. default:
  734. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  735. }
  736. }
  737. panic("unreachable")
  738. }
  739. var (
  740. ErrInvalidLengthMerkle = fmt.Errorf("proto: negative length found during unmarshaling")
  741. ErrIntOverflowMerkle = fmt.Errorf("proto: integer overflow")
  742. )
  743. func init() { proto.RegisterFile("crypto/merkle/merkle.proto", fileDescriptor_merkle_5d3f6051907285da) }
  744. var fileDescriptor_merkle_5d3f6051907285da = []byte{
  745. // 200 bytes of a gzipped FileDescriptorProto
  746. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x2e, 0xaa, 0x2c,
  747. 0x28, 0xc9, 0xd7, 0xcf, 0x4d, 0x2d, 0xca, 0xce, 0x49, 0x85, 0x52, 0x7a, 0x05, 0x45, 0xf9, 0x25,
  748. 0xf9, 0x42, 0x6c, 0x10, 0x9e, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e,
  749. 0xae, 0x7e, 0x7a, 0x7e, 0x7a, 0xbe, 0x3e, 0x58, 0x3a, 0xa9, 0x34, 0x0d, 0xcc, 0x03, 0x73, 0xc0,
  750. 0x2c, 0x88, 0x36, 0x25, 0x67, 0x2e, 0xf6, 0x80, 0xa2, 0xfc, 0xfc, 0x34, 0xff, 0x02, 0x21, 0x21,
  751. 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, 0x48,
  752. 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc4, 0x04, 0xa9,
  753. 0x4a, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x06, 0x0b, 0x81, 0xd9, 0x4a, 0x06, 0x5c, 0xac, 0x60, 0x43,
  754. 0x84, 0xd4, 0xb9, 0x98, 0xf3, 0x0b, 0x8a, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xf8, 0xf5,
  755. 0xa0, 0x0e, 0x84, 0x5a, 0xe0, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x85, 0x93, 0xc8,
  756. 0x8f, 0x87, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c,
  757. 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x49, 0x6c, 0x60, 0x37, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
  758. 0xb9, 0x2b, 0x0f, 0xd1, 0xe8, 0x00, 0x00, 0x00,
  759. }