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.

798 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_24be8bc4e405ac66, []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_24be8bc4e405ac66, []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. if m == nil {
  373. return 0
  374. }
  375. var l int
  376. _ = l
  377. l = len(m.Type)
  378. if l > 0 {
  379. n += 1 + l + sovMerkle(uint64(l))
  380. }
  381. l = len(m.Key)
  382. if l > 0 {
  383. n += 1 + l + sovMerkle(uint64(l))
  384. }
  385. l = len(m.Data)
  386. if l > 0 {
  387. n += 1 + l + sovMerkle(uint64(l))
  388. }
  389. if m.XXX_unrecognized != nil {
  390. n += len(m.XXX_unrecognized)
  391. }
  392. return n
  393. }
  394. func (m *Proof) Size() (n int) {
  395. if m == nil {
  396. return 0
  397. }
  398. var l int
  399. _ = l
  400. if len(m.Ops) > 0 {
  401. for _, e := range m.Ops {
  402. l = e.Size()
  403. n += 1 + l + sovMerkle(uint64(l))
  404. }
  405. }
  406. if m.XXX_unrecognized != nil {
  407. n += len(m.XXX_unrecognized)
  408. }
  409. return n
  410. }
  411. func sovMerkle(x uint64) (n int) {
  412. for {
  413. n++
  414. x >>= 7
  415. if x == 0 {
  416. break
  417. }
  418. }
  419. return n
  420. }
  421. func sozMerkle(x uint64) (n int) {
  422. return sovMerkle(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  423. }
  424. func (m *ProofOp) Unmarshal(dAtA []byte) error {
  425. l := len(dAtA)
  426. iNdEx := 0
  427. for iNdEx < l {
  428. preIndex := iNdEx
  429. var wire uint64
  430. for shift := uint(0); ; shift += 7 {
  431. if shift >= 64 {
  432. return ErrIntOverflowMerkle
  433. }
  434. if iNdEx >= l {
  435. return io.ErrUnexpectedEOF
  436. }
  437. b := dAtA[iNdEx]
  438. iNdEx++
  439. wire |= (uint64(b) & 0x7F) << shift
  440. if b < 0x80 {
  441. break
  442. }
  443. }
  444. fieldNum := int32(wire >> 3)
  445. wireType := int(wire & 0x7)
  446. if wireType == 4 {
  447. return fmt.Errorf("proto: ProofOp: wiretype end group for non-group")
  448. }
  449. if fieldNum <= 0 {
  450. return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire)
  451. }
  452. switch fieldNum {
  453. case 1:
  454. if wireType != 2 {
  455. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  456. }
  457. var stringLen uint64
  458. for shift := uint(0); ; shift += 7 {
  459. if shift >= 64 {
  460. return ErrIntOverflowMerkle
  461. }
  462. if iNdEx >= l {
  463. return io.ErrUnexpectedEOF
  464. }
  465. b := dAtA[iNdEx]
  466. iNdEx++
  467. stringLen |= (uint64(b) & 0x7F) << shift
  468. if b < 0x80 {
  469. break
  470. }
  471. }
  472. intStringLen := int(stringLen)
  473. if intStringLen < 0 {
  474. return ErrInvalidLengthMerkle
  475. }
  476. postIndex := iNdEx + intStringLen
  477. if postIndex > l {
  478. return io.ErrUnexpectedEOF
  479. }
  480. m.Type = string(dAtA[iNdEx:postIndex])
  481. iNdEx = postIndex
  482. case 2:
  483. if wireType != 2 {
  484. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  485. }
  486. var byteLen int
  487. for shift := uint(0); ; shift += 7 {
  488. if shift >= 64 {
  489. return ErrIntOverflowMerkle
  490. }
  491. if iNdEx >= l {
  492. return io.ErrUnexpectedEOF
  493. }
  494. b := dAtA[iNdEx]
  495. iNdEx++
  496. byteLen |= (int(b) & 0x7F) << shift
  497. if b < 0x80 {
  498. break
  499. }
  500. }
  501. if byteLen < 0 {
  502. return ErrInvalidLengthMerkle
  503. }
  504. postIndex := iNdEx + byteLen
  505. if postIndex > l {
  506. return io.ErrUnexpectedEOF
  507. }
  508. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  509. if m.Key == nil {
  510. m.Key = []byte{}
  511. }
  512. iNdEx = postIndex
  513. case 3:
  514. if wireType != 2 {
  515. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  516. }
  517. var byteLen int
  518. for shift := uint(0); ; shift += 7 {
  519. if shift >= 64 {
  520. return ErrIntOverflowMerkle
  521. }
  522. if iNdEx >= l {
  523. return io.ErrUnexpectedEOF
  524. }
  525. b := dAtA[iNdEx]
  526. iNdEx++
  527. byteLen |= (int(b) & 0x7F) << shift
  528. if b < 0x80 {
  529. break
  530. }
  531. }
  532. if byteLen < 0 {
  533. return ErrInvalidLengthMerkle
  534. }
  535. postIndex := iNdEx + byteLen
  536. if postIndex > l {
  537. return io.ErrUnexpectedEOF
  538. }
  539. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  540. if m.Data == nil {
  541. m.Data = []byte{}
  542. }
  543. iNdEx = postIndex
  544. default:
  545. iNdEx = preIndex
  546. skippy, err := skipMerkle(dAtA[iNdEx:])
  547. if err != nil {
  548. return err
  549. }
  550. if skippy < 0 {
  551. return ErrInvalidLengthMerkle
  552. }
  553. if (iNdEx + skippy) > l {
  554. return io.ErrUnexpectedEOF
  555. }
  556. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  557. iNdEx += skippy
  558. }
  559. }
  560. if iNdEx > l {
  561. return io.ErrUnexpectedEOF
  562. }
  563. return nil
  564. }
  565. func (m *Proof) Unmarshal(dAtA []byte) error {
  566. l := len(dAtA)
  567. iNdEx := 0
  568. for iNdEx < l {
  569. preIndex := iNdEx
  570. var wire uint64
  571. for shift := uint(0); ; shift += 7 {
  572. if shift >= 64 {
  573. return ErrIntOverflowMerkle
  574. }
  575. if iNdEx >= l {
  576. return io.ErrUnexpectedEOF
  577. }
  578. b := dAtA[iNdEx]
  579. iNdEx++
  580. wire |= (uint64(b) & 0x7F) << shift
  581. if b < 0x80 {
  582. break
  583. }
  584. }
  585. fieldNum := int32(wire >> 3)
  586. wireType := int(wire & 0x7)
  587. if wireType == 4 {
  588. return fmt.Errorf("proto: Proof: wiretype end group for non-group")
  589. }
  590. if fieldNum <= 0 {
  591. return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire)
  592. }
  593. switch fieldNum {
  594. case 1:
  595. if wireType != 2 {
  596. return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType)
  597. }
  598. var msglen int
  599. for shift := uint(0); ; shift += 7 {
  600. if shift >= 64 {
  601. return ErrIntOverflowMerkle
  602. }
  603. if iNdEx >= l {
  604. return io.ErrUnexpectedEOF
  605. }
  606. b := dAtA[iNdEx]
  607. iNdEx++
  608. msglen |= (int(b) & 0x7F) << shift
  609. if b < 0x80 {
  610. break
  611. }
  612. }
  613. if msglen < 0 {
  614. return ErrInvalidLengthMerkle
  615. }
  616. postIndex := iNdEx + msglen
  617. if postIndex > l {
  618. return io.ErrUnexpectedEOF
  619. }
  620. m.Ops = append(m.Ops, ProofOp{})
  621. if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  622. return err
  623. }
  624. iNdEx = postIndex
  625. default:
  626. iNdEx = preIndex
  627. skippy, err := skipMerkle(dAtA[iNdEx:])
  628. if err != nil {
  629. return err
  630. }
  631. if skippy < 0 {
  632. return ErrInvalidLengthMerkle
  633. }
  634. if (iNdEx + skippy) > l {
  635. return io.ErrUnexpectedEOF
  636. }
  637. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  638. iNdEx += skippy
  639. }
  640. }
  641. if iNdEx > l {
  642. return io.ErrUnexpectedEOF
  643. }
  644. return nil
  645. }
  646. func skipMerkle(dAtA []byte) (n int, err error) {
  647. l := len(dAtA)
  648. iNdEx := 0
  649. for iNdEx < l {
  650. var wire uint64
  651. for shift := uint(0); ; shift += 7 {
  652. if shift >= 64 {
  653. return 0, ErrIntOverflowMerkle
  654. }
  655. if iNdEx >= l {
  656. return 0, io.ErrUnexpectedEOF
  657. }
  658. b := dAtA[iNdEx]
  659. iNdEx++
  660. wire |= (uint64(b) & 0x7F) << shift
  661. if b < 0x80 {
  662. break
  663. }
  664. }
  665. wireType := int(wire & 0x7)
  666. switch wireType {
  667. case 0:
  668. for shift := uint(0); ; shift += 7 {
  669. if shift >= 64 {
  670. return 0, ErrIntOverflowMerkle
  671. }
  672. if iNdEx >= l {
  673. return 0, io.ErrUnexpectedEOF
  674. }
  675. iNdEx++
  676. if dAtA[iNdEx-1] < 0x80 {
  677. break
  678. }
  679. }
  680. return iNdEx, nil
  681. case 1:
  682. iNdEx += 8
  683. return iNdEx, nil
  684. case 2:
  685. var length int
  686. for shift := uint(0); ; shift += 7 {
  687. if shift >= 64 {
  688. return 0, ErrIntOverflowMerkle
  689. }
  690. if iNdEx >= l {
  691. return 0, io.ErrUnexpectedEOF
  692. }
  693. b := dAtA[iNdEx]
  694. iNdEx++
  695. length |= (int(b) & 0x7F) << shift
  696. if b < 0x80 {
  697. break
  698. }
  699. }
  700. iNdEx += length
  701. if length < 0 {
  702. return 0, ErrInvalidLengthMerkle
  703. }
  704. return iNdEx, nil
  705. case 3:
  706. for {
  707. var innerWire uint64
  708. var start int = iNdEx
  709. for shift := uint(0); ; shift += 7 {
  710. if shift >= 64 {
  711. return 0, ErrIntOverflowMerkle
  712. }
  713. if iNdEx >= l {
  714. return 0, io.ErrUnexpectedEOF
  715. }
  716. b := dAtA[iNdEx]
  717. iNdEx++
  718. innerWire |= (uint64(b) & 0x7F) << shift
  719. if b < 0x80 {
  720. break
  721. }
  722. }
  723. innerWireType := int(innerWire & 0x7)
  724. if innerWireType == 4 {
  725. break
  726. }
  727. next, err := skipMerkle(dAtA[start:])
  728. if err != nil {
  729. return 0, err
  730. }
  731. iNdEx = start + next
  732. }
  733. return iNdEx, nil
  734. case 4:
  735. return iNdEx, nil
  736. case 5:
  737. iNdEx += 4
  738. return iNdEx, nil
  739. default:
  740. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  741. }
  742. }
  743. panic("unreachable")
  744. }
  745. var (
  746. ErrInvalidLengthMerkle = fmt.Errorf("proto: negative length found during unmarshaling")
  747. ErrIntOverflowMerkle = fmt.Errorf("proto: integer overflow")
  748. )
  749. func init() { proto.RegisterFile("crypto/merkle/merkle.proto", fileDescriptor_merkle_24be8bc4e405ac66) }
  750. var fileDescriptor_merkle_24be8bc4e405ac66 = []byte{
  751. // 200 bytes of a gzipped FileDescriptorProto
  752. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x2e, 0xaa, 0x2c,
  753. 0x28, 0xc9, 0xd7, 0xcf, 0x4d, 0x2d, 0xca, 0xce, 0x49, 0x85, 0x52, 0x7a, 0x05, 0x45, 0xf9, 0x25,
  754. 0xf9, 0x42, 0x6c, 0x10, 0x9e, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e,
  755. 0xae, 0x7e, 0x7a, 0x7e, 0x7a, 0xbe, 0x3e, 0x58, 0x3a, 0xa9, 0x34, 0x0d, 0xcc, 0x03, 0x73, 0xc0,
  756. 0x2c, 0x88, 0x36, 0x25, 0x67, 0x2e, 0xf6, 0x80, 0xa2, 0xfc, 0xfc, 0x34, 0xff, 0x02, 0x21, 0x21,
  757. 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, 0x48,
  758. 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc4, 0x04, 0xa9,
  759. 0x4a, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x06, 0x0b, 0x81, 0xd9, 0x4a, 0x06, 0x5c, 0xac, 0x60, 0x43,
  760. 0x84, 0xd4, 0xb9, 0x98, 0xf3, 0x0b, 0x8a, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xf8, 0xf5,
  761. 0xa0, 0x0e, 0x84, 0x5a, 0xe0, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x85, 0x93, 0xc8,
  762. 0x8f, 0x87, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c,
  763. 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x49, 0x6c, 0x60, 0x37, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
  764. 0xb9, 0x2b, 0x0f, 0xd1, 0xe8, 0x00, 0x00, 0x00,
  765. }