-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathethereumjs-wallet-0.6.0.min.js
1420 lines (1219 loc) · 444 KB
/
ethereumjs-wallet-0.6.0.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethereumjs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var asn1=exports;asn1.bignum=require("bn.js"),asn1.define=require("./asn1/api").define,asn1.base=require("./asn1/base"),asn1.constants=require("./asn1/constants"),asn1.decoders=require("./asn1/decoders"),asn1.encoders=require("./asn1/encoders");
},{"./asn1/api":2,"./asn1/base":4,"./asn1/constants":8,"./asn1/decoders":10,"./asn1/encoders":13,"bn.js":19}],2:[function(require,module,exports){
function Entity(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}var asn1=require("../asn1"),inherits=require("inherits"),api=exports;api.define=function(e,t){return new Entity(e,t)},Entity.prototype._createNamed=function(e){var t;try{t=require("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return inherits(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},Entity.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(asn1.decoders[e])),this.decoders[e]},Entity.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},Entity.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(asn1.encoders[e])),this.encoders[e]},Entity.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)};
},{"../asn1":1,"inherits":115,"vm":192}],3:[function(require,module,exports){
function DecoderBuffer(e,t){Reporter.call(this,t),Buffer.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function EncoderBuffer(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof EncoderBuffer||(e=new EncoderBuffer(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=Buffer.byteLength(e);else{if(!Buffer.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var inherits=require("inherits"),Reporter=require("../base").Reporter,Buffer=require("buffer").Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(e){var t=new DecoderBuffer(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Reporter.prototype.restore.call(this,e.reporter),t},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},DecoderBuffer.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(e,t){return e||(e=new Buffer(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):Buffer.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)};
},{"../base":4,"buffer":53,"inherits":115}],4:[function(require,module,exports){
var base=exports;base.Reporter=require("./reporter").Reporter,base.DecoderBuffer=require("./buffer").DecoderBuffer,base.EncoderBuffer=require("./buffer").EncoderBuffer,base.Node=require("./node");
},{"./buffer":3,"./node":5,"./reporter":6}],5:[function(require,module,exports){
function Node(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var Reporter=require("../base").Reporter,EncoderBuffer=require("../base").EncoderBuffer,DecoderBuffer=require("../base").DecoderBuffer,assert=require("minimalistic-assert"),tags=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];module.exports=Node;var stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function(){var e=this._baseState,t={};stateProps.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},Node.prototype._wrap=function(){var e=this._baseState;methods.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},Node.prototype._init=function(e){var t=this._baseState;assert(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),assert.equal(t.children.length,1,"Root node can have only one child")},Node.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(assert(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(assert(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var i=e[r];t[i]=r}),t}))},overrided.forEach(function(e){Node.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),tags.forEach(function(e){Node.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return assert(null===t.tag),t.tag=e,this._useArgs(r),this}}),Node.prototype.use=function(e){assert(e);var t=this._baseState;return assert(null===t.use),t.use=e,this},Node.prototype.optional=function(){return this._baseState.optional=!0,this},Node.prototype.def=function(e){var t=this._baseState;return assert(null===t.default),t.default=e,t.optional=!0,this},Node.prototype.explicit=function(e){var t=this._baseState;return assert(null===t.explicit&&null===t.implicit),t.explicit=e,this},Node.prototype.implicit=function(e){var t=this._baseState;return assert(null===t.explicit&&null===t.implicit),t.implicit=e,this},Node.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},Node.prototype.key=function(e){var t=this._baseState;return assert(null===t.key),t.key=e,this},Node.prototype.any=function(){return this._baseState.any=!0,this},Node.prototype.choice=function(e){var t=this._baseState;return assert(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},Node.prototype.contains=function(e){var t=this._baseState;return assert(null===t.use),t.contains=e,this},Node.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var i=r.default,n=!0,o=null;if(null!==r.key&&(o=e.enterKey(r.key)),r.optional){var s=null;if(null!==r.explicit?s=r.explicit:null!==r.implicit?s=r.implicit:null!==r.tag&&(s=r.tag),null!==s||r.any){if(n=this._peekTag(e,s,r.any),e.isError(n))return n}else{u=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),n=!0}catch(e){n=!1}e.restore(u)}}var a;if(r.obj&&n&&(a=e.enterObject()),n){if(null!==r.explicit){var c=this._decodeTag(e,r.explicit);if(e.isError(c))return c;e=c}var l=e.offset;if(null===r.use&&null===r.choice){if(r.any)var u=e.save();var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?i=e.raw(u):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),i=r.any?i:null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var h=new DecoderBuffer(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(h,t)}}return r.obj&&n&&(i=e.leaveObject(a)),null===r.key||null===i&&!0!==n?null!==o&&e.exitKey(o):e.leaveKey(o,r.key,i),i},Node.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},Node.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),assert(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},Node.prototype._decodeChoice=function(e,t){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some(function(o){var s=e.save(),a=r.choice[o];try{var c=a._decode(e,t);if(e.isError(c))return!1;i={type:o,value:c},n=!0}catch(t){return e.restore(s),!1}return!0},this),n?i:e.error("Choice not matched")},Node.prototype._createEncoderBuffer=function(e){return new EncoderBuffer(e,this.reporter)},Node.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var n=this._encodeValue(e,t,r);if(void 0!==n&&!this._skipDefault(n,t,r))return n}},Node.prototype._encodeValue=function(e,t,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new Reporter);a=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var n=null,o=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)n=this._getUse(i.contains,r)._encode(e,t),o=!0;else if(i.children)n=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),n},this).filter(function(e){return e}),n=this._createEncoderBuffer(n);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var s=this.clone();s._baseState.implicit=null,n=this._createEncoderBuffer(e.map(function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)},s))}else null!==i.use?a=this._getUse(i.use,r)._encode(e,t):(n=this._encodePrimitive(i.tag,e),o=!0);var a;if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,l=null===i.implicit?"universal":"context";null===c?null===i.use&&t.error("Tag could be ommited only for .use()"):null===i.use&&(a=this._encodeComposite(c,o,l,n))}return null!==i.explicit&&(a=this._encodeComposite(i.explicit,!1,"context",a)),a},Node.prototype._encodeChoice=function(e,t){var r=this._baseState,i=r.choice[e.type];return i||assert(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},Node.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},Node.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},Node.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)};
},{"../base":4,"minimalistic-assert":130}],6:[function(require,module,exports){
function Reporter(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function ReporterError(r,t){this.path=r,this.rethrow(t)}var inherits=require("inherits");exports.Reporter=Reporter,Reporter.prototype.isError=function(r){return r instanceof ReporterError},Reporter.prototype.save=function(){var r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},Reporter.prototype.restore=function(r){var t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},Reporter.prototype.enterKey=function(r){return this._reporterState.path.push(r)},Reporter.prototype.exitKey=function(r){var t=this._reporterState;t.path=t.path.slice(0,r-1)},Reporter.prototype.leaveKey=function(r,t,e){var o=this._reporterState;this.exitKey(r),null!==o.obj&&(o.obj[t]=e)},Reporter.prototype.path=function(){return this._reporterState.path.join("/")},Reporter.prototype.enterObject=function(){var r=this._reporterState,t=r.obj;return r.obj={},t},Reporter.prototype.leaveObject=function(r){var t=this._reporterState,e=t.obj;return t.obj=r,e},Reporter.prototype.error=function(r){var t,e=this._reporterState,o=r instanceof ReporterError;if(t=o?r:new ReporterError(e.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return o||e.errors.push(t),t},Reporter.prototype.wrapResult=function(r){var t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},inherits(ReporterError,Error),ReporterError.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this};
},{"inherits":115}],7:[function(require,module,exports){
var constants=require("../constants");exports.tagClass={0:"universal",1:"application",2:"context",3:"private"},exports.tagClassByName=constants._reverse(exports.tagClass),exports.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},exports.tagByName=constants._reverse(exports.tag);
},{"../constants":8}],8:[function(require,module,exports){
var constants=exports;constants._reverse=function(r){var e={};return Object.keys(r).forEach(function(n){(0|n)==n&&(n|=0);var t=r[n];e[t]=n}),e},constants.der=require("./der");
},{"./der":7}],9:[function(require,module,exports){
function DERDecoder(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new DERNode,this.tree._init(r.body)}function DERNode(r){base.Node.call(this,"der",r)}function derDecodeTag(r,e){var t=r.readUInt8(e);if(r.isError(t))return t;var i=der.tagClass[t>>6],o=0==(32&t);if(31==(31&t)){var n=t;for(t=0;128==(128&n);){if(n=r.readUInt8(e),r.isError(n))return n;t<<=7,t|=127&n}}else t&=31;return{cls:i,primitive:o,tag:t,tagStr:der.tag[t]}}function derDecodeLen(r,e,t){var i=r.readUInt8(t);if(r.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var o=127&i;if(o>4)return r.error("length octect is too long");i=0;for(var n=0;n<o;n++){i<<=8;var s=r.readUInt8(t);if(r.isError(s))return s;i|=s}return i}var inherits=require("inherits"),asn1=require("../../asn1"),base=asn1.base,bignum=asn1.bignum,der=asn1.constants.der;module.exports=DERDecoder,DERDecoder.prototype.decode=function(r,e){return r instanceof base.DecoderBuffer||(r=new base.DecoderBuffer(r,e)),this.tree._decode(r,e)},inherits(DERNode,base.Node),DERNode.prototype._peekTag=function(r,e,t){if(r.isEmpty())return!1;var i=r.save(),o=derDecodeTag(r,'Failed to peek tag: "'+e+'"');return r.isError(o)?o:(r.restore(i),o.tag===e||o.tagStr===e||o.tagStr+"of"===e||t)},DERNode.prototype._decodeTag=function(r,e,t){var i=derDecodeTag(r,'Failed to decode tag of "'+e+'"');if(r.isError(i))return i;var o=derDecodeLen(r,i.primitive,'Failed to get length of "'+e+'"');if(r.isError(o))return o;if(!t&&i.tag!==e&&i.tagStr!==e&&i.tagStr+"of"!==e)return r.error('Failed to match tag: "'+e+'"');if(i.primitive||null!==o)return r.skip(o,'Failed to match body of: "'+e+'"');var n=r.save(),s=this._skipUntilEnd(r,'Failed to skip indefinite length body: "'+this.tag+'"');return r.isError(s)?s:(o=r.offset-n.offset,r.restore(n),r.skip(o,'Failed to match body of: "'+e+'"'))},DERNode.prototype._skipUntilEnd=function(r,e){for(;;){var t=derDecodeTag(r,e);if(r.isError(t))return t;var i=derDecodeLen(r,t.primitive,e);if(r.isError(i))return i;var o;if(o=t.primitive||null!==i?r.skip(i):this._skipUntilEnd(r,e),r.isError(o))return o;if("end"===t.tagStr)break}},DERNode.prototype._decodeList=function(r,e,t,i){for(var o=[];!r.isEmpty();){var n=this._peekTag(r,"end");if(r.isError(n))return n;var s=t.decode(r,"der",i);if(r.isError(s)&&n)break;o.push(s)}return o},DERNode.prototype._decodeStr=function(r,e){if("bitstr"===e){var t=r.readUInt8();return r.isError(t)?t:{unused:t,data:r.raw()}}if("bmpstr"===e){var i=r.raw();if(i.length%2==1)return r.error("Decoding of string type: bmpstr length mismatch");for(var o="",n=0;n<i.length/2;n++)o+=String.fromCharCode(i.readUInt16BE(2*n));return o}if("numstr"===e){var s=r.raw().toString("ascii");return this._isNumstr(s)?s:r.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return r.raw();if("objDesc"===e)return r.raw();if("printstr"===e){var a=r.raw().toString("ascii");return this._isPrintstr(a)?a:r.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?r.raw().toString():r.error("Decoding of string type: "+e+" unsupported")},DERNode.prototype._decodeObjid=function(r,e,t){for(var i,o=[],n=0;!r.isEmpty();){var s=r.readUInt8();n<<=7,n|=127&s,0==(128&s)&&(o.push(n),n=0)}128&s&&o.push(n);var a=o[0]/40|0,d=o[0]%40;if(i=t?o:[a,d].concat(o.slice(1)),e){var u=e[i.join(" ")];void 0===u&&(u=e[i.join(".")]),void 0!==u&&(i=u)}return i},DERNode.prototype._decodeTime=function(r,e){var t=r.raw().toString();if("gentime"===e)var i=0|t.slice(0,4),o=0|t.slice(4,6),n=0|t.slice(6,8),s=0|t.slice(8,10),a=0|t.slice(10,12),d=0|t.slice(12,14);else{if("utctime"!==e)return r.error("Decoding "+e+" time is not supported yet");var i=0|t.slice(0,2),o=0|t.slice(2,4),n=0|t.slice(4,6),s=0|t.slice(6,8),a=0|t.slice(8,10),d=0|t.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,o-1,n,s,a,d,0)},DERNode.prototype._decodeNull=function(r){return null},DERNode.prototype._decodeBool=function(r){var e=r.readUInt8();return r.isError(e)?e:0!==e},DERNode.prototype._decodeInt=function(r,e){var t=r.raw(),i=new bignum(t);return e&&(i=e[i.toString(10)]||i),i},DERNode.prototype._use=function(r,e){return"function"==typeof r&&(r=r(e)),r._getDecoder("der").tree};
},{"../../asn1":1,"inherits":115}],10:[function(require,module,exports){
var decoders=exports;decoders.der=require("./der"),decoders.pem=require("./pem");
},{"./der":9,"./pem":11}],11:[function(require,module,exports){
function PEMDecoder(e){DERDecoder.call(this,e),this.enc="pem"}var inherits=require("inherits"),Buffer=require("buffer").Buffer,DERDecoder=require("./der");inherits(PEMDecoder,DERDecoder),module.exports=PEMDecoder,PEMDecoder.prototype.decode=function(e,r){for(var o=e.toString().split(/[\r\n]+/g),i=r.label.toUpperCase(),t=/^-----(BEGIN|END) ([^-]+)-----$/,c=-1,n=-1,f=0;f<o.length;f++){var a=o[f].match(t);if(null!==a&&a[2]===i){if(-1!==c){if("END"!==a[1])break;n=f;break}if("BEGIN"!==a[1])break;c=f}}if(-1===c||-1===n)throw new Error("PEM section not found for: "+i);var d=o.slice(c+1,n).join("");d.replace(/[^a-z0-9\+\/=]+/gi,"");var D=new Buffer(d,"base64");return DERDecoder.prototype.decode.call(this,D,r)};
},{"./der":9,"buffer":53,"inherits":115}],12:[function(require,module,exports){
function DEREncoder(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new DERNode,this.tree._init(e.body)}function DERNode(e){base.Node.call(this,"der",e)}function two(e){return e<10?"0"+e:e}function encodeTag(e,r,t,n){var o;if("seqof"===e?e="seq":"setof"===e&&(e="set"),der.tagByName.hasOwnProperty(e))o=der.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);o=e}return o>=31?n.error("Multi-octet tag encoding unsupported"):(r||(o|=32),o|=der.tagClassByName[t||"universal"]<<6)}var inherits=require("inherits"),Buffer=require("buffer").Buffer,asn1=require("../../asn1"),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(e,r){return this.tree._encode(e,r).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(e,r,t,n){var o=encodeTag(e,r,t,this.reporter);if(n.length<128)return(s=new Buffer(2))[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n]);for(var i=1,f=n.length;f>=256;f>>=8)i++;var s=new Buffer(2+i);s[0]=o,s[1]=128|i;for(var f=1+i,u=n.length;u>0;f--,u>>=8)s[f]=255&u;return this._createEncoderBuffer([s,n])},DERNode.prototype._encodeStr=function(e,r){if("bitstr"===r)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){for(var t=new Buffer(2*e.length),n=0;n<e.length;n++)t.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(t)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)?this._createEncoderBuffer(e):"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},DERNode.prototype._encodeObjid=function(e,r,t){if("string"==typeof e){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s\.]+/g);for(o=0;o<e.length;o++)e[o]|=0}else if(Array.isArray(e)){e=e.slice();for(o=0;o<e.length;o++)e[o]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!t){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var n=0,o=0;o<e.length;o++){s=e[o];for(n++;s>=128;s>>=7)n++}for(var i=new Buffer(n),f=i.length-1,o=e.length-1;o>=0;o--){var s=e[o];for(i[f--]=127&s;(s>>=7)>0;)i[f--]=128|127&s}return this._createEncoderBuffer(i)},DERNode.prototype._encodeTime=function(e,r){var t,n=new Date(e);return"gentime"===r?t=[two(n.getFullYear()),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join(""):"utctime"===r?t=[two(n.getFullYear()%100),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(t,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(e,r){if("string"==typeof e){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeof e&&!Buffer.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new Buffer(t)}if(Buffer.isBuffer(e)){o=e.length;0===e.length&&o++;var n=new Buffer(o);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var o=1,i=e;i>=256;i>>=8)o++;for(i=(n=new Array(o)).length-1;i>=0;i--)n[i]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new Buffer(n))},DERNode.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},DERNode.prototype._use=function(e,r){return"function"==typeof e&&(e=e(r)),e._getEncoder("der").tree},DERNode.prototype._skipDefault=function(e,r,t){var n,o=this._baseState;if(null===o.default)return!1;var i=e.join();if(void 0===o.defaultBuffer&&(o.defaultBuffer=this._encodeValue(o.default,r,t).join()),i.length!==o.defaultBuffer.length)return!1;for(n=0;n<i.length;n++)if(i[n]!==o.defaultBuffer[n])return!1;return!0};
},{"../../asn1":1,"buffer":53,"inherits":115}],13:[function(require,module,exports){
var encoders=exports;encoders.der=require("./der"),encoders.pem=require("./pem");
},{"./der":12,"./pem":14}],14:[function(require,module,exports){
function PEMEncoder(e){DEREncoder.call(this,e),this.enc="pem"}var inherits=require("inherits"),DEREncoder=require("./der");inherits(PEMEncoder,DEREncoder),module.exports=PEMEncoder,PEMEncoder.prototype.encode=function(e,r){for(var n=DEREncoder.prototype.encode.call(this,e).toString("base64"),o=["-----BEGIN "+r.label+"-----"],E=0;E<n.length;E+=64)o.push(n.slice(E,E+64));return o.push("-----END "+r.label+"-----"),o.join("\n")};
},{"./der":12,"inherits":115}],15:[function(require,module,exports){
(function (global){
"use strict";function compare(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function isBuffer(e){return global.Buffer&&"function"==typeof global.Buffer.isBuffer?global.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}function pToString(e){return Object.prototype.toString.call(e)}function isView(e){return!isBuffer(e)&&("function"==typeof global.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}function getName(e){if(util.isFunction(e)){if(functionsHaveNames)return e.name;var t=e.toString().match(regex);return t&&t[1]}}function truncate(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function inspect(e){if(functionsHaveNames||!util.isFunction(e))return util.inspect(e);var t=getName(e);return"[Function"+(t?": "+t:"")+"]"}function getMessage(e){return truncate(inspect(e.actual),128)+" "+e.operator+" "+truncate(inspect(e.expected),128)}function fail(e,t,r,n,i){throw new assert.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function ok(e,t){e||fail(e,!0,t,"==",assert.ok)}function _deepEqual(e,t,r,n){if(e===t)return!0;if(isBuffer(e)&&isBuffer(t))return 0===compare(e,t);if(util.isDate(e)&&util.isDate(t))return e.getTime()===t.getTime();if(util.isRegExp(e)&&util.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(isView(e)&&isView(t)&&pToString(e)===pToString(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===compare(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(isBuffer(e)!==isBuffer(t))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),objEquiv(e,t,r,n))}return r?e===t:e==t}function isArguments(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function objEquiv(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(util.isPrimitive(e)||util.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=isArguments(e),a=isArguments(t);if(i&&!a||!i&&a)return!1;if(i)return e=pSlice.call(e),t=pSlice.call(t),_deepEqual(e,t,r);var s,o,u=objectKeys(e),f=objectKeys(t);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),o=u.length-1;o>=0;o--)if(u[o]!==f[o])return!1;for(o=u.length-1;o>=0;o--)if(s=u[o],!_deepEqual(e[s],t[s],r,n))return!1;return!0}function notDeepStrictEqual(e,t,r){_deepEqual(e,t,!0)&&fail(e,t,r,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _tryBlock(e){var t;try{e()}catch(e){t=e}return t}function _throws(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=_tryBlock(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&fail(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&util.isError(i),o=!e&&i&&!r;if((s&&a&&expectedException(i,r)||o)&&fail(i,r,"Got unwanted exception"+n),e&&i&&r&&!expectedException(i,r)||!e&&i)throw i}var util=require("util/"),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames="foo"===function(){}.name,assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var t=e.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=getName(t),a=n.indexOf("\n"+i);if(a>=0){var s=n.indexOf("\n",a+1);n=n.substring(s+1)}this.stack=n}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(e,t,r){e!=t&&fail(e,t,r,"==",assert.equal)},assert.notEqual=function(e,t,r){e==t&&fail(e,t,r,"!=",assert.notEqual)},assert.deepEqual=function(e,t,r){_deepEqual(e,t,!1)||fail(e,t,r,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(e,t,r){_deepEqual(e,t,!0)||fail(e,t,r,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(e,t,r){_deepEqual(e,t,!1)&&fail(e,t,r,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(e,t,r){e!==t&&fail(e,t,r,"===",assert.strictEqual)},assert.notStrictEqual=function(e,t,r){e===t&&fail(e,t,r,"!==",assert.notStrictEqual)},assert.throws=function(e,t,r){_throws(!0,e,t,r)},assert.doesNotThrow=function(e,t,r){_throws(!1,e,t,r)},assert.ifError=function(e){if(e)throw e};var objectKeys=Object.keys||function(e){var t=[];for(var r in e)hasOwn.call(e,r)&&t.push(r);return t};
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"util/":189}],16:[function(require,module,exports){
module.exports=function(r){function e(r){if(0===r.length)return[];for(var e=[0],f=0;f<r.length;f++){var h=n[r[f]];if(void 0===h)return;for(var a=0,u=h;a<e.length;++a)u+=e[a]*t,e[a]=255&u,u>>=8;for(;u>0;)e.push(255&u),u>>=8}for(var l=0;r[l]===o&&l<r.length-1;++l)e.push(0);return e.reverse()}for(var n={},t=r.length,o=r.charAt(0),f=0;f<r.length;f++)n[r.charAt(f)]=f;return{encode:function(e){if(0===e.length)return"";for(var n=[0],o=0;o<e.length;++o){for(var f=0,h=e[o];f<n.length;++f)h+=n[f]<<8,n[f]=h%t,h=h/t|0;for(;h>0;)n.push(h%t),h=h/t|0}for(var a="",u=0;0===e[u]&&u<e.length-1;++u)a+=r[0];for(var l=n.length-1;l>=0;--l)a+=r[n[l]];return a},decodeUnsafe:e,decode:function(r){var n=e(r);if(n)return n;throw new Error("Non-base"+t+" character")}}};
},{}],17:[function(require,module,exports){
"use strict";function placeHoldersCount(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===o[r-2]?2:"="===o[r-1]?1:0}function byteLength(o){return 3*o.length/4-placeHoldersCount(o)}function toByteArray(o){var r,e,t,u,n,p=o.length;u=placeHoldersCount(o),n=new Arr(3*p/4-u),e=u>0?p-4:p;var a=0;for(r=0;r<e;r+=4)t=revLookup[o.charCodeAt(r)]<<18|revLookup[o.charCodeAt(r+1)]<<12|revLookup[o.charCodeAt(r+2)]<<6|revLookup[o.charCodeAt(r+3)],n[a++]=t>>16&255,n[a++]=t>>8&255,n[a++]=255&t;return 2===u?(t=revLookup[o.charCodeAt(r)]<<2|revLookup[o.charCodeAt(r+1)]>>4,n[a++]=255&t):1===u&&(t=revLookup[o.charCodeAt(r)]<<10|revLookup[o.charCodeAt(r+1)]<<4|revLookup[o.charCodeAt(r+2)]>>2,n[a++]=t>>8&255,n[a++]=255&t),n}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,u=[],n=r;n<e;n+=3)t=(o[n]<<16)+(o[n+1]<<8)+o[n+2],u.push(tripletToBase64(t));return u.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,u="",n=[],p=0,a=e-t;p<a;p+=16383)n.push(encodeChunk(o,p,p+16383>a?a:p+16383));return 1===t?(r=o[e-1],u+=lookup[r>>2],u+=lookup[r<<4&63],u+="=="):2===t&&(r=(o[e-2]<<8)+o[e-1],u+=lookup[r>>10],u+=lookup[r>>4&63],u+=lookup[r<<2&63],u+="="),n.push(u),n.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;
},{}],18:[function(require,module,exports){
function check(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var r=e[3];if(0===r)return!1;if(5+r>=e.length)return!1;if(2!==e[4+r])return!1;var n=e[5+r];return 0!==n&&(6+r+n===e.length&&(!(128&e[4])&&(!(r>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[r+6])&&!(n>1&&0===e[r+6]&&!(128&e[r+7]))))))}function decode(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var r=e[3];if(0===r)throw new Error("R length is zero");if(5+r>=e.length)throw new Error("R length is too long");if(2!==e[4+r])throw new Error("Expected DER integer (2)");var n=e[5+r];if(0===n)throw new Error("S length is zero");if(6+r+n!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(r>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[r+6])throw new Error("S value is negative");if(n>1&&0===e[r+6]&&!(128&e[r+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+r),s:e.slice(6+r)}}function encode(e,r){var n=e.length,t=r.length;if(0===n)throw new Error("R length is zero");if(0===t)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(t>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&r[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(t>1&&0===r[0]&&!(128&r[1]))throw new Error("S value excessively padded");var o=Buffer.allocUnsafe(6+n+t);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+n]=2,o[5+n]=r.length,r.copy(o,6+n),o}var Buffer=require("safe-buffer").Buffer;module.exports={check:check,decode:decode,encode:encode};
},{"safe-buffer":166}],19:[function(require,module,exports){
!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function h(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,i,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}function e(t,i,r){for(var h=0,n=Math.min(t.length,r),e=i;e<n;e++){var o=t.charCodeAt(e)-48;h<<=4,h|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return h}function o(t,i,r,h){for(var n=0,e=Math.min(t.length,r),o=i;o<e;o++){var s=t.charCodeAt(o)-48;n*=h,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}function s(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var h=r/26|0,n=r%26;i[r]=(t.words[h]&1<<n)>>>n}return i}function u(t,i,r){r.negative=i.negative^t.negative;var h=t.length+i.length|0;r.length=h,h=h-1|0;var n=0|t.words[0],e=0|i.words[0],o=n*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a<h;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(n=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}function a(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var h=0,n=0,e=0;e<r.length-1;e++){var o=n;n=0;for(var s=67108863&h,u=Math.min(e,i.length-1),a=Math.max(0,e-t.length+1);a<=u;a++){var l=e-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;s=67108863&(f=f+s|0),n+=(o=(o=o+(m/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[e]=s,h=o,o=n}return 0!==h?r.words[e]=h:r.length--,r.strip()}function l(t,i,r){return(new m).mulp(t,i,r)}function m(t,i){this.x=t,this.y=i}function f(t,i){this.name=t,this.p=new n(i,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function d(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(t){if("string"==typeof t){var i=n._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function c(t){g.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=n:i.BN=n,n.BN=n,n.wordSize=26;var w;try{w=require("buffer").Buffer}catch(t){}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,i){return t.cmp(i)>0?t:i},n.min=function(t,i){return t.cmp(i)<0?t:i},n.prototype._init=function(t,i,h){if("number"==typeof t)return this._initNumber(t,i,h);if("object"==typeof t)return this._initArray(t,i,h);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===i?this._parseHex(t,n):this._parseBase(t,i,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initNumber=function(t,i,h){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initArray=function(t,i,h){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var e,o,s=0;if("be"===h)for(n=t.length-1,e=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===h)for(n=0,e=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this.strip()},n.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var h,n,o=0;for(r=t.length-6,h=0;r>=i;r-=6)n=e(t,r,r+6),this.words[h]|=n<<o&67108863,this.words[h+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,h++);r+6!==i&&(n=e(t,i,r+6),this.words[h]|=n<<o&67108863,this.words[h+1]|=n>>>26-o&4194303),this.strip()},n.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var h=0,n=1;n<=67108863;n*=i)h++;h--,n=n/i|0;for(var e=t.length-r,s=e%h,u=Math.min(e,e-s)+r,a=0,l=r;l<u;l+=h)a=o(t,l,l+h,i),this.imuln(n),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==s){var m=1;for(a=o(t,l,t.length,i),l=0;l<s;l++)m*=i;this.imuln(m),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}},n.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(t,i){t=t||10,i=0|i||1;var h;if(16===t||"hex"===t){h="";for(var n=0,e=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<n|e)).toString(16);h=0!==(e=s>>>24-n&16777215)||o!==this.length-1?y[6-u.length]+u+h:u+h,(n+=2)>=26&&(n-=26,o--)}for(0!==e&&(h=e.toString(16)+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}if(t===(0|t)&&t>=2&&t<=36){var a=b[t],l=_[t];h="";var m=this.clone();for(m.negative=0;!m.isZero();){var f=m.modn(l).toString(t);h=(m=m.idivn(l)).isZero()?f+h:y[a-f.length]+f+h}for(this.isZero()&&(h="0"+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,i){return r(void 0!==w),this.toArrayLike(w,t,i)},n.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},n.prototype.toArrayLike=function(t,i,h){var n=this.byteLength(),e=h||Math.max(1,n);r(n<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===i,a=new t(e),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),a[s]=o;for(;s<e;s++)a[s]=0}else{for(s=0;s<e-n;s++)a[s]=0;for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),a[e-s-1]=o}return a},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},n.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this.strip()},n.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this.strip()},n.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var h=0;h<r.length;h++)this.words[h]=i.words[h]^r.words[h];if(this!==i)for(;h<i.length;h++)this.words[h]=i.words[h];return this.length=i.length,this.strip()},n.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),h=t%26;this._expand(i),h>0&&i--;for(var n=0;n<i;n++)this.words[n]=67108863&~this.words[n];return h>0&&(this.words[n]=~this.words[n]&67108863>>26-h),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var h=t/26|0,n=t%26;return this._expand(h+1),this.words[h]=i?this.words[h]|1<<n:this.words[h]&~(1<<n),this.strip()},n.prototype.iadd=function(t){var i;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();var r,h;this.length>t.length?(r=this,h=t):(r=t,h=this);for(var n=0,e=0;e<h.length;e++)i=(0|r.words[e])+(0|h.words[e])+n,this.words[e]=67108863&i,n=i>>>26;for(;0!==n&&e<r.length;e++)i=(0|r.words[e])+n,this.words[e]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;e<r.length;e++)this.words[e]=r.words[e];return this},n.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var h,n;r>0?(h=this,n=t):(h=t,n=this);for(var e=0,o=0;o<n.length;o++)e=(i=(0|h.words[o])-(0|n.words[o])+e)>>26,this.words[o]=67108863&i;for(;0!==e&&o<h.length;o++)e=(i=(0|h.words[o])+e)>>26,this.words[o]=67108863&i;if(0===e&&o<h.length&&h!==this)for(;o<h.length;o++)this.words[o]=h.words[o];return this.length=Math.max(this.length,o),h!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var k=function(t,i,r){var h,n,e,o=t.words,s=i.words,u=r.words,a=0,l=0|o[0],m=8191&l,f=l>>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,x=0|o[5],S=8191&x,Z=x>>>13,q=0|o[6],R=8191&q,B=q>>>13,N=0|o[7],L=8191&N,I=N>>>13,z=0|o[8],T=8191&z,E=z>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,C=P>>>13,D=0|s[1],H=8191&D,J=D>>>13,U=0|s[2],G=8191&U,Q=U>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,ht=it>>>13,nt=0|s[6],et=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(h=Math.imul(m,F))|0)+((8191&(n=(n=Math.imul(m,C))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,C))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,h=Math.imul(p,F),n=(n=Math.imul(p,C))+Math.imul(M,F)|0,e=Math.imul(M,C);var gt=(a+(h=h+Math.imul(m,H)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,H)|0))<<13)|0;a=((e=e+Math.imul(f,J)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,h=Math.imul(g,F),n=(n=Math.imul(g,C))+Math.imul(c,F)|0,e=Math.imul(c,C),h=h+Math.imul(p,H)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,H)|0,e=e+Math.imul(M,J)|0;var ct=(a+(h=h+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,h=Math.imul(y,F),n=(n=Math.imul(y,C))+Math.imul(b,F)|0,e=Math.imul(b,C),h=h+Math.imul(g,H)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,H)|0,e=e+Math.imul(c,J)|0,h=h+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(h=h+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,h=Math.imul(k,F),n=(n=Math.imul(k,C))+Math.imul(A,F)|0,e=Math.imul(A,C),h=h+Math.imul(y,H)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,H)|0,e=e+Math.imul(b,J)|0,h=h+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,h=h+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(h=h+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(S,F),n=(n=Math.imul(S,C))+Math.imul(Z,F)|0,e=Math.imul(Z,C),h=h+Math.imul(k,H)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(A,H)|0,e=e+Math.imul(A,J)|0,h=h+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,h=h+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,h=h+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(h=h+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,h=Math.imul(R,F),n=(n=Math.imul(R,C))+Math.imul(B,F)|0,e=Math.imul(B,C),h=h+Math.imul(S,H)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(Z,H)|0,e=e+Math.imul(Z,J)|0,h=h+Math.imul(k,G)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,h=h+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,h=h+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,h=h+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,ht)|0;var _t=(a+(h=h+Math.imul(m,et)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,h=Math.imul(L,F),n=(n=Math.imul(L,C))+Math.imul(I,F)|0,e=Math.imul(I,C),h=h+Math.imul(R,H)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(B,H)|0,e=e+Math.imul(B,J)|0,h=h+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,h=h+Math.imul(k,W)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,h=h+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,h=h+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,ht)|0,h=h+Math.imul(p,et)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(h=h+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h=Math.imul(T,F),n=(n=Math.imul(T,C))+Math.imul(E,F)|0,e=Math.imul(E,C),h=h+Math.imul(L,H)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(I,H)|0,e=e+Math.imul(I,J)|0,h=h+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Q)|0)+Math.imul(B,G)|0,e=e+Math.imul(B,Q)|0,h=h+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,h=h+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,h=h+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,ht)|0,h=h+Math.imul(g,et)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,h=h+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(h=h+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,h=Math.imul(j,F),n=(n=Math.imul(j,C))+Math.imul(K,F)|0,e=Math.imul(K,C),h=h+Math.imul(T,H)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(E,H)|0,e=e+Math.imul(E,J)|0,h=h+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,h=h+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(B,W)|0,e=e+Math.imul(B,X)|0,h=h+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,h=h+Math.imul(k,rt)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,ht)|0,h=h+Math.imul(y,et)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,h=h+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,h=h+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var xt=(a+(h=h+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,h=Math.imul(j,H),n=(n=Math.imul(j,J))+Math.imul(K,H)|0,e=Math.imul(K,J),h=h+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Q)|0)+Math.imul(E,G)|0,e=e+Math.imul(E,Q)|0,h=h+Math.imul(L,W)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,h=h+Math.imul(R,$)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(B,$)|0,e=e+Math.imul(B,tt)|0,h=h+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,ht)|0,h=h+Math.imul(k,et)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,h=h+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,h=h+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var St=(a+(h=h+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,h=Math.imul(j,G),n=(n=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),h=h+Math.imul(T,W)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(E,W)|0,e=e+Math.imul(E,X)|0,h=h+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,h=h+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,ht)|0,h=h+Math.imul(S,et)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,h=h+Math.imul(k,ut)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,h=h+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var Zt=(a+(h=h+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,h=Math.imul(j,W),n=(n=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),h=h+Math.imul(T,$)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(E,$)|0,e=e+Math.imul(E,tt)|0,h=h+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,ht)|0,h=h+Math.imul(R,et)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,h=h+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,h=h+Math.imul(k,mt)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var qt=(a+(h=h+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,h=Math.imul(j,$),n=(n=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),h=h+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,ht)|0,h=h+Math.imul(L,et)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,h=h+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,h=h+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Rt=(a+(h=h+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,h=Math.imul(j,rt),n=(n=Math.imul(j,ht))+Math.imul(K,rt)|0,e=Math.imul(K,ht),h=h+Math.imul(T,et)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,h=h+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,h=h+Math.imul(R,mt)|0,n=(n=n+Math.imul(R,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Bt=(a+(h=h+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(j,et),n=(n=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),h=h+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,at)|0,h=h+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Nt=(a+(h=h+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(j,ut),n=(n=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),h=h+Math.imul(T,mt)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Lt=(a+(h=h+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(j,mt),n=(n=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(h=h+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;a=((e=e+Math.imul(E,Mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863;var zt=(a+(h=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=xt,u[10]=St,u[11]=Zt,u[12]=qt,u[13]=Rt,u[14]=Bt,u[15]=Nt,u[16]=Lt,u[17]=It,u[18]=zt,0!==a&&(u[19]=a,r.length++),r};Math.imul||(k=u),n.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,i):r<63?u(this,t,i):r<1024?a(this,t,i):l(this,t,i)},m.prototype.makeRBT=function(t){for(var i=new Array(t),r=n.prototype._countBits(t)-1,h=0;h<t;h++)i[h]=this.revBin(h,r,t);return i},m.prototype.revBin=function(t,i,r){if(0===t||t===r-1)return t;for(var h=0,n=0;n<i;n++)h|=(1&t)<<i-n-1,t>>=1;return h},m.prototype.permute=function(t,i,r,h,n,e){for(var o=0;o<e;o++)h[o]=i[t[o]],n[o]=r[t[o]]},m.prototype.transform=function(t,i,r,h,n,e){this.permute(e,t,i,r,h,n);for(var o=1;o<n;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),a=Math.sin(2*Math.PI/s),l=0;l<n;l+=s)for(var m=u,f=a,d=0;d<o;d++){var p=r[l+d],M=h[l+d],v=r[l+d+o],g=h[l+d+o],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,h[l+d]=M+g,r[l+d+o]=p-v,h[l+d+o]=M-g,d!==s&&(c=u*m-a*f,f=u*f+a*m,m=c)}},m.prototype.guessLen13b=function(t,i){var r=1|Math.max(i,t),h=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+h},m.prototype.conjugate=function(t,i,r){if(!(r<=1))for(var h=0;h<r/2;h++){var n=t[h];t[h]=t[r-h-1],t[r-h-1]=n,n=i[h],i[h]=-i[r-h-1],i[r-h-1]=-n}},m.prototype.normalize13b=function(t,i){for(var r=0,h=0;h<i/2;h++){var n=8192*Math.round(t[2*h+1]/i)+Math.round(t[2*h]/i)+r;t[h]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,i,h,n){for(var e=0,o=0;o<i;o++)e+=0|t[o],h[2*o]=8191&e,e>>>=13,h[2*o+1]=8191&e,e>>>=13;for(o=2*i;o<n;++o)h[o]=0;r(0===e),r(0==(-8192&e))},m.prototype.stub=function(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},m.prototype.mulp=function(t,i,r){var h=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(h),e=this.stub(h),o=new Array(h),s=new Array(h),u=new Array(h),a=new Array(h),l=new Array(h),m=new Array(h),f=r.words;f.length=h,this.convert13b(t.words,t.length,o,h),this.convert13b(i.words,i.length,a,h),this.transform(o,e,s,u,h,n),this.transform(a,e,l,m,h,n);for(var d=0;d<h;d++){var p=s[d]*l[d]-u[d]*m[d];u[d]=s[d]*m[d]+u[d]*l[d],s[d]=p}return this.conjugate(s,u,h),this.transform(s,u,f,e,h,n),this.conjugate(f,e,h),this.normalize13b(f,h),r.negative=t.negative^i.negative,r.length=t.length+i.length,r.strip()},n.prototype.mul=function(t){var i=new n(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},n.prototype.mulf=function(t){var i=new n(null);return i.words=new Array(this.length+t.length),l(this,t,i)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var i=0,h=0;h<this.length;h++){var n=(0|this.words[h])*t,e=(67108863&n)+(67108863&i);i>>=26,i+=n/67108864|0,i+=e>>>26,this.words[h]=67108863&e}return 0!==i&&(this.words[h]=i,this.length++),this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var i=s(t);if(0===i.length)return new n(1);for(var r=this,h=0;h<i.length&&0===i[h];h++,r=r.sqr());if(++h<i.length)for(var e=r.sqr();h<i.length;h++,e=e.sqr())0!==i[h]&&(r=r.mul(e));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var i,h=t%26,n=(t-h)/26,e=67108863>>>26-h<<26-h;if(0!==h){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&e,u=(0|this.words[i])-s<<h;this.words[i]=u|o,o=s>>>26-h}o&&(this.words[i]=o,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i<n;i++)this.words[i]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,i,h){r("number"==typeof t&&t>=0);var n;n=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<<e,u=h;if(n-=o,n=Math.max(0,n),u){for(var a=0;a<o;a++)u.words[a]=this.words[a];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,a=0;a<this.length;a++)this.words[a]=this.words[a+o];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,i,h){return r(0===this.negative),this.iushrn(t,i,h)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,h=(t-i)/26,n=1<<i;return!(this.length<=h)&&!!(this.words[h]&n)},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var i=t%26,h=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=h)return this;if(0!==i&&h++,this.length=Math.min(h,this.length),0!==i){var n=67108863^67108863>>>i<<i;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,i,h){var n,e=t.length+h;this._expand(e);var o,s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+h])+s;var u=(0|t.words[n])*i;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+h]=67108863&o}for(;n<this.length-h;n++)s=(o=(0|this.words[n+h])+s)>>26,this.words[n+h]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,i){var r=this.length-t.length,h=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),h.iushln(r),o=0|e.words[e.length-1]);var s,u=h.length-e.length;if("mod"!==i){(s=new n(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=h.clone()._ishlnsubmul(e,1,u);0===l.negative&&(h=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|h.words[e.length+m])+(0|h.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),h._ishlnsubmul(e,f,m);0!==h.negative;)f--,h.negative=0,h._ishlnsubmul(e,1,m),h.isZero()||(h.negative^=1);s&&(s.words[m]=f)}return s&&s.strip(),h.strip(),"div"!==i&&0!==r&&h.iushrn(r),{div:s||null,mod:h}},n.prototype.divmod=function(t,i,h){if(r(!t.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var e,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,i)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,h=t.ushrn(1),n=t.andln(1),e=r.cmp(h);return e<0||1===n&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var i=(1<<26)%t,h=0,n=this.length-1;n>=0;n--)h=(i*h+(0|this.words[n]))%t;return h},n.prototype.idivn=function(t){r(t<=67108863);for(var i=0,h=this.length-1;h>=0;h--){var n=(0|this.words[h])+67108864*i;this.words[h]=n/t|0,i=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,h=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new n(1),o=new n(0),s=new n(0),u=new n(1),a=0;i.isEven()&&h.isEven();)i.iushrn(1),h.iushrn(1),++a;for(var l=h.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(h.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(h.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(h)>=0?(i.isub(h),e.isub(s),o.isub(u)):(h.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:h.iushln(a)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,h=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new n(1),o=new n(0),s=h.clone();i.cmpn(1)>0&&h.cmpn(1)>0;){for(var u=0,a=1;0==(i.words[0]&a)&&u<26;++u,a<<=1);if(u>0)for(i.iushrn(u);u-- >0;)e.isOdd()&&e.iadd(s),e.iushrn(1);for(var l=0,m=1;0==(h.words[0]&m)&&l<26;++l,m<<=1);if(l>0)for(h.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);i.cmp(h)>=0?(i.isub(h),e.isub(o)):(h.isub(i),o.isub(e))}var f;return(f=0===i.cmpn(1)?e:o).cmpn(0)<0&&f.iadd(t),f},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var h=0;i.isEven()&&r.isEven();h++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var e=i;i=r,r=e}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(h)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,h=(t-i)/26,n=1<<i;if(this.length<=h)return this._expand(h+1),this.words[h]|=n,this;for(var e=n,o=h;0!==e&&o<this.length;o++){var s=0|this.words[o];e=(s+=e)>>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;this.strip();var h;if(this.length>1)h=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];h=n===t?0:n<t?-1:1}return 0!==this.negative?0|-h:h},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var h=0|this.words[r],n=0|t.words[r];if(h!==n){h<n?i=-1:h>n&&(i=1);break}}return i},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new g(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};f.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var h=i<this.n?-1:r.ucmp(this.p);return 0===h?(r.words[0]=0,r.length=1):h>0?r.isub(this.p):r.strip(),r},f.prototype.split=function(t,i){t.iushrn(this.n,0,i)},f.prototype.imulK=function(t){return t.imul(this.k)},h(d,f),d.prototype.split=function(t,i){for(var r=Math.min(t.length,9),h=0;h<r;h++)i.words[h]=t.words[h];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(i.words[i.length++]=4194303&n,h=10;h<t.length;h++){var e=0|t.words[h];t.words[h-10]=(4194303&e)<<4|n>>>22,n=e}n>>>=22,t.words[h-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},d.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var h=0|t.words[r];i+=977*h,t.words[r]=67108863&i,i=64*h+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},h(p,f),h(M,f),h(v,f),v.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var h=19*(0|t.words[r])+i,n=67108863&h;h>>>=26,t.words[r]=n,i=h}return 0!==i&&(t.words[t.length++]=i),t},n._prime=function(t){if(A[t])return A[t];var i;if("k256"===t)i=new d;else if("p224"===t)i=new p;else if("p192"===t)i=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new v}return A[t]=i,i},g.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},g.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},g.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},g.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var h=this.m.add(new n(1)).iushrn(2);return this.pow(t,h)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new n(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v<p);var g=this.pow(m,new n(1).iushln(p-v-1));f=f.redMul(g),m=g.redSqr(),d=d.redMul(m),p=v}return f},g.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},g.prototype.pow=function(t,i){if(i.isZero())return new n(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var h=2;h<r.length;h++)r[h]=this.mul(r[h-1],t);var e=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),h=i.length-1;h>=0;h--){for(var a=i.words[h],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===h&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},g.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},g.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},n.mont=function(t){return new c(t)},h(c,g),c.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},c.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},c.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).iushrn(this.shift),e=n;return n.cmp(this.m)>=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},c.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new n(0)._forceRed(this);var r=t.mul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(h).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},c.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this);
},{"buffer":21}],20:[function(require,module,exports){
function Rand(t){this.rand=t}var r;if(module.exports=function(t){return r||(r=new Rand(null)),r.generate(t)},module.exports.Rand=Rand,Rand.prototype.generate=function(t){return this._rand(t)},Rand.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),e=0;e<r.length;e++)r[e]=this.rand.getByte();return r},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:"object"==typeof window&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var crypto=require("crypto");if("function"!=typeof crypto.randomBytes)throw new Error("Not supported");Rand.prototype._rand=function(t){return crypto.randomBytes(t)}}catch(t){}
},{"crypto":21}],21:[function(require,module,exports){
},{}],22:[function(require,module,exports){
function asUInt32Array(r){Buffer.isBuffer(r)||(r=Buffer.from(r));for(var e=r.length/4|0,t=new Array(e),n=0;n<e;n++)t[n]=r.readUInt32BE(4*n);return t}function scrubVec(r){for(;0<r.length;r++)r[0]=0}function cryptBlock(r,e,t,n,o){for(var S,B,c,i,u=t[0],f=t[1],s=t[2],a=t[3],y=r[0]^e[0],_=r[1]^e[1],I=r[2]^e[2],l=r[3]^e[3],X=4,h=1;h<o;h++)S=u[y>>>24]^f[_>>>16&255]^s[I>>>8&255]^a[255&l]^e[X++],B=u[_>>>24]^f[I>>>16&255]^s[l>>>8&255]^a[255&y]^e[X++],c=u[I>>>24]^f[l>>>16&255]^s[y>>>8&255]^a[255&_]^e[X++],i=u[l>>>24]^f[y>>>16&255]^s[_>>>8&255]^a[255&I]^e[X++],y=S,_=B,I=c,l=i;return S=(n[y>>>24]<<24|n[_>>>16&255]<<16|n[I>>>8&255]<<8|n[255&l])^e[X++],B=(n[_>>>24]<<24|n[I>>>16&255]<<16|n[l>>>8&255]<<8|n[255&y])^e[X++],c=(n[I>>>24]<<24|n[l>>>16&255]<<16|n[y>>>8&255]<<8|n[255&_])^e[X++],i=(n[l>>>24]<<24|n[y>>>16&255]<<16|n[_>>>8&255]<<8|n[255&I])^e[X++],S>>>=0,B>>>=0,c>>>=0,i>>>=0,[S,B,c,i]}function AES(r){this._key=asUInt32Array(r),this._reset()}var Buffer=require("safe-buffer").Buffer,RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var r=new Array(256),e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;for(var t=[],n=[],o=[[],[],[],[]],S=[[],[],[],[]],B=0,c=0,i=0;i<256;++i){var u=c^c<<1^c<<2^c<<3^c<<4;u=u>>>8^255&u^99,t[B]=u,n[u]=B;var f=r[B],s=r[f],a=r[s],y=257*r[u]^16843008*u;o[0][B]=y<<24|y>>>8,o[1][B]=y<<16|y>>>16,o[2][B]=y<<8|y>>>24,o[3][B]=y,y=16843009*a^65537*s^257*f^16843008*B,S[0][u]=y<<24|y>>>8,S[1][u]=y<<16|y>>>16,S[2][u]=y<<8|y>>>24,S[3][u]=y,0===B?B=c=1:(B=f^r[r[r[a^f]]],c^=r[r[c]])}return{SBOX:t,INV_SBOX:n,SUB_MIX:o,INV_SUB_MIX:S}}();AES.blockSize=16,AES.keySize=32,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var r=this._key,e=r.length,t=e+6,n=4*(t+1),o=[],S=0;S<e;S++)o[S]=r[S];for(S=e;S<n;S++){var B=o[S-1];S%e==0?(B=B<<8|B>>>24,B=G.SBOX[B>>>24]<<24|G.SBOX[B>>>16&255]<<16|G.SBOX[B>>>8&255]<<8|G.SBOX[255&B],B^=RCON[S/e|0]<<24):e>6&&S%e==4&&(B=G.SBOX[B>>>24]<<24|G.SBOX[B>>>16&255]<<16|G.SBOX[B>>>8&255]<<8|G.SBOX[255&B]),o[S]=o[S-e]^B}for(var c=[],i=0;i<n;i++){var u=n-i,f=o[u-(i%4?0:4)];c[i]=i<4||u<=4?f:G.INV_SUB_MIX[0][G.SBOX[f>>>24]]^G.INV_SUB_MIX[1][G.SBOX[f>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[f>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&f]]}this._nRounds=t,this._keySchedule=o,this._invKeySchedule=c},AES.prototype.encryptBlockRaw=function(r){return r=asUInt32Array(r),cryptBlock(r,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(r){var e=this.encryptBlockRaw(r),t=Buffer.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},AES.prototype.decryptBlock=function(r){var e=(r=asUInt32Array(r))[1];r[1]=r[3],r[3]=e;var t=cryptBlock(r,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),n=Buffer.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[3],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[1],12),n},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},module.exports.AES=AES;
},{"safe-buffer":166}],23:[function(require,module,exports){
function xorTest(t,e){var r=0;t.length!==e.length&&r++;for(var a=Math.min(t.length,e.length),i=0;i<a;++i)r+=t[i]^e[i];return r}function calcIv(t,e,r){if(12===e.length)return t._finID=Buffer.concat([e,Buffer.from([0,0,0,1])]),Buffer.concat([e,Buffer.from([0,0,0,2])]);var a=new GHASH(r),i=e.length,h=i%16;a.update(e),h&&(h=16-h,a.update(Buffer.alloc(h,0))),a.update(Buffer.alloc(8,0));var n=8*i,s=Buffer.alloc(8);s.writeUIntBE(n,0,8),a.update(s),t._finID=a.state;var u=Buffer.from(t._finID);return incr32(u),u}function StreamCipher(t,e,r,a){Transform.call(this);var i=Buffer.alloc(4,0);this._cipher=new aes.AES(e);var h=this._cipher.encryptBlock(i);this._ghash=new GHASH(h),r=calcIv(this,r,h),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}var aes=require("./aes"),Buffer=require("safe-buffer").Buffer,Transform=require("cipher-base"),inherits=require("inherits"),GHASH=require("./ghash"),xor=require("buffer-xor"),incr32=require("./incr32");inherits(StreamCipher,Transform),StreamCipher.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=Buffer.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},StreamCipher.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=xor(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&xorTest(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},StreamCipher.prototype.getAuthTag=function(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},StreamCipher.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},StreamCipher.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},module.exports=StreamCipher;
},{"./aes":22,"./ghash":27,"./incr32":28,"buffer-xor":52,"cipher-base":54,"inherits":115,"safe-buffer":166}],24:[function(require,module,exports){
function getCiphers(){return Object.keys(modes)}var ciphers=require("./encrypter"),deciphers=require("./decrypter"),modes=require("./modes/list.json");exports.createCipher=exports.Cipher=ciphers.createCipher,exports.createCipheriv=exports.Cipheriv=ciphers.createCipheriv,exports.createDecipher=exports.Decipher=deciphers.createDecipher,exports.createDecipheriv=exports.Decipheriv=deciphers.createDecipheriv,exports.listCiphers=exports.getCiphers=getCiphers;
},{"./decrypter":25,"./encrypter":26,"./modes/list.json":36}],25:[function(require,module,exports){
function Decipher(e,t,r){Transform.call(this),this._cache=new Splitter,this._last=void 0,this._cipher=new aes.AES(t),this._prev=Buffer.from(r),this._mode=e,this._autopadding=!0}function Splitter(){this.cache=Buffer.allocUnsafe(0)}function unpad(e){for(var t=e[15],r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}function createDecipheriv(e,t,r){var i=MODES[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=Buffer.from(r)),"GCM"!==i.mode&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=Buffer.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===i.type?new StreamCipher(i.module,t,r,!0):"auth"===i.type?new AuthCipher(i.module,t,r,!0):new Decipher(i.module,t,r)}function createDecipher(e,t){var r=MODES[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=ebtk(t,!1,r.key,r.iv);return createDecipheriv(e,i.key,i.iv)}var AuthCipher=require("./authCipher"),Buffer=require("safe-buffer").Buffer,MODES=require("./modes"),StreamCipher=require("./streamCipher"),Transform=require("cipher-base"),aes=require("./aes"),ebtk=require("evp_bytestokey"),inherits=require("inherits");inherits(Decipher,Transform),Decipher.prototype._update=function(e){this._cache.add(e);for(var t,r,i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return Buffer.concat(i)},Decipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return unpad(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},Decipher.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},Splitter.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},Splitter.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache},exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv;
},{"./aes":22,"./authCipher":23,"./modes":35,"./streamCipher":38,"cipher-base":54,"evp_bytestokey":98,"inherits":115,"safe-buffer":166}],26:[function(require,module,exports){
function Cipher(e,r,t){Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(r),this._prev=Buffer.from(t),this._mode=e,this._autopadding=!0}function Splitter(){this.cache=Buffer.allocUnsafe(0)}function createCipheriv(e,r,t){var i=MODES[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=Buffer.from(r)),r.length!==i.key/8)throw new TypeError("invalid key length "+r.length);if("string"==typeof t&&(t=Buffer.from(t)),"GCM"!==i.mode&&t.length!==i.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===i.type?new StreamCipher(i.module,r,t):"auth"===i.type?new AuthCipher(i.module,r,t):new Cipher(i.module,r,t)}function createCipher(e,r){var t=MODES[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var i=ebtk(r,!1,t.key,t.iv);return createCipheriv(e,i.key,i.iv)}var MODES=require("./modes"),AuthCipher=require("./authCipher"),Buffer=require("safe-buffer").Buffer,StreamCipher=require("./streamCipher"),Transform=require("cipher-base"),aes=require("./aes"),ebtk=require("evp_bytestokey"),inherits=require("inherits");inherits(Cipher,Transform),Cipher.prototype._update=function(e){this._cache.add(e);for(var r,t,i=[];r=this._cache.get();)t=this._mode.encrypt(this,r),i.push(t);return Buffer.concat(i)};var PADDING=Buffer.alloc(16,16);Cipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},Splitter.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},Splitter.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},Splitter.prototype.flush=function(){for(var e=16-this.cache.length,r=Buffer.allocUnsafe(e),t=-1;++t<e;)r.writeUInt8(e,t);return Buffer.concat([this.cache,r])},exports.createCipheriv=createCipheriv,exports.createCipher=createCipher;
},{"./aes":22,"./authCipher":23,"./modes":35,"./streamCipher":38,"cipher-base":54,"evp_bytestokey":98,"inherits":115,"safe-buffer":166}],27:[function(require,module,exports){
function toArray(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function fromArray(t){var r=Buffer.allocUnsafe(16);return r.writeUInt32BE(t[0]>>>0,0),r.writeUInt32BE(t[1]>>>0,4),r.writeUInt32BE(t[2]>>>0,8),r.writeUInt32BE(t[3]>>>0,12),r}function GHASH(t){this.h=t,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}var Buffer=require("safe-buffer").Buffer,ZEROES=Buffer.alloc(16,0);GHASH.prototype.ghash=function(t){for(var r=-1;++r<t.length;)this.state[r]^=t[r];this._multiply()},GHASH.prototype._multiply=function(){for(var t,r,e=toArray(this.h),a=[0,0,0,0],h=-1;++h<128;){for(0!=(this.state[~~(h/8)]&1<<7-h%8)&&(a[0]^=e[0],a[1]^=e[1],a[2]^=e[2],a[3]^=e[3]),r=0!=(1&e[3]),t=3;t>0;t--)e[t]=e[t]>>>1|(1&e[t-1])<<31;e[0]=e[0]>>>1,r&&(e[0]=e[0]^225<<24)}this.state=fromArray(a)},GHASH.prototype.update=function(t){this.cache=Buffer.concat([this.cache,t]);for(var r;this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},GHASH.prototype.final=function(t,r){return this.cache.length&&this.ghash(Buffer.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,t,0,r])),this.state},module.exports=GHASH;
},{"safe-buffer":166}],28:[function(require,module,exports){
function incr32(r){for(var n,t=r.length;t--;){if(255!==(n=r.readUInt8(t))){n++,r.writeUInt8(n,t);break}r.writeUInt8(0,t)}}module.exports=incr32;
},{}],29:[function(require,module,exports){
var xor=require("buffer-xor");exports.encrypt=function(r,e){var p=xor(e,r._prev);return r._prev=r._cipher.encryptBlock(p),r._prev},exports.decrypt=function(r,e){var p=r._prev;r._prev=e;var c=r._cipher.decryptBlock(e);return xor(c,p)};
},{"buffer-xor":52}],30:[function(require,module,exports){
function encryptStart(e,r,c){var f=r.length,t=xor(r,e._cache);return e._cache=e._cache.slice(f),e._prev=Buffer.concat([e._prev,c?r:t]),t}var Buffer=require("safe-buffer").Buffer,xor=require("buffer-xor");exports.encrypt=function(e,r,c){for(var f,t=Buffer.allocUnsafe(0);r.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Buffer.allocUnsafe(0)),!(e._cache.length<=r.length)){t=Buffer.concat([t,encryptStart(e,r,c)]);break}f=e._cache.length,t=Buffer.concat([t,encryptStart(e,r.slice(0,f),c)]),r=r.slice(f)}return t};
},{"buffer-xor":52,"safe-buffer":166}],31:[function(require,module,exports){
function encryptByte(r,e,f){for(var n,t,u,c=-1,o=0;++c<8;)n=r._cipher.encryptBlock(r._prev),t=e&1<<7-c?128:0,o+=(128&(u=n[0]^t))>>c%8,r._prev=shiftIn(r._prev,f?t:u);return o}function shiftIn(r,e){var f=r.length,n=-1,t=Buffer.allocUnsafe(r.length);for(r=Buffer.concat([r,Buffer.from([e])]);++n<f;)t[n]=r[n]<<1|r[n+1]>>7;return t}var Buffer=require("safe-buffer").Buffer;exports.encrypt=function(r,e,f){for(var n=e.length,t=Buffer.allocUnsafe(n),u=-1;++u<n;)t[u]=encryptByte(r,e[u],f);return t};
},{"safe-buffer":166}],32:[function(require,module,exports){
(function (Buffer){
function encryptByte(r,e,n){var t=r._cipher.encryptBlock(r._prev)[0]^e;return r._prev=Buffer.concat([r._prev.slice(1),Buffer.from([n?e:t])]),t}exports.encrypt=function(r,e,n){for(var t=e.length,c=Buffer.allocUnsafe(t),f=-1;++f<t;)c[f]=encryptByte(r,e[f],n);return c};
}).call(this,require("buffer").Buffer)
},{"buffer":53}],33:[function(require,module,exports){
(function (Buffer){
function getBlock(e){var c=e._cipher.encryptBlockRaw(e._prev);return incr32(e._prev),c}var xor=require("buffer-xor"),incr32=require("../incr32"),blockSize=16;exports.encrypt=function(e,c){var r=Math.ceil(c.length/blockSize),t=e._cache.length;e._cache=Buffer.concat([e._cache,Buffer.allocUnsafe(r*blockSize)]);for(var a=0;a<r;a++){var n=getBlock(e),i=t+a*blockSize;e._cache.writeUInt32BE(n[0],i+0),e._cache.writeUInt32BE(n[1],i+4),e._cache.writeUInt32BE(n[2],i+8),e._cache.writeUInt32BE(n[3],i+12)}var h=e._cache.slice(0,c.length);return e._cache=e._cache.slice(c.length),xor(c,h)};
}).call(this,require("buffer").Buffer)
},{"../incr32":28,"buffer":53,"buffer-xor":52}],34:[function(require,module,exports){
exports.encrypt=function(r,c){return r._cipher.encryptBlock(c)},exports.decrypt=function(r,c){return r._cipher.decryptBlock(c)};
},{}],35:[function(require,module,exports){
var modeModules={ECB:require("./ecb"),CBC:require("./cbc"),CFB:require("./cfb"),CFB8:require("./cfb8"),CFB1:require("./cfb1"),OFB:require("./ofb"),CTR:require("./ctr"),GCM:require("./ctr")},modes=require("./list.json");for(var key in modes)modes[key].module=modeModules[modes[key].mode];module.exports=modes;
},{"./cbc":29,"./cfb":30,"./cfb1":31,"./cfb8":32,"./ctr":33,"./ecb":34,"./list.json":36,"./ofb":37}],36:[function(require,module,exports){
module.exports={
"aes-128-ecb": {
"cipher": "AES",
"key": 128,
"iv": 0,
"mode": "ECB",
"type": "block"
},
"aes-192-ecb": {
"cipher": "AES",
"key": 192,
"iv": 0,
"mode": "ECB",
"type": "block"
},
"aes-256-ecb": {
"cipher": "AES",
"key": 256,
"iv": 0,
"mode": "ECB",
"type": "block"
},
"aes-128-cbc": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes-192-cbc": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes-256-cbc": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes128": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes192": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes256": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CBC",
"type": "block"
},
"aes-128-cfb": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CFB",
"type": "stream"
},
"aes-192-cfb": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CFB",
"type": "stream"
},
"aes-256-cfb": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CFB",
"type": "stream"
},
"aes-128-cfb8": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CFB8",
"type": "stream"
},
"aes-192-cfb8": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CFB8",
"type": "stream"
},
"aes-256-cfb8": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CFB8",
"type": "stream"
},
"aes-128-cfb1": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CFB1",
"type": "stream"
},
"aes-192-cfb1": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CFB1",
"type": "stream"
},
"aes-256-cfb1": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CFB1",
"type": "stream"
},
"aes-128-ofb": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "OFB",
"type": "stream"
},
"aes-192-ofb": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "OFB",
"type": "stream"
},
"aes-256-ofb": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "OFB",
"type": "stream"
},
"aes-128-ctr": {
"cipher": "AES",
"key": 128,
"iv": 16,
"mode": "CTR",
"type": "stream"
},
"aes-192-ctr": {
"cipher": "AES",
"key": 192,
"iv": 16,
"mode": "CTR",
"type": "stream"
},
"aes-256-ctr": {
"cipher": "AES",
"key": 256,
"iv": 16,
"mode": "CTR",
"type": "stream"
},
"aes-128-gcm": {
"cipher": "AES",
"key": 128,
"iv": 12,
"mode": "GCM",
"type": "auth"
},
"aes-192-gcm": {
"cipher": "AES",
"key": 192,
"iv": 12,
"mode": "GCM",
"type": "auth"
},
"aes-256-gcm": {
"cipher": "AES",
"key": 256,
"iv": 12,
"mode": "GCM",
"type": "auth"
}
}
},{}],37:[function(require,module,exports){
(function (Buffer){
function getBlock(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}var xor=require("buffer-xor");exports.encrypt=function(e,c){for(;e._cache.length<c.length;)e._cache=Buffer.concat([e._cache,getBlock(e)]);var r=e._cache.slice(0,c.length);return e._cache=e._cache.slice(c.length),xor(c,r)};
}).call(this,require("buffer").Buffer)
},{"buffer":53,"buffer-xor":52}],38:[function(require,module,exports){
function StreamCipher(e,r,i,t){Transform.call(this),this._cipher=new aes.AES(r),this._prev=Buffer.from(i),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=t,this._mode=e}var aes=require("./aes"),Buffer=require("safe-buffer").Buffer,Transform=require("cipher-base"),inherits=require("inherits");inherits(StreamCipher,Transform),StreamCipher.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},StreamCipher.prototype._final=function(){this._cipher.scrub()},module.exports=StreamCipher;
},{"./aes":22,"cipher-base":54,"inherits":115,"safe-buffer":166}],39:[function(require,module,exports){
function createCipher(e,r){var s,i;if(e=e.toLowerCase(),aesModes[e])s=aesModes[e].key,i=aesModes[e].iv;else{if(!desModes[e])throw new TypeError("invalid suite type");s=8*desModes[e].key,i=desModes[e].iv}var t=ebtk(r,!1,s,i);return createCipheriv(e,t.key,t.iv)}function createDecipher(e,r){var s,i;if(e=e.toLowerCase(),aesModes[e])s=aesModes[e].key,i=aesModes[e].iv;else{if(!desModes[e])throw new TypeError("invalid suite type");s=8*desModes[e].key,i=desModes[e].iv}var t=ebtk(r,!1,s,i);return createDecipheriv(e,t.key,t.iv)}function createCipheriv(e,r,s){if(e=e.toLowerCase(),aesModes[e])return aes.createCipheriv(e,r,s);if(desModes[e])return new DES({key:r,iv:s,mode:e});throw new TypeError("invalid suite type")}function createDecipheriv(e,r,s){if(e=e.toLowerCase(),aesModes[e])return aes.createDecipheriv(e,r,s);if(desModes[e])return new DES({key:r,iv:s,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function getCiphers(){return Object.keys(desModes).concat(aes.getCiphers())}var ebtk=require("evp_bytestokey"),aes=require("browserify-aes/browser"),DES=require("browserify-des"),desModes=require("browserify-des/modes"),aesModes=require("browserify-aes/modes");exports.createCipher=exports.Cipher=createCipher,exports.createCipheriv=exports.Cipheriv=createCipheriv,exports.createDecipher=exports.Decipher=createDecipher,exports.createDecipheriv=exports.Decipheriv=createDecipheriv,exports.listCiphers=exports.getCiphers=getCiphers;
},{"browserify-aes/browser":24,"browserify-aes/modes":35,"browserify-des":40,"browserify-des/modes":41,"evp_bytestokey":98}],40:[function(require,module,exports){
(function (Buffer){
function DES(e){CipherBase.call(this);var s,d=e.mode.toLowerCase(),t=modes[d];s=e.decrypt?"decrypt":"encrypt";var r=e.key;"des-ede"!==d&&"des-ede-cbc"!==d||(r=Buffer.concat([r,r.slice(0,8)]));var i=e.iv;this._des=t.create({key:r,iv:i,type:s})}var CipherBase=require("cipher-base"),des=require("des.js"),inherits=require("inherits"),modes={"des-ede3-cbc":des.CBC.instantiate(des.EDE),"des-ede3":des.EDE,"des-ede-cbc":des.CBC.instantiate(des.EDE),"des-ede":des.EDE,"des-cbc":des.CBC.instantiate(des.DES),"des-ecb":des.DES};modes.des=modes["des-cbc"],modes.des3=modes["des-ede3-cbc"],module.exports=DES,inherits(DES,CipherBase),DES.prototype._update=function(e){return new Buffer(this._des.update(e))},DES.prototype._final=function(){return new Buffer(this._des.final())};
}).call(this,require("buffer").Buffer)
},{"buffer":53,"cipher-base":54,"des.js":64,"inherits":115}],41:[function(require,module,exports){
exports["des-ecb"]={key:8,iv:0},exports["des-cbc"]=exports.des={key:8,iv:8},exports["des-ede3-cbc"]=exports.des3={key:24,iv:8},exports["des-ede3"]={key:24,iv:0},exports["des-ede-cbc"]={key:16,iv:8},exports["des-ede"]={key:16,iv:0};
},{}],42:[function(require,module,exports){
(function (Buffer){
function blind(e){var n=getr(e);return{blinder:n.toRed(bn.mont(e.modulus)).redPow(new bn(e.publicExponent)).fromRed(),unblinder:n.invm(e.modulus)}}function crt(e,n){var r=blind(n),o=n.modulus.byteLength(),u=(bn.mont(n.modulus),new bn(e).mul(r.blinder).umod(n.modulus)),m=u.toRed(bn.mont(n.prime1)),d=u.toRed(bn.mont(n.prime2)),t=n.coefficient,i=n.prime1,b=n.prime2,l=m.redPow(n.exponent1),s=d.redPow(n.exponent2);l=l.fromRed(),s=s.fromRed();var p=l.isub(s).imul(t).umod(i);return p.imul(b),s.iadd(p),new Buffer(s.imul(r.unblinder).umod(n.modulus).toArray(!1,o))}function getr(e){for(var n=e.modulus.byteLength(),r=new bn(randomBytes(n));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new bn(randomBytes(n));return r}var bn=require("bn.js"),randomBytes=require("randombytes");module.exports=crt,crt.getr=getr;
}).call(this,require("buffer").Buffer)
},{"bn.js":19,"buffer":53,"randombytes":150}],43:[function(require,module,exports){
(function (Buffer){
const Sha3=require("js-sha3"),hashLengths=[224,256,384,512];var hash=function(t){if(void 0!==t&&-1==hashLengths.indexOf(t))throw new Error("Unsupported hash length");this.content=[],this.bitcount=t?"keccak_"+t:"keccak_512"};hash.prototype.update=function(t){if(Buffer.isBuffer(t))this.content.push(t);else{if("string"!=typeof t)throw new Error("Unsupported argument to update");this.content.push(new Buffer(t))}return this},hash.prototype.digest=function(t){var e=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===t)return e;if("binary"===t||void 0===t)return new Buffer(e,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+t)},module.exports={SHA3Hash:hash};
}).call(this,require("buffer").Buffer)
},{"buffer":53,"js-sha3":119}],44:[function(require,module,exports){
module.exports=require("./browser/algorithms.json");
},{"./browser/algorithms.json":45}],45:[function(require,module,exports){
module.exports={
"sha224WithRSAEncryption": {
"sign": "rsa",
"hash": "sha224",
"id": "302d300d06096086480165030402040500041c"
},
"RSA-SHA224": {
"sign": "ecdsa/rsa",
"hash": "sha224",
"id": "302d300d06096086480165030402040500041c"
},
"sha256WithRSAEncryption": {
"sign": "rsa",
"hash": "sha256",
"id": "3031300d060960864801650304020105000420"
},
"RSA-SHA256": {
"sign": "ecdsa/rsa",
"hash": "sha256",
"id": "3031300d060960864801650304020105000420"
},
"sha384WithRSAEncryption": {
"sign": "rsa",
"hash": "sha384",
"id": "3041300d060960864801650304020205000430"
},
"RSA-SHA384": {
"sign": "ecdsa/rsa",
"hash": "sha384",
"id": "3041300d060960864801650304020205000430"
},
"sha512WithRSAEncryption": {
"sign": "rsa",
"hash": "sha512",
"id": "3051300d060960864801650304020305000440"
},
"RSA-SHA512": {
"sign": "ecdsa/rsa",
"hash": "sha512",
"id": "3051300d060960864801650304020305000440"
},
"RSA-SHA1": {
"sign": "rsa",
"hash": "sha1",
"id": "3021300906052b0e03021a05000414"
},
"ecdsa-with-SHA1": {
"sign": "ecdsa",
"hash": "sha1",
"id": ""
},
"sha256": {
"sign": "ecdsa",
"hash": "sha256",
"id": ""
},
"sha224": {
"sign": "ecdsa",
"hash": "sha224",
"id": ""
},
"sha384": {
"sign": "ecdsa",
"hash": "sha384",
"id": ""
},
"sha512": {
"sign": "ecdsa",
"hash": "sha512",
"id": ""
},
"DSA-SHA": {
"sign": "dsa",
"hash": "sha1",
"id": ""
},
"DSA-SHA1": {
"sign": "dsa",
"hash": "sha1",
"id": ""
},
"DSA": {
"sign": "dsa",
"hash": "sha1",
"id": ""
},
"DSA-WITH-SHA224": {
"sign": "dsa",
"hash": "sha224",
"id": ""
},
"DSA-SHA224": {
"sign": "dsa",
"hash": "sha224",
"id": ""
},
"DSA-WITH-SHA256": {
"sign": "dsa",
"hash": "sha256",
"id": ""
},
"DSA-SHA256": {
"sign": "dsa",
"hash": "sha256",
"id": ""
},
"DSA-WITH-SHA384": {
"sign": "dsa",
"hash": "sha384",
"id": ""
},
"DSA-SHA384": {
"sign": "dsa",
"hash": "sha384",
"id": ""
},
"DSA-WITH-SHA512": {
"sign": "dsa",
"hash": "sha512",
"id": ""
},
"DSA-SHA512": {
"sign": "dsa",
"hash": "sha512",
"id": ""
},
"DSA-RIPEMD160": {
"sign": "dsa",
"hash": "rmd160",
"id": ""
},
"ripemd160WithRSA": {
"sign": "rsa",
"hash": "rmd160",
"id": "3021300906052b2403020105000414"
},
"RSA-RIPEMD160": {
"sign": "rsa",
"hash": "rmd160",
"id": "3021300906052b2403020105000414"
},
"md5WithRSAEncryption": {
"sign": "rsa",
"hash": "md5",
"id": "3020300c06082a864886f70d020505000410"
},
"RSA-MD5": {
"sign": "rsa",
"hash": "md5",
"id": "3020300c06082a864886f70d020505000410"
}
}
},{}],46:[function(require,module,exports){
module.exports={
"1.3.132.0.10": "secp256k1",
"1.3.132.0.33": "p224",
"1.2.840.10045.3.1.1": "p192",
"1.2.840.10045.3.1.7": "p256",
"1.3.132.0.34": "p384",
"1.3.132.0.35": "p521"
}
},{}],47:[function(require,module,exports){
(function (Buffer){
function Sign(e){stream.Writable.call(this);var t=algorithms[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=createHash(t.hash),this._tag=t.id,this._signType=t.sign}function Verify(e){stream.Writable.call(this);var t=algorithms[e];if(!t)throw new Error("Unknown message digest");this._hash=createHash(t.hash),this._tag=t.id,this._signType=t.sign}function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}var createHash=require("create-hash"),stream=require("stream"),inherits=require("inherits"),sign=require("./sign"),verify=require("./verify"),algorithms=require("./algorithms.json");Object.keys(algorithms).forEach(function(e){algorithms[e].id=new Buffer(algorithms[e].id,"hex"),algorithms[e.toLowerCase()]=algorithms[e]}),inherits(Sign,stream.Writable),Sign.prototype._write=function(e,t,i){this._hash.update(e),i()},Sign.prototype.update=function(e,t){return"string"==typeof e&&(e=new Buffer(e,t)),this._hash.update(e),this},Sign.prototype.sign=function(e,t){this.end();var i=this._hash.digest(),r=sign(i,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},inherits(Verify,stream.Writable),Verify.prototype._write=function(e,t,i){this._hash.update(e),i()},Verify.prototype.update=function(e,t){return"string"==typeof e&&(e=new Buffer(e,t)),this._hash.update(e),this},Verify.prototype.verify=function(e,t,i){"string"==typeof t&&(t=new Buffer(t,i)),this.end();var r=this._hash.digest();return verify(t,r,e,this._signType,this._tag)},module.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify};
}).call(this,require("buffer").Buffer)
},{"./algorithms.json":45,"./sign":48,"./verify":49,"buffer":53,"create-hash":58,"inherits":115,"stream":183}],48:[function(require,module,exports){
(function (Buffer){
function sign(e,r,t,n,a){var u=parseKeys(r);if(u.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return ecSign(e,u)}if("dsa"===u.type){if("dsa"!==n)throw new Error("wrong private key type");return dsaSign(e,u,t)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");e=Buffer.concat([a,e]);for(var i=u.modulus.byteLength(),o=[0,1];e.length+o.length+1<i;)o.push(255);o.push(0);for(var c=-1;++c<e.length;)o.push(e[c]);return crt(o,u)}function ecSign(e,r){var t=curves[r.curve.join(".")];if(!t)throw new Error("unknown curve "+r.curve.join("."));var n=new EC(t).keyFromPrivate(r.privateKey).sign(e);return new Buffer(n.toDER())}function dsaSign(e,r,t){for(var n,a=r.params.priv_key,u=r.params.p,i=r.params.q,o=r.params.g,c=new BN(0),f=bits2int(e,i).mod(i),s=!1,g=getKey(a,i,e,t);!1===s;)c=makeR(o,n=makeKey(i,g,t),u,i),0===(s=n.invm(i).imul(f.add(a.mul(c))).mod(i)).cmpn(0)&&(s=!1,c=new BN(0));return toDER(c,s)}function toDER(e,r){e=e.toArray(),r=r.toArray(),128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r));var t=[48,e.length+r.length+4,2,e.length];return t=t.concat(e,[2,r.length],r),new Buffer(t)}function getKey(e,r,t,n){if((e=new Buffer(e.toArray())).length<r.byteLength()){var a=new Buffer(r.byteLength()-e.length);a.fill(0),e=Buffer.concat([a,e])}var u=t.length,i=bits2octets(t,r),o=new Buffer(u);o.fill(1);var c=new Buffer(u);return c.fill(0),c=createHmac(n,c).update(o).update(new Buffer([0])).update(e).update(i).digest(),o=createHmac(n,c).update(o).digest(),c=createHmac(n,c).update(o).update(new Buffer([1])).update(e).update(i).digest(),o=createHmac(n,c).update(o).digest(),{k:c,v:o}}function bits2int(e,r){var t=new BN(e),n=(e.length<<3)-r.bitLength();return n>0&&t.ishrn(n),t}function bits2octets(e,r){e=(e=bits2int(e,r)).mod(r);var t=new Buffer(e.toArray());if(t.length<r.byteLength()){var n=new Buffer(r.byteLength()-t.length);n.fill(0),t=Buffer.concat([n,t])}return t}function makeKey(e,r,t){var n,a;do{for(n=new Buffer(0);8*n.length<e.bitLength();)r.v=createHmac(t,r.k).update(r.v).digest(),n=Buffer.concat([n,r.v]);a=bits2int(n,e),r.k=createHmac(t,r.k).update(r.v).update(new Buffer([0])).digest(),r.v=createHmac(t,r.k).update(r.v).digest()}while(-1!==a.cmp(e));return a}function makeR(e,r,t,n){return e.toRed(BN.mont(t)).redPow(r).fromRed().mod(n)}var createHmac=require("create-hmac"),crt=require("browserify-rsa"),EC=require("elliptic").ec,BN=require("bn.js"),parseKeys=require("parse-asn1"),curves=require("./curves.json");module.exports=sign,module.exports.getKey=getKey,module.exports.makeKey=makeKey;
}).call(this,require("buffer").Buffer)
},{"./curves.json":46,"bn.js":19,"browserify-rsa":42,"buffer":53,"create-hmac":61,"elliptic":74,"parse-asn1":136}],49:[function(require,module,exports){
(function (Buffer){
function verify(e,r,n,a,t){var o=parseKeys(n);if("ec"===o.type){if("ecdsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong public key type");return ecVerify(e,r,o)}if("dsa"===o.type){if("dsa"!==a)throw new Error("wrong public key type");return dsaVerify(e,r,o)}if("rsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong public key type");r=Buffer.concat([t,r]);for(var u=o.modulus.byteLength(),i=[1],d=0;r.length+i.length+2<u;)i.push(255),d++;i.push(0);for(var c=-1;++c<r.length;)i.push(r[c]);i=new Buffer(i);var s=BN.mont(o.modulus);e=(e=new BN(e).toRed(s)).redPow(new BN(o.publicExponent)),e=new Buffer(e.fromRed().toArray());var f=d<8?1:0;for(u=Math.min(e.length,i.length),e.length!==i.length&&(f=1),c=-1;++c<u;)f|=e[c]^i[c];return 0===f}function ecVerify(e,r,n){var a=curves[n.data.algorithm.curve.join(".")];if(!a)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var t=new EC(a),o=n.data.subjectPrivateKey.data;return t.verify(r,e,o)}function dsaVerify(e,r,n){var a=n.data.p,t=n.data.q,o=n.data.g,u=n.data.pub_key,i=parseKeys.signature.decode(e,"der"),d=i.s,c=i.r;checkValue(d,t),checkValue(c,t);var s=BN.mont(a),f=d.invm(t);return 0===o.toRed(s).redPow(new BN(r).mul(f).mod(t)).fromRed().mul(u.toRed(s).redPow(c.mul(f).mod(t)).fromRed()).mod(a).mod(t).cmp(c)}function checkValue(e,r){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(r)>=r)throw new Error("invalid sig")}var BN=require("bn.js"),EC=require("elliptic").ec,parseKeys=require("parse-asn1"),curves=require("./curves.json");module.exports=verify;
}).call(this,require("buffer").Buffer)
},{"./curves.json":46,"bn.js":19,"buffer":53,"elliptic":74,"parse-asn1":136}],50:[function(require,module,exports){
var basex=require("base-x"),ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";module.exports=basex(ALPHABET);
},{"base-x":16}],51:[function(require,module,exports){
(function (Buffer){
"use strict";function sha256x2(e){var a=createHash("sha256").update(e).digest();return createHash("sha256").update(a).digest()}function encode(e){var a=sha256x2(e);return base58.encode(Buffer.concat([e,a],e.length+4))}function decodeRaw(e){var a=e.slice(0,-4),d=e.slice(-4),c=sha256x2(a);if(!(d[0]^c[0]|d[1]^c[1]|d[2]^c[2]|d[3]^c[3]))return a}function decodeUnsafe(e){var a=base58.decodeUnsafe(e);if(a)return decodeRaw(new Buffer(a))}function decode(e){var a=base58.decode(e),d=decodeRaw(new Buffer(a));if(!d)throw new Error("Invalid checksum");return d}var base58=require("bs58"),createHash=require("create-hash");module.exports={encode:encode,decode:decode,decodeUnsafe:decodeUnsafe,decodeRaw:decodeUnsafe};
}).call(this,require("buffer").Buffer)
},{"bs58":50,"buffer":53,"create-hash":58}],52:[function(require,module,exports){
(function (Buffer){
module.exports=function(e,n){for(var r=Math.min(e.length,n.length),t=new Buffer(r),f=0;f<r;++f)t[f]=e[f]^n[f];return t};
}).call(this,require("buffer").Buffer)
},{"buffer":53}],53:[function(require,module,exports){
"use strict";function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=Buffer.prototype,t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return isArrayBuffer(e)?fromArrayBuffer(e,t,r):"string"==typeof e?fromString(e,t):fromObject(e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),n.__proto__=Buffer.prototype,n}function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),r=createBuffer(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(e){if(isArrayBufferView(e)||"length"in e)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(isArrayBufferView(e)||isArrayBuffer(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,numberIsNaN(r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}var a;if(f){var h=-1;for(a=r;a<u;a++)if(i(e,a)===i(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===s)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var c=!0,l=0;l<s;l++)if(i(e,a+l)!==i(t,l)){c=!1;break}if(c)return a}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var f=e.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(t.substr(2*o,2),16);if(numberIsNaN(u))return o;e[r+o]=u}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?base64.fromByteArray(e):base64.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],f=t;f<r;){var i=e[f],o=null,u=i>239?4:i>223?3:i>191?2:1;if(f+u<=r){var s,a,h,c;switch(u){case 1:i<128&&(o=i);break;case 2:128==(192&(s=e[f+1]))&&(c=(31&i)<<6|63&s)>127&&(o=c);break;case 3:s=e[f+1],a=e[f+2],128==(192&s)&&128==(192&a)&&(c=(15&i)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:s=e[f+1],a=e[f+2],h=e[f+3],128==(192&s)&&128==(192&a)&&128==(192&h)&&(c=(15&i)<<18|(63&s)<<12|(63&a)<<6|63&h)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),f+=u}return decodeCodePointsArray(n)}function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(127&e[f]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(e[f]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=t;i<r;++i)f+=toHex(e[i]);return f}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}function base64clean(e){if((e=e.trim().replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){t=t||1/0;for(var r,n=e.length,f=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,f,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f<n&&!(f+r>=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isArrayBuffer(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function isArrayBufferView(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function numberIsNaN(e){return e!==e}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer},Buffer.compare=function(e,t){if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);f<i;++f)if(e[f]!==t[f]){r=e[f],n=t[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),f=0;for(r=0;r<e.length;++r){var i=e[r];if(!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function(){var e="",t=exports.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},Buffer.prototype.compare=function(e,t,r,n,f){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,f>>>=0,this===e)return 0;for(var i=f-n,o=r-t,u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=Buffer.prototype,n},Buffer.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n},Buffer.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return f*=128,n>=f&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return f*=128,i>=f&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i<r&&(f*=256);)this[t+i]=e/f&255;return t+r},Buffer.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var f,i=n-r;if(this===e&&r<t&&t<n)for(f=i-1;f>=0;--f)e[f+t]=this[f+r];else if(i<1e3)for(f=0;f<i;++f)e[f+t]=this[f+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var f=e.charCodeAt(0);f<256&&(e=f)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=Buffer.isBuffer(e)?e:new Buffer(e,n),u=o.length;for(i=0;i<r-t;++i)this[i+t]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;
},{"base64-js":17,"ieee754":113}],54:[function(require,module,exports){
function CipherBase(t){Transform.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=require("safe-buffer").Buffer,Transform=require("stream").Transform,StringDecoder=require("string_decoder").StringDecoder,inherits=require("inherits");inherits(CipherBase,Transform),CipherBase.prototype.update=function(t,e,r){"string"==typeof t&&(t=Buffer.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},CipherBase.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},CipherBase.prototype._finalOrDigest=function(t){var e=this.__final()||Buffer.alloc(0);return t&&(e=this._toString(e,t,!0)),e},CipherBase.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new StringDecoder(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},module.exports=CipherBase;
},{"inherits":115,"safe-buffer":166,"stream":183,"string_decoder":184}],55:[function(require,module,exports){
!function(n){"use strict";function t(n){return n.map(function(n){return e(n.toString(16),2)}).join("")}function e(n,t){return n.length>t?n:Array(t-n.length+1).join("0")+n}var r={bytesToHex:function(n){return t(n)},hexToBytes:function(n){if(n.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===n.indexOf("0x")&&(n=n.slice(2)),n.match(/../g).map(function(n){return parseInt(n,16)})}};"undefined"!=typeof module&&module.exports?module.exports=r:n.convertHex=r}(this);
},{}],56:[function(require,module,exports){
(function (Buffer){
function isArray(r){return Array.isArray?Array.isArray(r):"[object Array]"===objectToString(r)}function isBoolean(r){return"boolean"==typeof r}function isNull(r){return null===r}function isNullOrUndefined(r){return null==r}function isNumber(r){return"number"==typeof r}function isString(r){return"string"==typeof r}function isSymbol(r){return"symbol"==typeof r}function isUndefined(r){return void 0===r}function isRegExp(r){return"[object RegExp]"===objectToString(r)}function isObject(r){return"object"==typeof r&&null!==r}function isDate(r){return"[object Date]"===objectToString(r)}function isError(r){return"[object Error]"===objectToString(r)||r instanceof Error}function isFunction(r){return"function"==typeof r}function isPrimitive(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function objectToString(r){return Object.prototype.toString.call(r)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer;
}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
},{"../../is-buffer/index.js":116}],57:[function(require,module,exports){
(function (Buffer){
function ECDH(e){this.curveType=aliases[e],this.curveType||(this.curveType={name:e}),this.curve=new elliptic.ec(this.curveType.name),this.keys=void 0}function formatReturnValue(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new Buffer(e);if(r&&i.length<r){var s=new Buffer(r-i.length);s.fill(0),i=Buffer.concat([s,i])}return t?i.toString(t):i}var elliptic=require("elliptic"),BN=require("bn.js");module.exports=function(e){return new ECDH(e)};var aliases={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};aliases.p224=aliases.secp224r1,aliases.p256=aliases.secp256r1=aliases.prime256v1,aliases.p192=aliases.secp192r1=aliases.prime192v1,aliases.p384=aliases.secp384r1,aliases.p521=aliases.secp521r1,ECDH.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},ECDH.prototype.computeSecret=function(e,t,r){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),formatReturnValue(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},ECDH.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),formatReturnValue(r,e)},ECDH.prototype.getPrivateKey=function(e){return formatReturnValue(this.keys.getPrivate(),e)},ECDH.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},ECDH.prototype.setPrivateKey=function(e,t){t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t));var r=new BN(e);return r=r.toString(16),this.keys._importPrivate(r),this};
}).call(this,require("buffer").Buffer)
},{"bn.js":19,"buffer":53,"elliptic":74}],58:[function(require,module,exports){
(function (Buffer){
"use strict";function HashNoConstructor(s){Base.call(this,"digest"),this._hash=s,this.buffers=[]}function Hash(s){Base.call(this,"digest"),this._hash=s}var inherits=require("inherits"),md5=require("./md5"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),Base=require("cipher-base");inherits(HashNoConstructor,Base),HashNoConstructor.prototype._update=function(s){this.buffers.push(s)},HashNoConstructor.prototype._final=function(){var s=Buffer.concat(this.buffers),t=this._hash(s);return this.buffers=null,t},inherits(Hash,Base),Hash.prototype._update=function(s){this._hash.update(s)},Hash.prototype._final=function(){return this._hash.digest()},module.exports=function(s){return"md5"===(s=s.toLowerCase())?new HashNoConstructor(md5):new Hash("rmd160"===s||"ripemd160"===s?new RIPEMD160:sha(s))};
}).call(this,require("buffer").Buffer)
},{"./md5":60,"buffer":53,"cipher-base":54,"inherits":115,"ripemd160":164,"sha.js":176}],59:[function(require,module,exports){
(function (Buffer){
"use strict";function toArray(e){if(e.length%intSize!=0){var r=e.length+(intSize-e.length%intSize);e=Buffer.concat([e,zeroBuffer],r)}for(var t=new Array(e.length>>>2),n=0,i=0;n<e.length;n+=intSize,i++)t[i]=e.readInt32LE(n);return t}var intSize=4,zeroBuffer=new Buffer(intSize);zeroBuffer.fill(0);var charSize=8,hashSize=16;module.exports=function(e,r){var t=r(toArray(e),e.length*charSize);e=new Buffer(hashSize);for(var n=0;n<t.length;n++)e.writeInt32LE(t[n],n<<2,!0);return e};
}).call(this,require("buffer").Buffer)
},{"buffer":53}],60:[function(require,module,exports){
"use strict";function core_md5(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,i=-1732584194,h=271733878,g=0;g<d.length;g+=16){var n=m,r=f,e=i,a=h;f=md5_ii(f=md5_ii(f=md5_ii(f=md5_ii(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_ff(f=md5_ff(f=md5_ff(f=md5_ff(f,i=md5_ff(i,h=md5_ff(h,m=md5_ff(m,f,i,h,d[g+0],7,-680876936),f,i,d[g+1],12,-389564586),m,f,d[g+2],17,606105819),h,m,d[g+3],22,-1044525330),i=md5_ff(i,h=md5_ff(h,m=md5_ff(m,f,i,h,d[g+4],7,-176418897),f,i,d[g+5],12,1200080426),m,f,d[g+6],17,-1473231341),h,m,d[g+7],22,-45705983),i=md5_ff(i,h=md5_ff(h,m=md5_ff(m,f,i,h,d[g+8],7,1770035416),f,i,d[g+9],12,-1958414417),m,f,d[g+10],17,-42063),h,m,d[g+11],22,-1990404162),i=md5_ff(i,h=md5_ff(h,m=md5_ff(m,f,i,h,d[g+12],7,1804603682),f,i,d[g+13],12,-40341101),m,f,d[g+14],17,-1502002290),h,m,d[g+15],22,1236535329),i=md5_gg(i,h=md5_gg(h,m=md5_gg(m,f,i,h,d[g+1],5,-165796510),f,i,d[g+6],9,-1069501632),m,f,d[g+11],14,643717713),h,m,d[g+0],20,-373897302),i=md5_gg(i,h=md5_gg(h,m=md5_gg(m,f,i,h,d[g+5],5,-701558691),f,i,d[g+10],9,38016083),m,f,d[g+15],14,-660478335),h,m,d[g+4],20,-405537848),i=md5_gg(i,h=md5_gg(h,m=md5_gg(m,f,i,h,d[g+9],5,568446438),f,i,d[g+14],9,-1019803690),m,f,d[g+3],14,-187363961),h,m,d[g+8],20,1163531501),i=md5_gg(i,h=md5_gg(h,m=md5_gg(m,f,i,h,d[g+13],5,-1444681467),f,i,d[g+2],9,-51403784),m,f,d[g+7],14,1735328473),h,m,d[g+12],20,-1926607734),i=md5_hh(i,h=md5_hh(h,m=md5_hh(m,f,i,h,d[g+5],4,-378558),f,i,d[g+8],11,-2022574463),m,f,d[g+11],16,1839030562),h,m,d[g+14],23,-35309556),i=md5_hh(i,h=md5_hh(h,m=md5_hh(m,f,i,h,d[g+1],4,-1530992060),f,i,d[g+4],11,1272893353),m,f,d[g+7],16,-155497632),h,m,d[g+10],23,-1094730640),i=md5_hh(i,h=md5_hh(h,m=md5_hh(m,f,i,h,d[g+13],4,681279174),f,i,d[g+0],11,-358537222),m,f,d[g+3],16,-722521979),h,m,d[g+6],23,76029189),i=md5_hh(i,h=md5_hh(h,m=md5_hh(m,f,i,h,d[g+9],4,-640364487),f,i,d[g+12],11,-421815835),m,f,d[g+15],16,530742520),h,m,d[g+2],23,-995338651),i=md5_ii(i,h=md5_ii(h,m=md5_ii(m,f,i,h,d[g+0],6,-198630844),f,i,d[g+7],10,1126891415),m,f,d[g+14],15,-1416354905),h,m,d[g+5],21,-57434055),i=md5_ii(i,h=md5_ii(h,m=md5_ii(m,f,i,h,d[g+12],6,1700485571),f,i,d[g+3],10,-1894986606),m,f,d[g+10],15,-1051523),h,m,d[g+1],21,-2054922799),i=md5_ii(i,h=md5_ii(h,m=md5_ii(m,f,i,h,d[g+8],6,1873313359),f,i,d[g+15],10,-30611744),m,f,d[g+6],15,-1560198380),h,m,d[g+13],21,1309151649),i=md5_ii(i,h=md5_ii(h,m=md5_ii(m,f,i,h,d[g+4],6,-145523070),f,i,d[g+11],10,-1120210379),m,f,d[g+2],15,718787259),h,m,d[g+9],21,-343485551),m=safe_add(m,n),f=safe_add(f,r),i=safe_add(i,e),h=safe_add(h,a)}return[m,f,i,h]}function md5_cmn(d,_,m,f,i,h){return safe_add(bit_rol(safe_add(safe_add(_,d),safe_add(f,h)),i),m)}function md5_ff(d,_,m,f,i,h,g){return md5_cmn(_&m|~_&f,d,_,i,h,g)}function md5_gg(d,_,m,f,i,h,g){return md5_cmn(_&f|m&~f,d,_,i,h,g)}function md5_hh(d,_,m,f,i,h,g){return md5_cmn(_^m^f,d,_,i,h,g)}function md5_ii(d,_,m,f,i,h,g){return md5_cmn(m^(_|~f),d,_,i,h,g)}function safe_add(d,_){var m=(65535&d)+(65535&_);return(d>>16)+(_>>16)+(m>>16)<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}var makeHash=require("./make-hash");module.exports=function(d){return makeHash(d,core_md5)};
},{"./make-hash":59}],61:[function(require,module,exports){
"use strict";function Hmac(e,a){Base.call(this,"digest"),"string"==typeof a&&(a=Buffer.from(a));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>r?a=("rmd160"===e?new RIPEMD160:sha(e)).update(a).digest():a.length<r&&(a=Buffer.concat([a,ZEROS],r));for(var t=this._ipad=Buffer.allocUnsafe(r),s=this._opad=Buffer.allocUnsafe(r),i=0;i<r;i++)t[i]=54^a[i],s[i]=92^a[i];this._hash="rmd160"===e?new RIPEMD160:sha(e),this._hash.update(t)}var inherits=require("inherits"),Legacy=require("./legacy"),Base=require("cipher-base"),Buffer=require("safe-buffer").Buffer,md5=require("create-hash/md5"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),ZEROS=Buffer.alloc(128);inherits(Hmac,Base),Hmac.prototype._update=function(e){this._hash.update(e)},Hmac.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new RIPEMD160:sha(this._alg)).update(this._opad).update(e).digest()},module.exports=function(e,a){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new Hmac("rmd160",a):"md5"===e?new Legacy(md5,a):new Hmac(e,a)};
},{"./legacy":62,"cipher-base":54,"create-hash/md5":60,"inherits":115,"ripemd160":164,"safe-buffer":166,"sha.js":176}],62:[function(require,module,exports){
"use strict";function Hmac(e,s){Base.call(this,"digest"),"string"==typeof s&&(s=Buffer.from(s)),this._alg=e,this._key=s,s.length>blocksize?s=e(s):s.length<blocksize&&(s=Buffer.concat([s,ZEROS],blocksize));for(var i=this._ipad=Buffer.allocUnsafe(blocksize),t=this._opad=Buffer.allocUnsafe(blocksize),a=0;a<blocksize;a++)i[a]=54^s[a],t[a]=92^s[a];this._hash=[i]}var inherits=require("inherits"),Buffer=require("safe-buffer").Buffer,Base=require("cipher-base"),ZEROS=Buffer.alloc(128),blocksize=64;inherits(Hmac,Base),Hmac.prototype._update=function(e){this._hash.push(e)},Hmac.prototype._final=function(){var e=this._alg(Buffer.concat(this._hash));return this._alg(Buffer.concat([this._opad,e]))},module.exports=Hmac;
},{"cipher-base":54,"inherits":115,"safe-buffer":166}],63:[function(require,module,exports){
"use strict";exports.randomBytes=exports.rng=exports.pseudoRandomBytes=exports.prng=require("randombytes"),exports.createHash=exports.Hash=require("create-hash"),exports.createHmac=exports.Hmac=require("create-hmac");var algos=require("browserify-sign/algos"),algoKeys=Object.keys(algos),hashes=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(algoKeys);exports.getHashes=function(){return hashes};var p=require("pbkdf2");exports.pbkdf2=p.pbkdf2,exports.pbkdf2Sync=p.pbkdf2Sync;var aes=require("browserify-cipher");exports.Cipher=aes.Cipher,exports.createCipher=aes.createCipher,exports.Cipheriv=aes.Cipheriv,exports.createCipheriv=aes.createCipheriv,exports.Decipher=aes.Decipher,exports.createDecipher=aes.createDecipher,exports.Decipheriv=aes.Decipheriv,exports.createDecipheriv=aes.createDecipheriv,exports.getCiphers=aes.getCiphers,exports.listCiphers=aes.listCiphers;var dh=require("diffie-hellman");exports.DiffieHellmanGroup=dh.DiffieHellmanGroup,exports.createDiffieHellmanGroup=dh.createDiffieHellmanGroup,exports.getDiffieHellman=dh.getDiffieHellman,exports.createDiffieHellman=dh.createDiffieHellman,exports.DiffieHellman=dh.DiffieHellman;var sign=require("browserify-sign");exports.createSign=sign.createSign,exports.Sign=sign.Sign,exports.createVerify=sign.createVerify,exports.Verify=sign.Verify,exports.createECDH=require("create-ecdh");var publicEncrypt=require("public-encrypt");exports.publicEncrypt=publicEncrypt.publicEncrypt,exports.privateEncrypt=publicEncrypt.privateEncrypt,exports.publicDecrypt=publicEncrypt.publicDecrypt,exports.privateDecrypt=publicEncrypt.privateDecrypt,exports.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},exports.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6};
},{"browserify-cipher":39,"browserify-sign":47,"browserify-sign/algos":44,"create-ecdh":57,"create-hash":58,"create-hmac":61,"diffie-hellman":70,"pbkdf2":137,"public-encrypt":144,"randombytes":150}],64:[function(require,module,exports){
"use strict";exports.utils=require("./des/utils"),exports.Cipher=require("./des/cipher"),exports.DES=require("./des/des"),exports.CBC=require("./des/cbc"),exports.EDE=require("./des/ede");
},{"./des/cbc":65,"./des/cipher":66,"./des/des":67,"./des/ede":68,"./des/utils":69}],65:[function(require,module,exports){
"use strict";function CBCState(t){assert.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var i=0;i<this.iv.length;i++)this.iv[i]=t[i]}function instantiate(t){function i(i){t.call(this,i),this._cbcInit()}inherits(i,t);for(var e=Object.keys(proto),r=0;r<e.length;r++){var n=e[r];i.prototype[n]=proto[n]}return i.create=function(t){return new i(t)},i}var assert=require("minimalistic-assert"),inherits=require("inherits"),proto={};exports.instantiate=instantiate,proto._cbcInit=function(){var t=new CBCState(this.options.iv);this._cbcState=t},proto._update=function(t,i,e,r){var n=this._cbcState,s=this.constructor.super_.prototype,o=n.iv;if("encrypt"===this.type){for(a=0;a<this.blockSize;a++)o[a]^=t[i+a];s._update.call(this,o,0,e,r);for(a=0;a<this.blockSize;a++)o[a]=e[r+a]}else{s._update.call(this,t,i,e,r);for(a=0;a<this.blockSize;a++)e[r+a]^=o[a];for(var a=0;a<this.blockSize;a++)o[a]=t[i+a]}};
},{"inherits":115,"minimalistic-assert":130}],66:[function(require,module,exports){
"use strict";function Cipher(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}var assert=require("minimalistic-assert");module.exports=Cipher,Cipher.prototype._init=function(){},Cipher.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},Cipher.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),i=0;i<r;i++)this.buffer[this.bufferOff+i]=t[e+i];return this.bufferOff+=r,r},Cipher.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},Cipher.prototype._updateEncrypt=function(t){var e=0,r=0,i=(this.bufferOff+t.length)/this.blockSize|0,f=new Array(i*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(f,r)));for(var h=t.length-(t.length-e)%this.blockSize;e<h;e+=this.blockSize)this._update(t,e,f,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return f},Cipher.prototype._updateDecrypt=function(t){for(var e=0,r=0,i=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,f=new Array(i*this.blockSize);i>0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(f,r);return e+=this._buffer(t,e),f},Cipher.prototype.final=function(t){var e;t&&(e=this.update(t));var r;return r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},Cipher.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},Cipher.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},Cipher.prototype._unpad=function(t){return t},Cipher.prototype._finalDecrypt=function(){assert.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)};
},{"minimalistic-assert":130}],67:[function(require,module,exports){
"use strict";function DESState(){this.tmp=new Array(2),this.keys=null}function DES(t){Cipher.call(this,t);var e=new DESState;this._desState=e,this.deriveKeys(e,t.key)}var assert=require("minimalistic-assert"),inherits=require("inherits"),des=require("../des"),utils=des.utils,Cipher=des.Cipher;inherits(DES,Cipher),module.exports=DES,DES.create=function(t){return new DES(t)};var shiftTable=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES.prototype.deriveKeys=function(t,e){t.keys=new Array(32),assert.equal(e.length,this.blockSize,"Invalid key length");var r=utils.readUInt32BE(e,0),s=utils.readUInt32BE(e,4);utils.pc1(r,s,t.tmp,0),r=t.tmp[0],s=t.tmp[1];for(var i=0;i<t.keys.length;i+=2){var n=shiftTable[i>>>1];r=utils.r28shl(r,n),s=utils.r28shl(s,n),utils.pc2(r,s,t.keys,i)}},DES.prototype._update=function(t,e,r,s){var i=this._desState,n=utils.readUInt32BE(t,e),p=utils.readUInt32BE(t,e+4);utils.ip(n,p,i.tmp,0),n=i.tmp[0],p=i.tmp[1],"encrypt"===this.type?this._encrypt(i,n,p,i.tmp,0):this._decrypt(i,n,p,i.tmp,0),n=i.tmp[0],p=i.tmp[1],utils.writeUInt32BE(r,n,s),utils.writeUInt32BE(r,p,s+4)},DES.prototype._pad=function(t,e){for(var r=t.length-e,s=e;s<t.length;s++)t[s]=r;return!0},DES.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)assert.equal(t[r],e);return t.slice(0,t.length-e)},DES.prototype._encrypt=function(t,e,r,s,i){for(var n=e,p=r,u=0;u<t.keys.length;u+=2){var l=t.keys[u],a=t.keys[u+1];utils.expand(p,t.tmp,0),l^=t.tmp[0],a^=t.tmp[1];var h=utils.substitute(l,a),o=p;p=(n^utils.permute(h))>>>0,n=o}utils.rip(p,n,s,i)},DES.prototype._decrypt=function(t,e,r,s,i){for(var n=r,p=e,u=t.keys.length-2;u>=0;u-=2){var l=t.keys[u],a=t.keys[u+1];utils.expand(n,t.tmp,0),l^=t.tmp[0],a^=t.tmp[1];var h=utils.substitute(l,a),o=n;n=(p^utils.permute(h))>>>0,p=o}utils.rip(n,p,s,i)};
},{"../des":64,"inherits":115,"minimalistic-assert":130}],68:[function(require,module,exports){
"use strict";function EDEState(e,t){assert.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),p=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[DES.create({type:"encrypt",key:r}),DES.create({type:"decrypt",key:p}),DES.create({type:"encrypt",key:i})]:[DES.create({type:"decrypt",key:i}),DES.create({type:"encrypt",key:p}),DES.create({type:"decrypt",key:r})]}function EDE(e){Cipher.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}var assert=require("minimalistic-assert"),inherits=require("inherits"),des=require("../des"),Cipher=des.Cipher,DES=des.DES;inherits(EDE,Cipher),module.exports=EDE,EDE.create=function(e){return new EDE(e)},EDE.prototype._update=function(e,t,r,p){var i=this._edeState;i.ciphers[0]._update(e,t,r,p),i.ciphers[1]._update(r,p,r,p),i.ciphers[2]._update(r,p,r,p)},EDE.prototype._pad=DES.prototype._pad,EDE.prototype._unpad=DES.prototype._unpad;
},{"../des":64,"inherits":115,"minimalistic-assert":130}],69:[function(require,module,exports){
"use strict";exports.readUInt32BE=function(r,o){return(r[0+o]<<24|r[1+o]<<16|r[2+o]<<8|r[3+o])>>>0},exports.writeUInt32BE=function(r,o,t){r[0+t]=o>>>24,r[1+t]=o>>>16&255,r[2+t]=o>>>8&255,r[3+t]=255&o},exports.ip=function(r,o,t,e){for(var f=0,n=0,a=6;a>=0;a-=2){for(p=0;p<=24;p+=8)f<<=1,f|=o>>>p+a&1;for(p=0;p<=24;p+=8)f<<=1,f|=r>>>p+a&1}for(a=6;a>=0;a-=2){for(p=1;p<=25;p+=8)n<<=1,n|=o>>>p+a&1;for(var p=1;p<=25;p+=8)n<<=1,n|=r>>>p+a&1}t[e+0]=f>>>0,t[e+1]=n>>>0},exports.rip=function(r,o,t,e){for(var f=0,n=0,a=0;a<4;a++)for(p=24;p>=0;p-=8)f<<=1,f|=o>>>p+a&1,f<<=1,f|=r>>>p+a&1;for(a=4;a<8;a++)for(var p=24;p>=0;p-=8)n<<=1,n|=o>>>p+a&1,n<<=1,n|=r>>>p+a&1;t[e+0]=f>>>0,t[e+1]=n>>>0},exports.pc1=function(r,o,t,e){for(var f=0,n=0,a=7;a>=5;a--){for(p=0;p<=24;p+=8)f<<=1,f|=o>>p+a&1;for(p=0;p<=24;p+=8)f<<=1,f|=r>>p+a&1}for(p=0;p<=24;p+=8)f<<=1,f|=o>>p+a&1;for(a=1;a<=3;a++){for(p=0;p<=24;p+=8)n<<=1,n|=o>>p+a&1;for(p=0;p<=24;p+=8)n<<=1,n|=r>>p+a&1}for(var p=0;p<=24;p+=8)n<<=1,n|=r>>p+a&1;t[e+0]=f>>>0,t[e+1]=n>>>0},exports.r28shl=function(r,o){return r<<o&268435455|r>>>28-o};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];exports.pc2=function(r,o,t,e){for(var f=0,n=0,a=pc2table.length>>>1,p=0;p<a;p++)f<<=1,f|=r>>>pc2table[p]&1;for(p=a;p<pc2table.length;p++)n<<=1,n|=o>>>pc2table[p]&1;t[e+0]=f>>>0,t[e+1]=n>>>0},exports.expand=function(r,o,t){var e=0,f=0;e=(1&r)<<5|r>>>27;for(n=23;n>=15;n-=4)e<<=6,e|=r>>>n&63;for(var n=11;n>=3;n-=4)f|=r>>>n&63,f<<=6;f|=(31&r)<<1|r>>>31,o[t+0]=e>>>0,o[t+1]=f>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];exports.substitute=function(r,o){for(var t=0,e=0;e<4;e++)t<<=4,t|=n=sTable[64*e+(f=r>>>18-6*e&63)];for(e=0;e<4;e++){var f=o>>>18-6*e&63,n=sTable[256+64*e+f];t<<=4,t|=n}return t>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];exports.permute=function(r){for(var o=0,t=0;t<permuteTable.length;t++)o<<=1,o|=r>>>permuteTable[t]&1;return o>>>0},exports.padSplit=function(r,o,t){for(var e=r.toString(2);e.length<o;)e="0"+e;for(var f=[],n=0;n<o;n+=t)f.push(e.slice(n,n+t));return f.join(" ")};
},{}],70:[function(require,module,exports){
(function (Buffer){
function getDiffieHellman(e){var r=new Buffer(primes[e].prime,"hex"),f=new Buffer(primes[e].gen,"hex");return new DH(r,f)}function createDiffieHellman(e,r,f,i){return Buffer.isBuffer(r)||void 0===ENCODINGS[r]?createDiffieHellman(e,"binary",r,f):(r=r||"binary",i=i||"binary",f=f||new Buffer([2]),Buffer.isBuffer(f)||(f=new Buffer(f,i)),"number"==typeof e?new DH(generatePrime(e,f),f,!0):(Buffer.isBuffer(e)||(e=new Buffer(e,r)),new DH(e,f,!0)))}var generatePrime=require("./lib/generatePrime"),primes=require("./lib/primes.json"),DH=require("./lib/dh"),ENCODINGS={binary:!0,hex:!0,base64:!0};exports.DiffieHellmanGroup=exports.createDiffieHellmanGroup=exports.getDiffieHellman=getDiffieHellman,exports.createDiffieHellman=exports.DiffieHellman=createDiffieHellman;
}).call(this,require("buffer").Buffer)
},{"./lib/dh":71,"./lib/generatePrime":72,"./lib/primes.json":73,"buffer":53}],71:[function(require,module,exports){
(function (Buffer){
function setPublicKey(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this._pub=new BN(e),this}function setPrivateKey(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this._priv=new BN(e),this}function checkPrime(e,r){var t=r.toString("hex"),i=[t,e.toString(16)].join("_");if(i in primeCache)return primeCache[i];var n=0;if(e.isEven()||!primes.simpleSieve||!primes.fermatTest(e)||!millerRabin.test(e))return n+=1,n+="02"===t||"05"===t?8:4,primeCache[i]=n,n;millerRabin.test(e.shrn(1))||(n+=2);var u;switch(t){case"02":e.mod(TWENTYFOUR).cmp(ELEVEN)&&(n+=8);break;case"05":(u=e.mod(TEN)).cmp(THREE)&&u.cmp(SEVEN)&&(n+=8);break;default:n+=4}return primeCache[i]=n,n}function DH(e,r,t){this.setGenerator(r),this.__prime=new BN(e),this._prime=BN.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=setPublicKey,this.setPrivateKey=setPrivateKey):this._primeCode=8}function formatReturnValue(e,r){var t=new Buffer(e.toArray());return r?t.toString(r):t}var BN=require("bn.js"),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,TWENTYFOUR=new BN(24),ELEVEN=new BN(11),TEN=new BN(10),THREE=new BN(3),SEVEN=new BN(7),primes=require("./generatePrime"),randomBytes=require("randombytes");module.exports=DH;var primeCache={};Object.defineProperty(DH.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=checkPrime(this.__prime,this.__gen)),this._primeCode}}),DH.prototype.generateKeys=function(){return this._priv||(this._priv=new BN(randomBytes(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},DH.prototype.computeSecret=function(e){var r=(e=(e=new BN(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new Buffer(r.toArray()),i=this.getPrime();if(t.length<i.length){var n=new Buffer(i.length-t.length);n.fill(0),t=Buffer.concat([n,t])}return t},DH.prototype.getPublicKey=function(e){return formatReturnValue(this._pub,e)},DH.prototype.getPrivateKey=function(e){return formatReturnValue(this._priv,e)},DH.prototype.getPrime=function(e){return formatReturnValue(this.__prime,e)},DH.prototype.getGenerator=function(e){return formatReturnValue(this._gen,e)},DH.prototype.setGenerator=function(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this.__gen=e,this._gen=new BN(e),this};
}).call(this,require("buffer").Buffer)
},{"./generatePrime":72,"bn.js":19,"buffer":53,"miller-rabin":129,"randombytes":150}],72:[function(require,module,exports){
function _getPrimes(){if(null!==primes)return primes;var e=[];e[0]=2;for(var r=1,i=3;i<1048576;i+=2){for(var n=Math.ceil(Math.sqrt(i)),t=0;t<r&&e[t]<=n&&i%e[t]!=0;t++);r!==t&&e[t]<=n||(e[r++]=i)}return primes=e,e}function simpleSieve(e){for(var r=_getPrimes(),i=0;i<r.length;i++)if(0===e.modn(r[i]))return 0===e.cmpn(r[i]);return!0}function fermatTest(e){var r=BN.mont(e);return 0===TWO.toRed(r).redPow(e.subn(1)).fromRed().cmpn(1)}function findPrime(e,r){if(e<16)return new BN(2===r||5===r?[140,123]:[140,39]);r=new BN(r);for(var i,n;;){for(i=new BN(randomBytes(Math.ceil(e/8)));i.bitLength()>e;)i.ishrn(1);if(i.isEven()&&i.iadd(ONE),i.testn(1)||i.iadd(TWO),r.cmp(TWO)){if(!r.cmp(FIVE))for(;i.mod(TEN).cmp(THREE);)i.iadd(FOUR)}else for(;i.mod(TWENTYFOUR).cmp(ELEVEN);)i.iadd(FOUR);if(n=i.shrn(1),simpleSieve(n)&&simpleSieve(i)&&fermatTest(n)&&fermatTest(i)&&millerRabin.test(n)&&millerRabin.test(i))return i}}var randomBytes=require("randombytes");module.exports=findPrime,findPrime.simpleSieve=simpleSieve,findPrime.fermatTest=fermatTest;var BN=require("bn.js"),TWENTYFOUR=new BN(24),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,ONE=new BN(1),TWO=new BN(2),FIVE=new BN(5),SIXTEEN=new BN(16),EIGHT=new BN(8),TEN=new BN(10),THREE=new BN(3),SEVEN=new BN(7),ELEVEN=new BN(11),FOUR=new BN(4),TWELVE=new BN(12),primes=null;
},{"bn.js":19,"miller-rabin":129,"randombytes":150}],73:[function(require,module,exports){
module.exports={
"modp1": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"
},
"modp2": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"
},
"modp5": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"
},
"modp14": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"
},
"modp15": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"
},
"modp16": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"
},
"modp17": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"
},
"modp18": {
"gen": "02",
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"
}
}
},{}],74:[function(require,module,exports){
"use strict";var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("brorand"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec"),elliptic.eddsa=require("./elliptic/eddsa");
},{"../package.json":89,"./elliptic/curve":77,"./elliptic/curves":80,"./elliptic/ec":81,"./elliptic/eddsa":84,"./elliptic/utils":88,"brorand":20}],75:[function(require,module,exports){
"use strict";function BaseCurve(t,e){this.type=t,this.p=new BN(e.p,16),this.red=e.prime?BN.red(e.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=e.n&&new BN(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(t,e){assert(t.precomputed);var n=t._getDoubles(),r=getNAF(e,1),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;for(var o=[],s=0;s<r.length;s+=n.step){for(var a=0,e=s+n.step-1;e>=s;e--)a=(a<<1)+r[e];o.push(a)}for(var p=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<o.length;s++)(a=o[s])===d?u=u.mixedAdd(n.points[s]):a===-d&&(u=u.mixedAdd(n.points[s].neg()));p=p.add(u)}return p.toP()},BaseCurve.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=getNAF(e,n),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var e=0;a>=0&&0===o[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),a<0)break;var p=o[a];assert(0!==p),s="affine"===t.type?p>0?s.mixedAdd(i[p-1>>1]):s.mixedAdd(i[-p-1>>1].neg()):p>0?s.add(i[p-1>>1]):s.add(i[-p-1>>1].neg())}return"affine"===t.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function(t,e,n,r,i){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,p=0,u=0;u<r;u++){var d=(N=e[u])._getNAFPoints(t);o[u]=d.wnd,s[u]=d.points}for(u=r-1;u>=1;u-=2){var l=u-1,h=u;if(1===o[l]&&1===o[h]){var f=[e[l],null,null,e[h]];0===e[l].y.cmp(e[h].y)?(f[1]=e[l].add(e[h]),f[2]=e[l].toJ().mixedAdd(e[h].neg())):0===e[l].y.cmp(e[h].y.redNeg())?(f[1]=e[l].toJ().mixedAdd(e[h]),f[2]=e[l].add(e[h].neg())):(f[1]=e[l].toJ().mixedAdd(e[h]),f[2]=e[l].toJ().mixedAdd(e[h].neg()));var c=[-3,-1,-5,-7,0,7,5,1,3],g=getJSF(n[l],n[h]);p=Math.max(g[0].length,p),a[l]=new Array(p),a[h]=new Array(p);for(b=0;b<p;b++){var v=0|g[0][b],m=0|g[1][b];a[l][b]=c[3*(v+1)+(m+1)],a[h][b]=0,s[l]=f}}else a[l]=getNAF(n[l],o[l]),a[h]=getNAF(n[h],o[h]),p=Math.max(a[l].length,p),p=Math.max(a[h].length,p)}for(var y=this.jpoint(null,null,null),w=this._wnafT4,u=p;u>=0;u--){for(var B=0;u>=0;){for(var A=!0,b=0;b<r;b++)w[b]=0|a[b][u],0!==w[b]&&(A=!1);if(!A)break;B++,u--}if(u>=0&&B++,y=y.dblp(B),u<0)break;for(b=0;b<r;b++){var N,_=w[b];0!==_&&(_>0?N=s[b][_-1>>1]:_<0&&(N=s[b][-_-1>>1].neg()),y="affine"===N.type?y.mixedAdd(N):y.add(N))}}for(u=0;u<r;u++)s[u]=null;return i?y:y.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function(){throw new Error("Not implemented")},BasePoint.prototype.validate=function(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function(t,e){t=utils.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?assert(t[t.length-1]%2==0):7===t[0]&&assert(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function(t){return this.encode(t,!0)},BasePoint.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},BasePoint.prototype.encode=function(t,e){return utils.encode(this._encode(e),t)},BasePoint.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},BasePoint.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},BasePoint.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)r=r.dbl();n.push(r)}return{step:t,points:n}},BasePoint.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)e[i]=e[i-1].add(r);return{wnd:t,points:e}},BasePoint.prototype._getBeta=function(){return null},BasePoint.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};
},{"../../elliptic":74,"bn.js":19}],76:[function(require,module,exports){
"use strict";function EdwardsCurve(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Base.call(this,"edwards",t),this.a=new BN(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function Point(t,r,e,i,d){Base.BasePoint.call(this,t,"projective"),null===r&&null===e&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN(r,16),this.y=new BN(e,16),this.z=i?new BN(i,16):this.curve.one,this.t=d&&new BN(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var curve=require("../curve"),elliptic=require("../../elliptic"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,assert=elliptic.utils.assert;inherits(EdwardsCurve,Base),module.exports=EdwardsCurve,EdwardsCurve.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},EdwardsCurve.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},EdwardsCurve.prototype.jpoint=function(t,r,e,i){return this.point(t,r,e,i)},EdwardsCurve.prototype.pointFromX=function(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=this.c2.redSub(this.a.redMul(e)),d=this.one.redSub(this.c2.redMul(this.d).redMul(e)),s=i.redMul(d.redInvm()),u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var n=u.fromRed().isOdd();return(r&&!n||!r&&n)&&(u=u.redNeg()),this.point(t,u)},EdwardsCurve.prototype.pointFromY=function(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=e.redSub(this.one),d=e.redMul(this.d).redAdd(this.one),s=i.redMul(d.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return u.isOdd()!==r&&(u=u.redNeg()),this.point(u,t)},EdwardsCurve.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),e=t.y.redSqr(),i=r.redMul(this.a).redAdd(e),d=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(e)));return 0===i.cmp(d)},inherits(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},EdwardsCurve.prototype.point=function(t,r,e,i){return new Point(this,t,r,e,i)},Point.fromJSON=function(t,r){return new Point(t,r[0],r[1],r[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var i=this.curve._mulA(t),d=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),s=i.redAdd(r),u=s.redSub(e),n=i.redSub(r),h=d.redMul(u),o=s.redMul(n),l=d.redMul(n),c=u.redMul(s);return this.curve.point(h,o,c,l)},Point.prototype._projDbl=function(){var t,r,e,i=this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var u=(o=this.curve._mulA(d)).redAdd(s);if(this.zOne)t=i.redSub(d).redSub(s).redMul(u.redSub(this.curve.two)),r=u.redMul(o.redSub(s)),e=u.redSqr().redSub(u).redSub(u);else{var n=this.z.redSqr(),h=u.redSub(n).redISub(n);t=i.redSub(d).redISub(s).redMul(h),r=u.redMul(o.redSub(s)),e=u.redMul(h)}}else{var o=d.redAdd(s),n=this.curve._mulC(this.c.redMul(this.z)).redSqr(),h=o.redSub(n).redSub(n);t=this.curve._mulC(i.redISub(o)).redMul(h),r=this.curve._mulC(o).redMul(d.redISub(s)),e=o.redMul(h)}return this.curve.point(t,r,e)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),e=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),d=this.z.redMul(t.z.redAdd(t.z)),s=e.redSub(r),u=d.redSub(i),n=d.redAdd(i),h=e.redAdd(r),o=s.redMul(u),l=n.redMul(h),c=s.redMul(h),p=u.redMul(n);return this.curve.point(o,l,p,c)},Point.prototype._projAdd=function(t){var r,e,i=this.z.redMul(t.z),d=i.redSqr(),s=this.x.redMul(t.x),u=this.y.redMul(t.y),n=this.curve.d.redMul(s).redMul(u),h=d.redSub(n),o=d.redAdd(n),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(u),c=i.redMul(h).redMul(l);return this.curve.twisted?(r=i.redMul(o).redMul(u.redSub(this.curve._mulA(s))),e=h.redMul(o)):(r=i.redMul(o).redMul(u.redSub(s)),e=this.curve._mulC(h).redMul(o)),this.curve.point(c,r,e)},Point.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Point.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!1)},Point.prototype.jmulAdd=function(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Point.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var e=t.clone(),i=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add;
},{"../../elliptic":74,"../curve":77,"bn.js":19,"inherits":115}],77:[function(require,module,exports){
"use strict";var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards");
},{"./base":75,"./edwards":76,"./mont":78,"./short":79}],78:[function(require,module,exports){
"use strict";function MontCurve(t){Base.call(this,"mont",t),this.a=new BN(t.a,16).toRed(this.red),this.b=new BN(t.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(t,r,e){Base.BasePoint.call(this,t,"projective"),null===r&&null===e?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(r,16),this.z=new BN(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=require("../curve"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,elliptic=require("../../elliptic"),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(t){var r=t.normalize().x,e=r.redSqr(),i=e.redMul(r).redAdd(e.redMul(this.a)).redAdd(r);return 0===i.redSqrt().redSqr().cmp(i)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(t,r){return this.point(utils.toArray(t,r),1)},MontCurve.prototype.point=function(t,r){return new Point(this,t,r)},MontCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(t,r){return new Point(t,r[0],r[1]||t.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),r=this.x.redSub(this.z).redSqr(),e=t.redSub(r),i=t.redMul(r),o=e.redMul(r.redAdd(this.curve.a24.redMul(e)));return this.curve.point(i,o)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(t,r){var e=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),n=t.x.redSub(t.z).redMul(e),u=o.redMul(i),d=r.z.redMul(n.redAdd(u).redSqr()),s=r.x.redMul(n.redISub(u).redSqr());return this.curve.point(d,s)},Point.prototype.mul=function(t){for(var r=t.clone(),e=this,i=this.curve.point(null,null),o=this,n=[];0!==r.cmpn(0);r.iushrn(1))n.push(r.andln(1));for(var u=n.length-1;u>=0;u--)0===n[u]?(e=e.diffAdd(i,o),i=i.dbl()):(i=e.diffAdd(i,o),e=e.dbl());return i},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()};
},{"../../elliptic":74,"../curve":77,"bn.js":19,"inherits":115}],79:[function(require,module,exports){
"use strict";function ShortCurve(r){Base.call(this,"short",r),this.a=new BN(r.a,16).toRed(this.red),this.b=new BN(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(r,e,t,d){Base.BasePoint.call(this,r,"affine"),null===e&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(e,16),this.y=new BN(t,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(r,e,t,d){Base.BasePoint.call(this,r,"jacobian"),null===e&&null===t&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(e,16),this.y=new BN(t,16),this.z=new BN(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=require("../curve"),elliptic=require("../../elliptic"),BN=require("bn.js"),inherits=require("inherits"),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(r){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,t;if(r.beta)e=new BN(r.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);e=(e=d[0].cmp(d[1])<0?d[0]:d[1]).toRed(this.red)}if(r.lambda)t=new BN(r.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?t=i[0]:(t=i[1],assert(0===this.g.mul(t).x.cmp(this.g.x.redMul(e))))}var n;return n=r.basis?r.basis.map(function(r){return{a:new BN(r.a,16),b:new BN(r.b,16)}}):this._getEndoBasis(t),{beta:e,lambda:t,basis:n}}},ShortCurve.prototype._getEndoRoots=function(r){var e=r===this.p?this.red:BN.mont(r),t=new BN(2).toRed(e).redInvm(),d=t.redNeg(),i=new BN(3).toRed(e).redNeg().redSqrt().redMul(t);return[d.redAdd(i).fromRed(),d.redSub(i).fromRed()]},ShortCurve.prototype._getEndoBasis=function(r){for(var e,t,d,i,n,u,s,o,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=r,a=this.n.clone(),c=new BN(1),f=new BN(0),v=new BN(0),S=new BN(1),b=0;0!==p.cmpn(0);){var I=a.div(p);o=a.sub(I.mul(p)),h=v.sub(I.mul(c));var y=S.sub(I.mul(f));if(!d&&o.cmp(l)<0)e=s.neg(),t=c,d=o.neg(),i=h;else if(d&&2==++b)break;s=o,a=p,p=o,v=c,c=h,S=f,f=y}n=o.neg(),u=h;var A=d.sqr().add(i.sqr());return n.sqr().add(u.sqr()).cmp(A)>=0&&(n=e,u=t),d.negative&&(d=d.neg(),i=i.neg()),n.negative&&(n=n.neg(),u=u.neg()),[{a:d,b:i},{a:n,b:u}]},ShortCurve.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],d=e[1],i=d.b.mul(r).divRound(this.n),n=t.b.neg().mul(r).divRound(this.n),u=i.mul(t.a),s=n.mul(d.a),o=i.mul(t.b),h=n.mul(d.b);return{k1:r.sub(u).sub(s),k2:o.add(h).neg()}},ShortCurve.prototype.pointFromX=function(r,e){(r=new BN(r,16)).red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),d=t.redSqrt();if(0!==d.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var i=d.fromRed().isOdd();return(e&&!i||!e&&i)&&(d=d.redNeg()),this.point(r,d)},ShortCurve.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,d=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(d).redIAdd(this.b);return 0===t.redSqr().redISub(i).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(r,e,t){for(var d=this._endoWnafT1,i=this._endoWnafT2,n=0;n<r.length;n++){var u=this._endoSplit(e[n]),s=r[n],o=s._getBeta();u.k1.negative&&(u.k1.ineg(),s=s.neg(!0)),u.k2.negative&&(u.k2.ineg(),o=o.neg(!0)),d[2*n]=s,d[2*n+1]=o,i[2*n]=u.k1,i[2*n+1]=u.k2}for(var h=this._wnafMulAdd(1,d,i,2*n,t),l=0;l<2*n;l++)d[l]=null,i[l]=null;return h},inherits(Point,Base.BasePoint),ShortCurve.prototype.point=function(r,e,t){return new Point(this,r,e,t)},ShortCurve.prototype.pointFromJSON=function(r,e){return Point.fromJSON(this,r,e)},Point.prototype._getBeta=function(){if(this.curve.endo){var r=this.precomputed;if(r&&r.beta)return r.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var t=this.curve,d=function(r){return t.point(r.x.redMul(t.endo.beta),r.y)};r.beta=e,e.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(d)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(d)}}}return e}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(r,e,t){function d(e){return r.point(e[0],e[1],t)}"string"==typeof e&&(e=JSON.parse(e));var i=r.point(e[0],e[1],t);if(!e[2])return i;var n=e[2];return i.precomputed={beta:null,doubles:n.doubles&&{step:n.doubles.step,points:[i].concat(n.doubles.points.map(d))},naf:n.naf&&{wnd:n.naf.wnd,points:[i].concat(n.naf.points.map(d))}},i},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(0===this.x.cmp(r.x))return this.curve.point(null,null);var e=this.y.redSub(r.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),d=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,d)},Point.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(0===r.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),d=r.redInvm(),i=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(d),n=i.redSqr().redISub(this.x.redAdd(this.x)),u=i.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,u)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(r){return r=new BN(r,16),this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},Point.prototype.mulAdd=function(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i):this.curve._wnafMulAdd(1,d,i,2)},Point.prototype.jmulAdd=function(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i,!0):this.curve._wnafMulAdd(1,d,i,2,!0)},Point.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||0===this.x.cmp(r.x)&&0===this.y.cmp(r.y))},Point.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,d=function(r){return r.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return e},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(r,e,t){return new JPoint(this,r,e,t)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),d=this.y.redMul(e).redMul(r);return this.curve.point(t,d)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),d=this.x.redMul(e),i=r.x.redMul(t),n=this.y.redMul(e.redMul(r.z)),u=r.y.redMul(t.redMul(this.z)),s=d.redSub(i),o=n.redSub(u);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),l=h.redMul(s),p=d.redMul(h),a=o.redSqr().redIAdd(l).redISub(p).redISub(p),c=o.redMul(p.redISub(a)).redISub(n.redMul(l)),f=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(a,c,f)},JPoint.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,d=r.x.redMul(e),i=this.y,n=r.y.redMul(e).redMul(this.z),u=t.redSub(d),s=i.redSub(n);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=u.redSqr(),h=o.redMul(u),l=t.redMul(o),p=s.redSqr().redIAdd(h).redISub(l).redISub(l),a=s.redMul(l.redISub(p)).redISub(i.redMul(h)),c=this.z.redMul(u);return this.curve.jpoint(p,a,c)},JPoint.prototype.dblp=function(r){if(0===r)return this;if(this.isInfinity())return this;if(!r)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,t=0;t<r;t++)e=e.dbl();return e}for(var d=this.curve.a,i=this.curve.tinv,n=this.x,u=this.y,s=this.z,o=s.redSqr().redSqr(),h=u.redAdd(u),t=0;t<r;t++){var l=n.redSqr(),p=h.redSqr(),a=p.redSqr(),c=l.redAdd(l).redIAdd(l).redIAdd(d.redMul(o)),f=n.redMul(p),v=c.redSqr().redISub(f.redAdd(f)),S=f.redISub(v),b=c.redMul(S);b=b.redIAdd(b).redISub(a);var I=h.redMul(s);t+1<r&&(o=o.redMul(a)),n=v,s=I,h=b}return this.curve.jpoint(n,h.redMul(i),s)},JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d),o=s.redSqr().redISub(u).redISub(u),h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),r=o,e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),p=this.y.redSqr(),a=p.redSqr(),c=this.x.redAdd(p).redSqr().redISub(l).redISub(a);c=c.redIAdd(c);var f=l.redAdd(l).redIAdd(l),v=f.redSqr(),S=a.redIAdd(a);S=(S=S.redIAdd(S)).redIAdd(S),r=v.redISub(c).redISub(c),e=f.redMul(c.redISub(r)).redISub(S),t=(t=this.y.redMul(this.z)).redIAdd(t)}return this.curve.jpoint(r,e,t)},JPoint.prototype._threeDbl=function(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),o=s.redSqr().redISub(u).redISub(u);r=o;var h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),p=this.y.redSqr(),a=this.x.redMul(p),c=this.x.redSub(l).redMul(this.x.redAdd(l));c=c.redAdd(c).redIAdd(c);var f=a.redIAdd(a),v=(f=f.redIAdd(f)).redAdd(f);r=c.redSqr().redISub(v),t=this.y.redAdd(this.z).redSqr().redISub(p).redISub(l);var S=p.redSqr();S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S),e=c.redMul(f.redISub(r)).redISub(S)}return this.curve.jpoint(r,e,t)},JPoint.prototype._dbl=function(){var r=this.curve.a,e=this.x,t=this.y,d=this.z,i=d.redSqr().redSqr(),n=e.redSqr(),u=t.redSqr(),s=n.redAdd(n).redIAdd(n).redIAdd(r.redMul(i)),o=e.redAdd(e),h=(o=o.redIAdd(o)).redMul(u),l=s.redSqr().redISub(h.redAdd(h)),p=h.redISub(l),a=u.redSqr();a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var c=s.redMul(p).redISub(a),f=t.redAdd(t).redMul(d);return this.curve.jpoint(l,c,f)},JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),e=this.y.redSqr(),t=this.z.redSqr(),d=e.redSqr(),i=r.redAdd(r).redIAdd(r),n=i.redSqr(),u=this.x.redAdd(e).redSqr().redISub(r).redISub(d),s=(u=(u=(u=u.redIAdd(u)).redAdd(u).redIAdd(u)).redISub(n)).redSqr(),o=d.redIAdd(d);o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);var h=i.redIAdd(u).redSqr().redISub(n).redISub(s).redISub(o),l=e.redMul(h);l=(l=l.redIAdd(l)).redIAdd(l);var p=this.x.redMul(s).redISub(l);p=(p=p.redIAdd(p)).redIAdd(p);var a=this.y.redMul(h.redMul(o.redISub(h)).redISub(u.redMul(s)));a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var c=this.z.redAdd(u).redSqr().redISub(t).redISub(s);return this.curve.jpoint(p,a,c)},JPoint.prototype.mul=function(r,e){return r=new BN(r,e),this.curve._wnafMul(this,r)},JPoint.prototype.eq=function(r){if("affine"===r.type)return this.eq(r.toJ());if(this===r)return!0;var e=this.z.redSqr(),t=r.z.redSqr();if(0!==this.x.redMul(t).redISub(r.x.redMul(e)).cmpn(0))return!1;var d=e.redMul(this.z),i=t.redMul(r.z);return 0===this.y.redMul(i).redISub(r.y.redMul(d)).cmpn(0)},JPoint.prototype.eqXToP=function(r){var e=this.z.redSqr(),t=r.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(t))return!0;for(var d=r.clone(),i=this.curve.redN.redMul(e);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};
},{"../../elliptic":74,"../curve":77,"bn.js":19,"inherits":115}],80:[function(require,module,exports){
"use strict";function PresetCurve(f){"short"===f.type?this.curve=new elliptic.curve.short(f):"edwards"===f.type?this.curve=new elliptic.curve.edwards(f):this.curve=new elliptic.curve.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(f,e){Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(e);return Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,value:a}),a}})}var curves=exports,hash=require("hash.js"),elliptic=require("../elliptic"),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=require("./precomputed/secp256k1")}catch(f){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]});
},{"../elliptic":74,"./precomputed/secp256k1":87,"hash.js":100}],81:[function(require,module,exports){
"use strict";function EC(e){if(!(this instanceof EC))return new EC(e);"string"==typeof e&&(assert(elliptic.curves.hasOwnProperty(e),"Unknown curve "+e),e=elliptic.curves[e]),e instanceof elliptic.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var BN=require("bn.js"),HmacDRBG=require("hmac-drbg"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,KeyPair=require("./key"),Signature=require("./signature");module.exports=EC,EC.prototype.keyPair=function(e){return new KeyPair(this,e)},EC.prototype.keyFromPrivate=function(e,t){return KeyPair.fromPrivate(this,e,t)},EC.prototype.keyFromPublic=function(e,t){return KeyPair.fromPublic(this,e,t)},EC.prototype.genKeyPair=function(e){e||(e={});for(var t=new HmacDRBG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new BN(2));;){var i=new BN(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},EC.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},EC.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new BN(e,16));for(var i=this.n.byteLength(),s=t.getPrivate().toArray("be",i),u=e.toArray("be",i),o=new HmacDRBG({hash:this.hash,entropy:s,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new BN(1)),h=0;!0;h++){var a=n.k?n.k(h):new BN(o.generate(this.n.byteLength()));if(!((a=this._truncateToN(a,!0)).cmpn(1)<=0||a.cmp(c)>=0)){var p=this.g.mul(a);if(!p.isInfinity()){var m=p.getX(),v=m.umod(this.n);if(0!==v.cmpn(0)){var y=a.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var l=(p.getY().isOdd()?1:0)|(0!==m.cmp(v)?2:0);return n.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),l^=1),new Signature({r:v,s:y,recoveryParam:l})}}}}}},EC.prototype.verify=function(e,t,r,n){e=this._truncateToN(new BN(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Signature(t,"hex")).r,s=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var u=s.invm(this.n),o=u.mul(e).umod(this.n),c=u.mul(i).umod(this.n);if(!this.curve._maxwellTrick)return!(h=this.g.mulAdd(o,r.getPublic(),c)).isInfinity()&&0===h.getX().umod(this.n).cmp(i);var h=this.g.jmulAdd(o,r.getPublic(),c);return!h.isInfinity()&&h.eqXToP(i)},EC.prototype.recoverPubKey=function(e,t,r,n){assert((3&r)===r,"The recovery param is more than two bits"),t=new Signature(t,n);var i=this.n,s=new BN(e),u=t.r,o=t.s,c=1&r,h=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");u=h?this.curve.pointFromX(u.add(this.curve.n),c):this.curve.pointFromX(u,c);var a=t.r.invm(i),p=i.sub(s).mul(a).umod(i),m=o.mul(a).umod(i);return this.g.mulAdd(p,u,m)},EC.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Signature(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(e,t,i)}catch(e){continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};
},{"../../elliptic":74,"./key":82,"./signature":83,"bn.js":19,"hmac-drbg":112}],82:[function(require,module,exports){
"use strict";function KeyPair(i,t){this.ec=i,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{pub:t,pubEnc:e})},KeyPair.fromPrivate=function(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{priv:t,privEnc:e})},KeyPair.prototype.validate=function(){var i=this.getPublic();return i.isInfinity()?{result:!1,reason:"Invalid public key"}:i.validate()?i.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(i,t){return"string"==typeof i&&(t=i,i=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,i):this.pub},KeyPair.prototype.getPrivate=function(i){return"hex"===i?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(i,t){this.priv=new BN(i,t||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(i,t){if(i.x||i.y)return"mont"===this.ec.curve.type?assert(i.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(i.x&&i.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(i.x,i.y));this.pub=this.ec.curve.decodePoint(i,t)},KeyPair.prototype.derive=function(i){return i.mul(this.priv).getX()},KeyPair.prototype.sign=function(i,t,e){return this.ec.sign(i,this,t,e)},KeyPair.prototype.verify=function(i,t){return this.ec.verify(i,t,this)},KeyPair.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};
},{"../../elliptic":74,"bn.js":19}],83:[function(require,module,exports){
"use strict";function Signature(t,r){if(t instanceof Signature)return t;this._importDER(t,r)||(assert(t.r&&t.s,"Signature without r or s"),this.r=new BN(t.r,16),this.s=new BN(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function Position(){this.place=0}function getLength(t,r){var e=t[r.place++];if(!(128&e))return e;for(var n=15&e,i=0,a=0,c=r.place;a<n;a++,c++)i<<=8,i|=t[c];return r.place=c,i}function rmPadding(t){for(var r=0,e=t.length-1;!t[r]&&!(128&t[r+1])&&r<e;)r++;return 0===r?t:t.slice(r)}function constructLength(t,r){if(r<128)t.push(r);else{var e=1+(Math.log(r)/Math.LN2>>>3);for(t.push(128|e);--e;)t.push(r>>>(e<<3)&255);t.push(r)}}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(t,r){t=utils.toArray(t,r);var e=new Position;if(48!==t[e.place++])return!1;if(getLength(t,e)+e.place!==t.length)return!1;if(2!==t[e.place++])return!1;var n=getLength(t,e),i=t.slice(e.place,n+e.place);if(e.place+=n,2!==t[e.place++])return!1;var a=getLength(t,e);if(t.length!==a+e.place)return!1;var c=t.slice(e.place,a+e.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new BN(i),this.s=new BN(c),this.recoveryParam=null,!0},Signature.prototype.toDER=function(t){var r=this.r.toArray(),e=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&e[0]&&(e=[0].concat(e)),r=rmPadding(r),e=rmPadding(e);!(e[0]||128&e[1]);)e=e.slice(1);var n=[2];constructLength(n,r.length),(n=n.concat(r)).push(2),constructLength(n,e.length);var i=n.concat(e),a=[48];return constructLength(a,i.length),a=a.concat(i),utils.encode(a,t)};
},{"../../elliptic":74,"bn.js":19}],84:[function(require,module,exports){
"use strict";function EDDSA(t){if(assert("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(t);var t=elliptic.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hash.sha512}var hash=require("hash.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=require("./key"),Signature=require("./signature");module.exports=EDDSA,EDDSA.prototype.sign=function(t,e){t=parseBytes(t);var i=this.keyFromSecret(e),r=this.hashInt(i.messagePrefix(),t),n=this.g.mul(r),s=this.encodePoint(n),o=this.hashInt(s,i.pubBytes(),t).mul(i.priv()),u=r.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:s})},EDDSA.prototype.verify=function(t,e,i){t=parseBytes(t),e=this.makeSignature(e);var r=this.keyFromPublic(i),n=this.hashInt(e.Rencoded(),r.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(r.pub().mul(n)).eq(s)},EDDSA.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return utils.intFromLE(t.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function(t){return KeyPair.fromPublic(this,t)},EDDSA.prototype.keyFromSecret=function(t){return KeyPair.fromSecret(this,t)},EDDSA.prototype.makeSignature=function(t){return t instanceof Signature?t:new Signature(this,t)},EDDSA.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},EDDSA.prototype.decodePoint=function(t){var e=(t=utils.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),r=0!=(128&t[e]),n=utils.intFromLE(i);return this.curve.pointFromY(n,r)},EDDSA.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function(t){return utils.intFromLE(t)},EDDSA.prototype.isPoint=function(t){return t instanceof this.pointClass};
},{"../../elliptic":74,"./key":85,"./signature":86,"hash.js":100}],85:[function(require,module,exports){
"use strict";function KeyPair(e,t){this.eddsa=e,this._secret=parseBytes(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=parseBytes(t.pub)}var elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,cachedProperty=utils.cachedProperty;KeyPair.fromPublic=function(e,t){return t instanceof KeyPair?t:new KeyPair(e,{pub:t})},KeyPair.fromSecret=function(e,t){return t instanceof KeyPair?t:new KeyPair(e,{secret:t})},KeyPair.prototype.secret=function(){return this._secret},cachedProperty(KeyPair,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),cachedProperty(KeyPair,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty(KeyPair,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r}),cachedProperty(KeyPair,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty(KeyPair,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty(KeyPair,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair.prototype.sign=function(e){return assert(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},KeyPair.prototype.getSecret=function(e){return assert(this._secret,"KeyPair is public only"),utils.encode(this.secret(),e)},KeyPair.prototype.getPublic=function(e){return utils.encode(this.pubBytes(),e)},module.exports=KeyPair;
},{"../../elliptic":74}],86:[function(require,module,exports){
"use strict";function Signature(e,t){this.eddsa=e,"object"!=typeof t&&(t=parseBytes(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),assert(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof BN&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}var BN=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,assert=utils.assert,cachedProperty=utils.cachedProperty,parseBytes=utils.parseBytes;cachedProperty(Signature,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Signature.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Signature.prototype.toHex=function(){return utils.encode(this.toBytes(),"hex").toUpperCase()},module.exports=Signature;
},{"../../elliptic":74,"bn.js":19}],87:[function(require,module,exports){
module.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}};
},{}],88:[function(require,module,exports){
"use strict";function getNAF(t,r){for(var i=[],n=1<<r+1,e=t.clone();e.cmpn(1)>=0;){var s;if(e.isOdd()){var u=e.andln(n-1);s=u>(n>>1)-1?(n>>1)-u:u,e.isubn(s)}else s=0;i.push(s);for(var l=0!==e.cmpn(0)&&0===e.andln(n-1)?r+1:1,o=1;o<l;o++)i.push(0);e.iushrn(l)}return i}function getJSF(t,r){var i=[[],[]];t=t.clone(),r=r.clone();for(var n=0,e=0;t.cmpn(-n)>0||r.cmpn(-e)>0;){var s=t.andln(3)+n&3,u=r.andln(3)+e&3;3===s&&(s=-1),3===u&&(u=-1);var l;l=0==(1&s)?0:3!==(a=t.andln(7)+n&7)&&5!==a||2!==u?s:-s,i[0].push(l);var o;if(0==(1&u))o=0;else{var a=r.andln(7)+e&7;o=3!==a&&5!==a||2!==s?u:-u}i[1].push(o),2*n===l+1&&(n=1-n),2*e===o+1&&(e=1-e),t.iushrn(1),r.iushrn(1)}return i}function cachedProperty(t,r,i){var n="_"+r;t.prototype[r]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}}function parseBytes(t){return"string"==typeof t?utils.toArray(t,"hex"):t}function intFromLE(t){return new BN(t,"hex","le")}var utils=exports,BN=require("bn.js"),minAssert=require("minimalistic-assert"),minUtils=require("minimalistic-crypto-utils");utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE;
},{"bn.js":19,"minimalistic-assert":130,"minimalistic-crypto-utils":131}],89:[function(require,module,exports){
module.exports={
"_args": [
[
"/Users/hdrewes/Documents/DEV/EthereumJS/browser-builds"
]
],
"_from": "[email protected]",
"_id": "[email protected]",
"_inBundle": false,
"_integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",
"_location": "/elliptic",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "[email protected]",
"name": "elliptic",
"escapedName": "elliptic",
"rawSpec": "6.4.0",
"saveSpec": null,
"fetchSpec": "6.4.0"
},
"_requiredBy": [
"/browserify-sign",
"/create-ecdh",
"/secp256k1"
],
"_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
"_spec": "6.4.0",
"_where": "/Users/hdrewes/Documents/DEV/EthereumJS/browser-builds",
"author": {
"name": "Fedor Indutny",
"email": "[email protected]"
},
"bugs": {
"url": "https://github.com/indutny/elliptic/issues"
},
"dependencies": {
"bn.js": "^4.4.0",
"brorand": "^1.0.1",
"hash.js": "^1.0.0",
"hmac-drbg": "^1.0.0",
"inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0",
"minimalistic-crypto-utils": "^1.0.0"
},
"description": "EC cryptography",
"devDependencies": {
"brfs": "^1.4.3",
"coveralls": "^2.11.3",
"grunt": "^0.4.5",
"grunt-browserify": "^5.0.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^1.0.1",
"grunt-mocha-istanbul": "^3.0.1",
"grunt-saucelabs": "^8.6.2",
"istanbul": "^0.4.2",
"jscs": "^2.9.0",
"jshint": "^2.6.0",
"mocha": "^2.1.0"
},
"files": [
"lib"
],
"homepage": "https://github.com/indutny/elliptic",
"keywords": [
"EC",
"Elliptic",
"curve",
"Cryptography"
],
"license": "MIT",
"main": "lib/elliptic.js",
"name": "elliptic",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/indutny/elliptic.git"
},
"scripts": {
"jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
"jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
"lint": "npm run jscs && npm run jshint",
"test": "npm run lint && npm run unit",
"unit": "istanbul test _mocha --reporter=spec test/index.js",
"version": "grunt dist && git add dist/"
},
"version": "6.4.0"
}
},{}],90:[function(require,module,exports){
module.exports={
"genesisGasLimit": {
"v": 5000,
"d": "Gas limit of the Genesis block."
},
"genesisDifficulty": {
"v": 17179869184,
"d": "Difficulty of the Genesis block."
},
"genesisNonce": {
"v": "0x0000000000000042",
"d": "the geneis nonce"
},
"genesisExtraData": {
"v": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"d": "extra data "
},
"genesisHash": {
"v": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
"d": "genesis hash"
},
"genesisStateRoot": {
"v": "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
"d": "the genesis state root"
},
"minGasLimit": {
"v": 5000,
"d": "Minimum the gas limit may ever be."
},
"gasLimitBoundDivisor": {
"v": 1024,
"d": "The bound divisor of the gas limit, used in update calculations."
},
"minimumDifficulty": {
"v": 131072,
"d": "The minimum that the difficulty may ever be."
},
"difficultyBoundDivisor": {
"v": 2048,
"d": "The bound divisor of the difficulty, used in the update calculations."
},
"durationLimit": {
"v": 13,
"d": "The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."
},
"maximumExtraDataSize": {
"v": 32,
"d": "Maximum size extra data may be after Genesis."
},
"epochDuration": {
"v": 30000,
"d": "Duration between proof-of-work epochs."
},
"stackLimit": {
"v": 1024,
"d": "Maximum size of VM stack allowed."
},
"callCreateDepth": {
"v": 1024,
"d": "Maximum depth of call/create stack."
},
"tierStepGas": {
"v": [0, 2, 3, 5, 8, 10, 20],
"d": "Once per operation, for a selection of them."
},
"expGas": {
"v": 10,
"d": "Once per EXP instuction."
},
"expByteGas": {
"v": 10,
"d": "Times ceil(log256(exponent)) for the EXP instruction."
},
"sha3Gas": {
"v": 30,
"d": "Once per SHA3 operation."
},
"sha3WordGas": {
"v": 6,
"d": "Once per word of the SHA3 operation's data."
},
"sloadGas": {
"v": 50,
"d": "Once per SLOAD operation."
},
"sstoreSetGas": {
"v": 20000,
"d": "Once per SSTORE operation if the zeroness changes from zero."
},
"sstoreResetGas": {
"v": 5000,
"d": "Once per SSTORE operation if the zeroness does not change from zero."
},
"sstoreRefundGas": {
"v": 15000,
"d": "Once per SSTORE operation if the zeroness changes to zero."
},
"jumpdestGas": {
"v": 1,
"d": "Refunded gas, once per SSTORE operation if the zeroness changes to zero."
},
"logGas": {
"v": 375,
"d": "Per LOG* operation."
},
"logDataGas": {
"v": 8,
"d": "Per byte in a LOG* operation's data."
},
"logTopicGas": {
"v": 375,
"d": "Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."
},
"createGas": {
"v": 32000,
"d": "Once per CREATE operation & contract-creation transaction."
},
"callGas": {
"v": 40,
"d": "Once per CALL operation & message call transaction."
},
"callStipend": {
"v": 2300,
"d": "Free gas given at beginning of call."
},
"callValueTransferGas": {
"v": 9000,
"d": "Paid for CALL when the value transfor is non-zero."
},
"callNewAccountGas": {
"v": 25000,
"d": "Paid for CALL when the destination address didn't exist prior."
},
"suicideRefundGas": {
"v": 24000,
"d": "Refunded following a suicide operation."
},
"memoryGas": {
"v": 3,
"d": "Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."
},
"quadCoeffDiv": {
"v": 512,
"d": "Divisor for the quadratic particle of the memory cost equation."
},
"createDataGas": {
"v": 200,
"d": ""
},
"txGas": {
"v": 21000,
"d": "Per transaction. NOTE: Not payable on data of calls between transactions."
},
"txCreation": {
"v": 32000,
"d": "the cost of creating a contract via tx"
},
"txDataZeroGas": {
"v": 4,
"d": "Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."
},
"txDataNonZeroGas": {
"v": 68,
"d": "Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."
},
"copyGas": {
"v": 3,
"d": "Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."
},
"ecrecoverGas": {
"v": 3000,
"d": ""
},
"sha256Gas": {
"v": 60,
"d": ""
},
"sha256WordGas": {
"v": 12,
"d": ""
},
"ripemd160Gas": {
"v": 600,
"d": ""
},
"ripemd160WordGas": {
"v": 120,
"d": ""
},
"identityGas": {
"v": 15,
"d": ""
},
"identityWordGas": {
"v": 3,
"d": ""
},
"minerReward": {
"v": "5000000000000000000",
"d": "the amount a miner get rewarded for mining a block"
},
"ommerReward": {
"v": "625000000000000000",
"d": "The amount of wei a miner of an uncle block gets for being inculded in the blockchain"
},
"niblingReward": {
"v": "156250000000000000",
"d": "the amount a miner gets for inculding a uncle"
},
"homeSteadForkNumber": {
"v": 1150000,
"d": "the block that the Homestead fork started at"
},
"homesteadRepriceForkNumber": {
"v": 2463000,
"d": "the block that the Homestead Reprice (EIP150) fork started at"
},