From 3364f4f26bffa06a529e53154a64e9323bf27432 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 20 Oct 2014 17:35:49 -0400 Subject: [PATCH 1/5] added browser tests --- README.md | 19 ++++++++++ package.json | 8 +++-- test/index.html | 21 +++++++++++ test/{bitauth.js => test.bitauth.js} | 54 +++++++++++++++++----------- 4 files changed, 80 insertions(+), 22 deletions(-) create mode 100644 test/index.html rename test/{bitauth.js => test.bitauth.js} (61%) diff --git a/README.md b/README.md index 1e5c171..5c16b60 100644 --- a/README.md +++ b/README.md @@ -185,3 +185,22 @@ BitAuth exposes a connect middleware for use in connect or ExpressJS application var bitauth = require('bitauth'); app.use( bitauth.middleware ); ``` + +## Development + +To run tests for Node.js: + +```bash +npm run test +``` + +To run tests for a web browser: + +```bash +npm run make-dist + +firefox $PWD/test/index.html +chromium-browser $PWD/test/index.html +``` + +Or open the file directly from a web browser. diff --git a/package.json b/package.json index fd0df9a..107de5c 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,13 @@ "email": "gordon@bitpay.com" } ], + "repository": { + "url": "git@github.com:bitpay/bitauth.git", + "type": "git" + }, "scripts": { "make-dist": "sh scripts/make-dist.sh", - "test": "mocha test/* --reporter spec", + "test": "mocha test/*.js --reporter spec", "postinstall": "npm run make-dist" }, "main": "index.js", @@ -32,7 +36,7 @@ "devDependencies": { "uglify-js": "~2.4.14", "browserify": "~4.1.11", - "should": "~4.0.4", + "chai": "=1.9.1", "mocha": "~1.20.1" } } diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..9fae4cb --- /dev/null +++ b/test/index.html @@ -0,0 +1,21 @@ + + + + + BitAuth Tests + + +
+ + + + + + + + + diff --git a/test/bitauth.js b/test/test.bitauth.js similarity index 61% rename from test/bitauth.js rename to test/test.bitauth.js index 94b7185..260387c 100644 --- a/test/bitauth.js +++ b/test/test.bitauth.js @@ -1,8 +1,17 @@ -var should = require('should'); -var bitauth = require('../index'); +'use strict'; + +if ( typeof(window) === 'undefined' ) { + var bitauth = require('../index'); +} else { + var bitauth = window.bitauth; +} + +var chai = chai || require('chai'); describe('bitauth', function() { + var should = chai.should(); + var keys = null; var contract = 'keyboard cat'; var secret = 'o hai, nsa. how i do teh cryptos?'; @@ -59,34 +68,39 @@ describe('bitauth', function() { }); - describe('#encrypt', function() { + // node specific tests + if ( typeof(window) === 'undefined' ) { + + describe('#encrypt', function() { + + it('should encrypt the secret message', function(done) { + enc = bitauth.encrypt(password, secret); + should.exist(enc); + done(); + }); - it('should encrypt the secret message', function(done) { - enc = bitauth.encrypt(password, secret); - should.exist(enc); - done(); }); - }); + describe('#decrypt', function() { - describe('#decrypt', function() { + it('should decrypt the secret message', function(done) { + var dec = bitauth.decrypt(password, enc); + should.exist(dec); + done(); + }); - it('should decrypt the secret message', function(done) { - var dec = bitauth.decrypt(password, enc); - should.exist(dec); - done(); }); - }); - - describe('#middleware', function() { + describe('#middleware', function() { - it('should expose an express middleware', function(done) { - bitauth.middleware( {} , {} , function() { - done(); + it('should expose an express middleware', function(done) { + bitauth.middleware( {} , {} , function() { + done(); + }); }); + }); - }); + } }); From 1bddf91c3ac08493b5f3abe0e6e320a7d5b778d1 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 20 Oct 2014 18:36:13 -0400 Subject: [PATCH 2/5] remove duplicated repository in package.js --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index b0469c7..4ab72f2 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,6 @@ "email": "gordon@bitpay.com" } ], - "repository": { - "url": "git@github.com:bitpay/bitauth.git", - "type": "git" - }, "scripts": { "make-dist": "sh scripts/make-dist.sh", "test": "mocha test/*.js --reporter spec", @@ -31,7 +27,6 @@ }, "main": "index.js", "version": "0.1.1", - "repository": "https://github.com/bitpay/bitauth.git", "dependencies": { "bitcore": "0.1.32", "request": "^2.36.0", From a697dcc93f8abab26448d9f0cb791999f9cc434c Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 20 Oct 2014 20:07:03 -0400 Subject: [PATCH 3/5] reduced the size of browser bundle, fixes #24 --- .gitignore | 4 ++-- README.md | 23 ++++++++++++++--------- dist/README.md | 11 ----------- dist/bitauth.browser.min.js | 9 +++++++++ package.json | 2 +- scripts/make-dist.sh | 11 +++++------ 6 files changed, 31 insertions(+), 29 deletions(-) delete mode 100644 dist/README.md create mode 100644 dist/bitauth.browser.min.js diff --git a/.gitignore b/.gitignore index ed4b243..31129c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules -dist/bitauth.browser.js -dist/bitauth.browser.min.js +dist/bitauth.bundle.js +dist/bitcore.bundle.js diff --git a/README.md b/README.md index d6ebef2..1c450d1 100644 --- a/README.md +++ b/README.md @@ -188,19 +188,24 @@ app.use( bitauth.middleware ); ## Development -To run tests for Node.js: +To build a browser compatible version of BitAuth, run the following command from the project's root directory: -```bash -npm run test +``` +npm run make-dist ``` -To run tests for a web browser: +This will output `bitauth.browser.min.js` to the `dist` directory. The script introduces a global variable at `window.bitauth`. -```bash -npm run make-dist -firefox $PWD/test/index.html -chromium-browser $PWD/test/index.html +To then run tests for a web browser open `test/index.html` in a browser, such as: + +```bash +firefox test/index.html +chromium-browser test/index.html ``` -Or open the file directly from a web browser. +To run tests for Node.js: + +```bash +npm run test +``` diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index f503e49..0000000 --- a/dist/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# BitAuth Browser Bundle - -To build a browser compatible version of BitAuth, run the following command from -the project's root directory: - -``` -npm run make-dist -``` - -This will output `bitauth.browser.js` to this directory. The script introduces a -global variable at `window.bitauth`. diff --git a/dist/bitauth.browser.min.js b/dist/bitauth.browser.min.js new file mode 100644 index 0000000..abc0d2d --- /dev/null +++ b/dist/bitauth.browser.min.js @@ -0,0 +1,9 @@ +require=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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0){var i=new e(t);return i.fill(0),t==r.length?i:(n=n.toBuffer(),e.concat([i,n],t+n.length))}return n.toBuffer()}},s={encode:function(r){var t=new e(r.length+4),o=n(r);return r.copy(t),o.copy(t,r.length),l.encode(t)},decode:function(e){var r=l.decode(e);if(r.length<4)throw new Error("invalid input: too short");var t=r.slice(0,-4),o=r.slice(-4),i=n(t),c=i.slice(0,4);if(o.toString("hex")!==c.toString("hex"))throw new Error("checksum mismatch");return t}};exports.setBuffer=function(e){i=e},exports.base58=l,exports.base58Check=s,exports.encode=l.encode,exports.decode=l.decode}).call(this,require("buffer").Buffer)},{bignum:9,buffer:29,crypto:33}],4:[function(require,module,exports){(function(e){function i(e,i){if(e.lengthn;n++)t*=256,t+=e[n];return t}function t(e){return i(e,1)}function n(e){return i(e,4)}var r=require("./Base58").base58,s=require("../util"),h=require("./Key"),a=require("./Point"),c=require("./SecureRandom"),o=require("bignum"),d=require("../networks"),l=new o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16),u=(new o("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",16),function(i){if("undefined"==typeof i||"mainnet"==i||"livenet"==i?(i="livenet",this.version=d.livenet.hkeyPrivateVersion):"testnet"==i&&(this.version=d.testnet.hkeyPrivateVersion),"livenet"==i||"testnet"==i)return this.depth=0,this.parentFingerprint=new e([0,0,0,0]),this.childIndex=new e([0,0,0,0]),this.chainCode=c.getRandomBuffer(32),this.eckey=h.generateSync(),this.hasPrivateKey=!0,this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.buildExtendedPublicKey(),void this.buildExtendedPrivateKey();if("string"==typeof i){var t=r.decode(i);if(82!=t.length)throw new Error("Not enough data, expected 82 and received "+t.length);var n=t.slice(78,82);i=t.slice(0,78);var a=s.sha256(s.sha256(i));if(a[0]!=n[0]||a[1]!=n[1]||a[2]!=n[2]||a[3]!=n[3])throw new Error("Invalid checksum")}void 0!==i&&null!==i&&this.initFromBytes(i)});u.seed=function(i,t){if(t||(t="livenet"),e.isBuffer(i)||(i=new e(i,"hex")),i.length<16)return!1;if(i.length>64)return!1;var n=s.sha512hmac(i,new e("Bitcoin seed")),r=new u(null);return r.depth=0,r.parentFingerprint=new e([0,0,0,0]),r.childIndex=new e([0,0,0,0]),r.chainCode=n.slice(32,64),r.version=d[t].hkeyPrivateVersion,r.eckey=new h,r.eckey.private=n.slice(0,32),r.eckey.regenerateSync(),r.hasPrivateKey=!0,r.pubKeyHash=s.sha256ripe160(r.eckey.public),r.buildExtendedPublicKey(),r.buildExtendedPrivateKey(),r},u.prototype.initFromBytes=function(e){if(78!=e.length)throw new Error("not enough data");this.version=n(e.slice(0,4)),this.depth=t(e.slice(4,5)),this.parentFingerprint=e.slice(5,9),this.childIndex=n(e.slice(9,13)),this.chainCode=e.slice(13,45);var i=e.slice(45,78),r=this.version==d.livenet.hkeyPrivateVersion||this.version==d.testnet.hkeyPrivateVersion,a=this.version==d.livenet.hkeyPublicVersion||this.version==d.testnet.hkeyPublicVersion;if(r&&0==i[0])this.eckey=new h,this.eckey.private=i.slice(1,33),this.eckey.compressed=!0,this.eckey.regenerateSync(),this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.hasPrivateKey=!0;else{if(!a||2!=i[0]&&3!=i[0])throw new Error("Invalid key");this.eckey=new h,this.eckey.public=i,this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.hasPrivateKey=!1}this.buildExtendedPublicKey(),this.buildExtendedPrivateKey()},u.prototype.buildExtendedPublicKey=function(){this.extendedPublicKey=new e([]);var i=null;switch(this.version){case d.livenet.hkeyPublicVersion:case d.livenet.hkeyPrivateVersion:i=d.livenet.hkeyPublicVersion;break;case d.testnet.hkeyPublicVersion:case d.testnet.hkeyPrivateVersion:i=d.testnet.hkeyPublicVersion;break;default:throw new Error("Unknown version")}this.extendedPublicKey=e.concat([new e([i>>24]),new e([i>>16&255]),new e([i>>8&255]),new e([255&i]),new e([this.depth]),this.parentFingerprint,new e([this.childIndex>>>24]),new e([this.childIndex>>>16&255]),new e([this.childIndex>>>8&255]),new e([255&this.childIndex]),this.chainCode,this.eckey.public])},u.prototype.extendedPublicKeyString=function(i){if(void 0===i||"base58"===i){var t=s.sha256(s.sha256(this.extendedPublicKey)),n=t.slice(0,4),h=e.concat([this.extendedPublicKey,n]);return r.encode(h)}if("hex"===i)return this.extendedPublicKey.toString("hex");throw new Error("bad format")},u.prototype.buildExtendedPrivateKey=function(){if(this.hasPrivateKey){this.extendedPrivateKey=new e([]);var i=this.version;this.extendedPrivateKey=e.concat([new e([i>>24]),new e([i>>16&255]),new e([i>>8&255]),new e([255&i]),new e([this.depth]),this.parentFingerprint,new e([this.childIndex>>>24]),new e([this.childIndex>>>16&255]),new e([this.childIndex>>>8&255]),new e([255&this.childIndex]),this.chainCode,new e([0]),this.eckey.private])}},u.prototype.extendedPrivateKeyString=function(i){if(void 0===i||"base58"===i){var t=s.sha256(s.sha256(this.extendedPrivateKey)),n=t.slice(0,4),h=e.concat([this.extendedPrivateKey,n]);return r.encode(h)}if("hex"===i)return this.extendedPrivateKey.toString("hex");throw new Error("bad format")},u.prototype.derive=function(e){var i=e.split("/");if("m"==e||"M"==e||"m'"==e||"M'"==e)return this;var t=this;for(var n in i){var r=i[n];if(0!=n){var s=r.length>1&&"'"==r[r.length-1],h=2147483647&parseInt(s?r.slice(0,r.length-1):r);s&&(h+=2147483648),t=t.deriveChild(h)}else if("m"!=r)throw new Error("invalid path")}return t},u.prototype.deriveChild=function(i){var t=[];t.push(i>>24&255),t.push(i>>16&255),t.push(i>>8&255),t.push(255&i),t=new e(t);var n=0!=(2147483648&i),r=this.version==d.livenet.hkeyPrivateVersion||this.version==d.testnet.hkeyPrivateVersion;if(n&&(!this.hasPrivateKey||!r))throw new Error("Cannot do private key derivation without private key");var c=null;if(this.hasPrivateKey){var y=null;y=e.concat(n?[new e([0]),this.eckey.private,t]:[this.eckey.public,t]);var v=s.sha512hmac(y,this.chainCode),p=o.fromBuffer(v.slice(0,32),{size:32}),w=v.slice(32,64),b=o.fromBuffer(this.eckey.private,{size:32}),f=p.add(b).mod(l);c=new u(null),c.chainCode=w,c.eckey=new h,c.eckey.private=f.toBuffer({size:32}),c.eckey.regenerateSync(),c.hasPrivateKey=!0}else{var y=e.concat([this.eckey.public,t]),v=s.sha512hmac(y,this.chainCode),p=v.slice(0,32),w=v.slice(32,64),k=new h;k.private=p,k.regenerateSync(),k.compressed=!1;var P=a.fromUncompressedPubKey(k.public),F=new h;F.public=this.eckey.public,F.compressed=!1;var x=a.fromUncompressedPubKey(F.public),K=a.add(P,x).toUncompressedPubKey();c=new u(null),c.chainCode=new e(w);var g=new h;g.public=K,g.compressed=!0,c.eckey=g,c.hasPrivateKey=!1}return c.childIndex=i,c.parentFingerprint=this.pubKeyHash.slice(0,4),c.version=this.version,c.depth=this.depth+1,c.eckey.compressed=!0,c.pubKeyHash=s.sha256ripe160(c.eckey.public),c.buildExtendedPublicKey(),c.buildExtendedPrivateKey(),c},module.exports=u}).call(this,require("buffer").Buffer)},{"../networks":18,"../util":87,"./Base58":3,"./Key":"ALJ4PS","./Point":12,"./SecureRandom":13,bignum:9,buffer:29}],"./lib/SIN":[function(require,module,exports){module.exports=require("tBM27q")},{}],tBM27q:[function(require,module,exports){(function(t){function i(n,e){return"number"!=typeof n?void i.super_.call(this,n,e):(this.data=new t(2+e.length),this.converters=this.encodings.binary.converters,this._encoding=this.encodings.binary._encoding,this.encoding("binary"),this.prefix(15),this.type(n),void this.payload(e))}var n=require("../util/VersionedData"),e=require("../util/EncodedData"),r=require("util");r.inherits(i,n),e.applyEncodingsTo(i),i.SIN_PERSIST_MAINNET=1,i.SIN_PERSIST_TESTNET=17,i.SIN_EPHEM=2,i.prototype.prefix=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,0)}),t):this.as("binary").readUInt8(0)},i.prototype.type=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,1)}),t):this.as("binary").readUInt8(1)},i.prototype.payload=function(t){return t?(this.doAsBinary(function(){t.copy(this.data,2)}),t):this.as("binary").slice(1)},i.prototype.validate=function(){this.doAsBinary(function(){if(i.super_.prototype.validate.call(this),22!=this.data.length)throw new Error("invalid data length")})},module.exports=i}).call(this,require("buffer").Buffer)},{"../util/EncodedData":85,"../util/VersionedData":86,buffer:29,util:51}],"./lib/SINKey":[function(require,module,exports){module.exports=require("EyghZQ")},{}],EyghZQ:[function(require,module,exports){function SINKey(e){"object"!=typeof e&&(e={}),this.created=e.created,this.privKey=e.privKey}var coinUtil=require("../util"),timeUtil=require("../util/time"),Key=require("./Key"),SIN=require("./SIN");SINKey.prototype.generate=function(){this.privKey=Key.generateSync(),this.created=timeUtil.curtime()},SINKey.prototype.pubkeyHash=function(){return coinUtil.sha256ripe160(this.privKey.public)},SINKey.prototype.storeObj=function(){var e=this.privKey.public.toString("hex"),t=this.pubkeyHash(),i=new SIN(SIN.SIN_EPHEM,t),r={created:this.created,priv:this.privKey.private.toString("hex"),pub:e,sin:i.toString()};return r},module.exports=SINKey},{"../util":87,"../util/time":88,"./Key":"ALJ4PS","./SIN":"tBM27q"}],9:[function(require,module,exports){(function(t){function e(t){r.prototype["_"+t]=n.prototype[t];var e=function(e){return"string"==typeof e?e=new n(e):"number"==typeof e&&(e=new n(e.toString())),this["_"+t](e)};r.prototype[t]=e}var n=require("bn.js"),r=function o(t){return this instanceof o?(arguments[0]=t,n.apply(this,arguments)):new r(t)};r.prototype=n.prototype;var i=function(t,e){for(var n=0;ne.size)n=n.slice(o-n.length,n.length);else if(o0},n.prototype.lt=function(t){return this.cmp(t)<0},e("add"),e("sub"),e("mul"),e("mod"),e("div"),e("cmp"),e("gt"),e("lt"),r.prototype.toNumber=function(){return parseInt(this.toString(10),10)},module.exports=r}).call(this,require("buffer").Buffer)},{"bn.js":24,buffer:29}],"./lib/Key":[function(require,module,exports){module.exports=require("ALJ4PS")},{}],ALJ4PS:[function(require,module,exports){(function(e){var r=require("../SecureRandom"),t=require("bignum"),i=require("elliptic"),s=require("./Point"),n=require("../common/Key"),o=(require("util"),function(){this._pub=null,this._compressed=!0});for(var u in n)n.hasOwnProperty(u)&&(o[u]=n[u]);o.bufferToArray=function(e){for(var r=[],t=e.length,i=0;t>i;i++)r.push(e.readUInt8(i));return r};Object.defineProperty(o.prototype,"public",{set:function(r){if(!e.isBuffer(r))throw new Error("Arg should be a buffer");var t=r[0];this._compressed=4!==t,this._pub=r},get:function(){return this._pub}}),Object.defineProperty(o.prototype,"compressed",{set:function(r){var n=this._compressed;if(this._compressed=!!r,n!=this._compressed){{this._pub}if(this._pub)if(this._compressed){var o=this._pub.slice(1,33),u=this._pub.slice(33,65),p=new t(o),c=new t(u),f=new s(p,c);this._pub=f.toCompressedPubKey()}else{var h=i.curves.secp256k1,o=this._pub.slice(1,33),a=3==this._pub[0]?!0:!1,f=h.curve.pointFromX(a,o),u=new e(f.y.toArray()),y=new t(o),v=new t(u),b=new s(y,v);this._pub=b.toUncompressedPubKey()}!this._compressed}},get:function(){return this._compressed}}),o.generateSync=function(){for(var e,s=i.curves.secp256k1;;)if(e=r.getRandomBuffer(32),t.fromBuffer(e,{size:32}).cmp(s.n)<0)break;var n=new o;return n.private=e,n.regenerateSync(),n},o.prototype.regenerateSync=function(){if(!this.private)throw new Error("Key does not have a private key set");var e=i.curves.secp256k1,r=(e.g,e.g.mul(this.private)),n=new t(r.x.toArray()),o=new t(r.y.toArray()),u=new s(n,o);return this._pub=this.compressed?u.toCompressedPubKey():u.toUncompressedPubKey(),this},o.prototype.signSync=function(r){i.curves.secp256k1;if(!this.private)throw new Error("Key does not have a private key set");if(!e.isBuffer(r)||32!==r.length)throw new Error("Arg should be a 32 bytes hash buffer");var s=new t(this.private),n=o.sign(r,s),u=o.rs2DER(n.r,n.s);return u},o.prototype.verifySignature=function(e,r,t){try{var i=this.verifySignatureSync(e,r);t(null,i)}catch(s){t(s)}},o.prototype.verifySignatureSync=function(e,r){var t=new i.ec(i.curves.secp256k1),s=e.toString("hex"),n=this._pub.toString("hex"),r=r.toString("hex"),o=t.verify(s,r,n);return o},module.exports=o}).call(this,require("buffer").Buffer)},{"../SecureRandom":13,"../common/Key":14,"./Point":12,bignum:9,buffer:29,elliptic:56,util:51}],12:[function(require,module,exports){(function(e){"use strict";var r=(require("./Key"),require("bignum")),u=(require("assert"),require("elliptic")),i=require("../common/Point");i.add=function(e,r){var t=u.curves.secp256k1,n=t.curve.point(e.x,e.y),s=t.curve.point(r.x,r.y),c=n.add(s),f=new i(c.x,c.y);return f},i.multiply=function(t,n){if(e.isBuffer(n)&&32!==n.length)throw new Error("if x is a buffer, it must be 32 bytes");var s=u.curves.secp256k1,c=s.curve.point(t.x,t.y);"string"==typeof n&&(n=new r(n));var f=c.mul(n),o=new i(f.x,f.y);return o},module.exports=i}).call(this,require("buffer").Buffer)},{"../common/Point":15,"./Key":"ALJ4PS",assert:28,bignum:9,buffer:29,elliptic:56}],13:[function(require,module,exports){(function(o){var r=require("../common/SecureRandom");r.getRandomBuffer=function(r){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var e=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");var e=window.msCrypto}var n=new Uint8Array(r);e.getRandomValues(n);var w=new o(n);return w},module.exports=r}).call(this,require("buffer").Buffer)},{"../common/SecureRandom":16,buffer:29}],14:[function(require,module,exports){(function(r){var e=require("bignum"),n=require("./Point"),t=require("./SecureRandom"),o=function(){};o.parseDERsig=function(n){if(!r.isBuffer(n))throw new Error("DER formatted signature should be a buffer");var t=n[0];if(48!==t)throw new Error("Header byte should be 0x30");var o=n[1];if(o!==n.slice(2).length)throw new Error("Length byte should length of what follows");var f=n[2];if(2!==f)throw new Error("Integer byte for r should be 0x02");var u=n[3],i=n.slice(4,4+u),h=e.fromBuffer(i),a=0===n[4]?!0:!1;if(u!==i.length)throw new Error("Length of r incorrect");var g=n[4+u+0];if(2!==g)throw new Error("Integer byte for s should be 0x02");var l=n[4+u+1],w=n.slice(4+u+2,4+u+2+l),s=e.fromBuffer(w),c=0===n[4+u+2+2]?!0:!1;if(l!==w.length)throw new Error("Length of s incorrect");var d=4+u+2+l;if(o!==d-2)throw new Error("Length of signature incorrect");var m={header:t,length:o,rheader:f,rlength:u,rneg:a,rbuf:i,r:h,sheader:g,slength:l,sneg:c,sbuf:w,s:s};return m},o.rs2DER=function(e,n){var t=e.toBuffer(),o=n.toBuffer(),f=128&t[0]?!0:!1,u=128&o[0]?!0:!1,i=f?r.concat([new r([0]),t]):t,h=u?r.concat([new r([0]),o]):o,a=2+i.length+2+h.length,g=i.length,l=h.length,w=2,s=2,c=48,d=r.concat([new r([c,a,w,g]),i,new r([s,l]),h]);return d},o.sign=function(r,t,f){var u=t,i=n.getN(),h=new e(r);do var f=f||o.genk(),a=n.getG(),g=n.multiply(a,f),l=g.x.mod(i),w=f.invm(i).mul(h.add(u.mul(l))).mod(i);while(l.cmp(new e(0))<=0||w.cmp(new e(0))<=0);return{r:l,s:w}},o.genk=function(){return new e(t.getRandomBuffer(8))},module.exports=o}).call(this,require("buffer").Buffer)},{"./Point":15,"./SecureRandom":16,bignum:9,buffer:29}],15:[function(require,module,exports){(function(e){var r=require("bignum"),F=function(e,r){this.x=e,this.y=r},f=r.fromBuffer(new e("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex"),{size:32});F.getN=function(){return f};var t;F.getG=function(){return t=t||new F(r.fromBuffer(new e("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex"),{size:32}),r.fromBuffer(new e("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex"),{size:32}))},F.fromUncompressedPubKey=function(e){var f=new F;return f.x=r.fromBuffer(e.slice(1,33),{size:32}),f.y=r.fromBuffer(e.slice(33,65),{size:32}),f},F.prototype.toUncompressedPubKey=function(){var r=this.x.toBuffer({size:32}),F=this.y.toBuffer({size:32}),f=new e([4]),t=e.concat([f,r,F]);return t},F.prototype.toCompressedPubKey=function(){var r=this.x.toBuffer({size:32}),F=this.y.toBuffer({size:32});if(F[F.length-1]%2)var f=e.concat([new e([3]),r]);else var f=e.concat([new e([2]),r]);return f},module.exports=F}).call(this,require("buffer").Buffer)},{bignum:9,buffer:29}],16:[function(require,module,exports){(function(f){var e=function(){};e.getRandomBuffer=function(){},e.getPseudoRandomBuffer=function(e){for(var n=4294967296,o=new f(e),u=0;e>=u;u++){var t=Math.floor(u/4),a=u-4*t;0==a?(r=Math.random()*n,o[u]=255&r):o[u]=255&(r>>>=8)}return o},module.exports=e}).call(this,require("buffer").Buffer)},{buffer:29}],17:[function(require,module,exports){"use strict";function l(t){throw t}function aa(t,e,s){4!==e.length&&l(new sjcl.exception.invalid("invalid aes block size"));var i=t.a[s],n=e[0]^i[0],c=e[s?3:1]^i[1],r=e[2]^i[2];e=e[s?1:3]^i[3];var o,a,h,u,d=i.length/4-2,p=4,f=[0,0,0,0];o=t.m[s],t=o[0];var m=o[1],j=o[2],g=o[3],y=o[4];for(u=0;d>u;u++)o=t[n>>>24]^m[c>>16&255]^j[r>>8&255]^g[255&e]^i[p],a=t[c>>>24]^m[r>>16&255]^j[e>>8&255]^g[255&n]^i[p+1],h=t[r>>>24]^m[e>>16&255]^j[n>>8&255]^g[255&c]^i[p+2],e=t[e>>>24]^m[n>>16&255]^j[c>>8&255]^g[255&r]^i[p+3],p+=4,n=o,c=a,r=h;for(u=0;4>u;u++)f[s?3&-u:u]=y[n>>>24]<<24^y[c>>16&255]<<16^y[r>>8&255]<<8^y[255&e]^i[p++],o=n,n=c,c=r,r=e,e=o;return f}function ca(t,e){var s,i=sjcl.random.A[t],n=[];for(s in i)i.hasOwnProperty(s)&&n.push(i[s]);for(s=0;se&&(t.i[e]=t.i[e]+1|0,!t.i[e]);e++);return t.B.encrypt(t.i)}function T(t,e){return function(){e.apply(t,arguments)}}var s=void 0,v=!1,sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};"undefined"!=typeof module&&module.exports&&(module.exports=sjcl),sjcl.cipher.aes=function(t){this.m[0][0][0]||this.q();var e,s,i,n,c=this.m[0][4],r=this.m[1];e=t.length;var o=1;for(4!==e&&6!==e&&8!==e&&l(new sjcl.exception.invalid("invalid aes key size")),this.a=[i=t.slice(0),n=[]],t=e;4*e+28>t;t++)s=i[t-1],(0===t%e||8===e&&4===t%e)&&(s=c[s>>>24]<<24^c[s>>16&255]<<16^c[s>>8&255]<<8^c[255&s],0===t%e&&(s=s<<8^s>>>24^o<<24,o=o<<1^283*(o>>7))),i[t]=i[t-e]^s;for(e=0;t;e++,t--)s=i[3&e?t:t-4],n[e]=4>=t||4>e?s:r[0][c[s>>>24]]^r[1][c[s>>16&255]]^r[2][c[s>>8&255]]^r[3][c[255&s]]},sjcl.cipher.aes.prototype={encrypt:function(t){return aa(this,t,0)},decrypt:function(t){return aa(this,t,1)},m:[[[],[],[],[],[]],[[],[],[],[],[]]],q:function(){var t,e,s,i,n,c,r,o=this.m[0],a=this.m[1],l=o[4],h=a[4],u=[],d=[];for(t=0;256>t;t++)d[(u[t]=t<<1^283*(t>>7))^t]=t;for(e=s=0;!l[e];e^=i||1,s=d[s]||1)for(c=s^s<<1^s<<2^s<<3^s<<4,c=c>>8^255&c^99,l[e]=c,h[c]=e,n=u[t=u[i=u[e]]],r=16843009*n^65537*t^257*i^16843008*e,n=257*u[c]^16843008*c,t=0;4>t;t++)o[t][e]=n=n<<24^n>>>8,a[t][c]=r=r<<24^r>>>8;for(t=0;5>t;t++)o[t]=o[t].slice(0),a[t]=a[t].slice(0)}},sjcl.bitArray={bitSlice:function(t,e,i){return t=sjcl.bitArray.O(t.slice(e/32),32-(31&e)).slice(1),i===s?t:sjcl.bitArray.clamp(t,i-e)},extract:function(t,e,s){var i=Math.floor(-e-s&31);return(-32&(e+s-1^e)?t[e/32|0]<<32-i^t[e/32+1|0]>>>i:t[e/32|0]>>>i)&(1<0&&e&&(t[s-1]=sjcl.bitArray.partial(e,t[s-1]&2147483648>>e-1,1)),t},partial:function(t,e,s){return 32===t?e:(s?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(sjcl.bitArray.bitLength(t)!==sjcl.bitArray.bitLength(e))return v;var s,i=0;for(s=0;s=32;e-=32)n.push(i),i=0;if(0===e)return n.concat(t);for(c=0;c>>e),i=t[c]<<32-e;return c=t.length?t[t.length-1]:0,t=sjcl.bitArray.getPartial(c),n.push(sjcl.bitArray.partial(e+t&31,e+t>32?i:n.pop(),1)),n},t:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}},sjcl.codec.utf8String={fromBits:function(t){var e,s,i="",n=sjcl.bitArray.bitLength(t);for(e=0;n/8>e;e++)0===(3&e)&&(s=t[e/4]),i+=String.fromCharCode(s>>>24),s<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,s=[],i=0;for(e=0;e>>n)>>>26),6>n?(r=t[s]<<6-n,n+=26,s++):(r<<=6,n-=6);for(;3&i.length&&!e;)i+="=";return i},toBits:function(t,e){t=t.replace(/\s|=/g,"");var s,i,n=[],c=0,r=sjcl.codec.base64.I,o=0;for(e&&(r=r.substr(0,62)+"-_"),s=0;si&&l(new sjcl.exception.invalid("this isn't base64!")),c>26?(c-=26,n.push(o^i>>>c),o=i<<32-c):(c+=6,o^=i<<32-c);return 56&c&&n.push(sjcl.bitArray.partial(56&c,o,1)),n}},sjcl.codec.base64url={fromBits:function(t){return sjcl.codec.base64.fromBits(t,1,1)},toBits:function(t){return sjcl.codec.base64.toBits(t,1)}},sjcl.hash.sha256=function(t){this.a[0]||this.q(),t?(this.e=t.e.slice(0),this.d=t.d.slice(0),this.c=t.c):this.reset()},sjcl.hash.sha256.hash=function(t){return(new sjcl.hash.sha256).update(t).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.e=this.j.slice(0),this.d=[],this.c=0,this},update:function(t){"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t));var e,s=this.d=sjcl.bitArray.concat(this.d,t);for(e=this.c,t=this.c=e+sjcl.bitArray.bitLength(t),e=512+e&-512;t>=e;e+=512)this.p(s.splice(0,16));return this},finalize:function(){var t,e=this.d,s=this.e,e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)]);for(t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.c/4294967296)),e.push(0|this.c);e.length;)this.p(e.splice(0,16));return this.reset(),s},j:[],a:[],q:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}var e,s=0,i=2;t:for(;64>s;i++){for(e=2;i>=e*e;e++)if(0===i%e)continue t;8>s&&(this.j[s]=t(Math.pow(i,.5))),this.a[s]=t(Math.pow(i,1/3)),s++}},p:function(t){var e,s,i=t.slice(0),n=this.e,c=this.a,r=n[0],o=n[1],a=n[2],l=n[3],h=n[4],u=n[5],d=n[6],p=n[7];for(t=0;64>t;t++)16>t?e=i[t]:(e=i[t+1&15],s=i[t+14&15],e=i[15&t]=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(s>>>17^s>>>19^s>>>10^s<<15^s<<13)+i[15&t]+i[t+9&15]|0),e=e+p+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(d^h&(u^d))+c[t],p=d,d=u,u=h,h=l+e|0,l=a,a=o,o=r,r=e+(o&a^l&(o^a))+(o>>>2^o>>>13^o>>>22^o<<30^o<<19^o<<10)|0;n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+l|0,n[4]=n[4]+h|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0}},sjcl.hash.sha512=function(t){this.a[0]||this.q(),t?(this.e=t.e.slice(0),this.d=t.d.slice(0),this.c=t.c):this.reset()},sjcl.hash.sha512.hash=function(t){return(new sjcl.hash.sha512).update(t).finalize()},sjcl.hash.sha512.prototype={blockSize:1024,reset:function(){return this.e=this.j.slice(0),this.d=[],this.c=0,this},update:function(t){"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t));var e,s=this.d=sjcl.bitArray.concat(this.d,t);for(e=this.c,t=this.c=e+sjcl.bitArray.bitLength(t),e=1024+e&-1024;t>=e;e+=1024)this.p(s.splice(0,32));return this},finalize:function(){var t,e=this.d,s=this.e,e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)]);for(t=e.length+4;31&t;t++)e.push(0);for(e.push(0),e.push(0),e.push(Math.floor(this.c/4294967296)),e.push(0|this.c);e.length;)this.p(e.splice(0,32));return this.reset(),s},j:[],Y:[12372232,13281083,9762859,1914609,15106769,4090911,4308331,8266105],a:[],$:[2666018,15689165,5061423,9034684,4764984,380953,1658779,7176472,197186,7368638,14987916,16757986,8096111,1480369,13046325,6891156,15813330,5187043,9229749,11312229,2818677,10937475,4324308,1135541,6741931,11809296,16458047,15666916,11046850,698149,229999,945776,13774844,2541862,12856045,9810911,11494366,7844520,15576806,8533307,15795044,4337665,16291729,5553712,15684120,6662416,7413802,12308920,13816008,4303699,9366425,10176680,13195875,4295371,6546291,11712675,15708924,1519456,15772530,6568428,6495784,8568297,13007125,7492395,2515356,12632583,14740254,7262584,1535930,13146278,16321966,1853211,294276,13051027,13221564,1051980,4080310,6651434,14088940,4675607],q:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}function e(t){return 1099511627776*(t-Math.floor(t))&255}var s,i=0,n=2;t:for(;80>i;n++){for(s=2;n>=s*s;s++)if(0===n%s)continue t;8>i&&(this.j[2*i]=t(Math.pow(n,.5)),this.j[2*i+1]=e(Math.pow(n,.5))<<24|this.Y[i]),this.a[2*i]=t(Math.pow(n,1/3)),this.a[2*i+1]=e(Math.pow(n,1/3))<<24|this.$[i],i++}},p:function(t){var e,s,i=t.slice(0),n=this.e,c=this.a,r=n[0],o=n[1],a=n[2],l=n[3],h=n[4],u=n[5],d=n[6],p=n[7],f=n[8],m=n[9],j=n[10],g=n[11],y=n[12],v=n[13],b=n[14],w=n[15],k=r,A=o,x=a,B=l,C=h,L=u,S=d,E=p,M=f,P=m,z=j,R=g,O=y,U=v,T=b,V=w;for(t=0;80>t;t++){if(16>t)e=i[2*t],s=i[2*t+1];else{s=i[2*(t-15)];var I=i[2*(t-15)+1];e=(I<<31|s>>>1)^(I<<24|s>>>8)^s>>>7;var q=(s<<31|I>>>1)^(s<<24|I>>>8)^(s<<25|I>>>7);s=i[2*(t-2)];var D=i[2*(t-2)+1],I=(D<<13|s>>>19)^(s<<3|D>>>29)^s>>>6,D=(s<<13|D>>>19)^(D<<3|s>>>29)^(s<<26|D>>>6),G=i[2*(t-7)],$=i[2*(t-16)],K=i[2*(t-16)+1];s=q+i[2*(t-7)+1],e=e+G+(q>>>0>s>>>0?1:0),s+=D,e+=I+(D>>>0>s>>>0?1:0),s+=K,e+=$+(K>>>0>s>>>0?1:0)}i[2*t]=e|=0,i[2*t+1]=s|=0;var G=M&z^~M&O,N=P&R^~P&U,D=k&x^k&C^x&C,W=A&B^A&L^B&L,$=(A<<4|k>>>28)^(k<<30|A>>>2)^(k<<25|A>>>7),K=(k<<4|A>>>28)^(A<<30|k>>>2)^(A<<25|k>>>7),Y=c[2*t],F=c[2*t+1],I=V+((M<<18|P>>>14)^(M<<14|P>>>18)^(P<<23|M>>>9)),q=T+((P<<18|M>>>14)^(P<<14|M>>>18)^(M<<23|P>>>9))+(V>>>0>I>>>0?1:0),I=I+N,q=q+(G+(N>>>0>I>>>0?1:0)),I=I+F,q=q+(Y+(F>>>0>I>>>0?1:0)),I=I+s,q=q+(e+(s>>>0>I>>>0?1:0));s=K+W,e=$+D+(K>>>0>s>>>0?1:0),T=O,V=U,O=z,U=R,z=M,R=P,P=E+I|0,M=S+q+(E>>>0>P>>>0?1:0)|0,S=C,E=L,C=x,L=B,x=k,B=A,A=I+s|0,k=q+e+(I>>>0>A>>>0?1:0)|0}o=n[1]=o+A|0,n[0]=r+k+(A>>>0>o>>>0?1:0)|0,l=n[3]=l+B|0,n[2]=a+x+(B>>>0>l>>>0?1:0)|0,u=n[5]=u+L|0,n[4]=h+C+(L>>>0>u>>>0?1:0)|0,p=n[7]=p+E|0,n[6]=d+S+(E>>>0>p>>>0?1:0)|0,m=n[9]=m+P|0,n[8]=f+M+(P>>>0>m>>>0?1:0)|0,g=n[11]=g+R|0,n[10]=j+z+(R>>>0>g>>>0?1:0)|0,v=n[13]=v+U|0,n[12]=y+O+(U>>>0>v>>>0?1:0)|0,w=n[15]=w+V|0,n[14]=b+T+(V>>>0>w>>>0?1:0)|0}},sjcl.mode.ccm={name:"ccm",encrypt:function(t,e,s,i,n){var c,r=e.slice(0),o=sjcl.bitArray,a=o.bitLength(s)/8,h=o.bitLength(r)/8;for(n=n||64,i=i||[],7>a&&l(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),c=2;4>c&&h>>>8*c;c++);return 15-a>c&&(c=15-a),s=o.clamp(s,8*(15-c)),e=sjcl.mode.ccm.K(t,e,s,i,n,c),r=sjcl.mode.ccm.L(t,r,s,e,n,c),o.concat(r.data,r.tag) +},decrypt:function(t,e,s,i,n){n=n||64,i=i||[];var c=sjcl.bitArray,r=c.bitLength(s)/8,o=c.bitLength(e),a=c.clamp(e,o-n),h=c.bitSlice(e,o-n),o=(o-n)/8;for(7>r&&l(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),e=2;4>e&&o>>>8*e;e++);return 15-r>e&&(e=15-r),s=c.clamp(s,8*(15-e)),a=sjcl.mode.ccm.L(t,a,s,h,n,e),t=sjcl.mode.ccm.K(t,a.data,s,i,n,e),c.equal(a.tag,t)||l(new sjcl.exception.corrupt("ccm: tag doesn't match")),a.data},K:function(t,e,s,i,n,c){var r=[],o=sjcl.bitArray,a=o.t;if(n/=8,(n%2||4>n||n>16)&&l(new sjcl.exception.invalid("ccm: invalid tag length")),(4294967295=s?r=[o.partial(16,s)]:4294967295>=s&&(r=o.concat([o.partial(16,65534)],[s])),r=o.concat(r,i),i=0;ir;r+=4)s[3]++,n=t.encrypt(s),e[r]^=n[0],e[r+1]^=n[1],e[r+2]^=n[2],e[r+3]^=n[3];return{tag:i,data:o.clamp(e,l)}}},sjcl.beware===s&&(sjcl.beware={}),sjcl.beware["CBC mode is dangerous because it doesn't protect message integrity."]=function(){sjcl.mode.cbc={name:"cbc",encrypt:function(t,e,s,i){i&&i.length&&l(new sjcl.exception.invalid("cbc can't authenticate data")),128!==sjcl.bitArray.bitLength(s)&&l(new sjcl.exception.invalid("cbc iv must be 128 bits"));var n=sjcl.bitArray,c=n.t,r=n.bitLength(e),o=0,a=[];for(7&r&&l(new sjcl.exception.invalid("pkcs#5 padding only works for multiples of a byte")),i=0;r>=o+128;i+=4,o+=128)s=t.encrypt(c(s,e.slice(i,i+4))),a.splice(i,0,s[0],s[1],s[2],s[3]);return r=16843009*(16-(r>>3&15)),s=t.encrypt(c(s,n.concat(e,[r,r,r,r]).slice(i,i+4))),a.splice(i,0,s[0],s[1],s[2],s[3]),a},decrypt:function(t,e,s,i){i&&i.length&&l(new sjcl.exception.invalid("cbc can't authenticate data")),128!==sjcl.bitArray.bitLength(s)&&l(new sjcl.exception.invalid("cbc iv must be 128 bits")),(127&sjcl.bitArray.bitLength(e)||!e.length)&&l(new sjcl.exception.corrupt("cbc ciphertext must be a positive multiple of the block size"));var n,c=sjcl.bitArray,r=c.t,o=[];for(i=0;i16)&&l(new sjcl.exception.corrupt("pkcs#5 padding corrupt")),s=16843009*n,c.equal(c.bitSlice([s,s,s,s],0,8*n),c.bitSlice(o,32*o.length-8*n,32*o.length))||l(new sjcl.exception.corrupt("pkcs#5 padding corrupt")),c.bitSlice(o,0,32*o.length-8*n)}}},sjcl.misc.hmac=function(t,e){this.M=e=e||sjcl.hash.sha256;var s,i=[[],[]],n=e.prototype.blockSize/32;for(this.o=[new e,new e],t.length>n&&(t=e.hash(t)),s=0;n>s;s++)i[0][s]=909522486^t[s],i[1][s]=1549556828^t[s];this.o[0].update(i[0]),this.o[1].update(i[1]),this.G=new e(this.o[0])},sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(t){return this.P&&l(new sjcl.exception.invalid("encrypt on already updated hmac called!")),this.update(t),this.digest(t)},sjcl.misc.hmac.prototype.reset=function(){this.G=new this.M(this.o[0]),this.P=v},sjcl.misc.hmac.prototype.update=function(t){this.P=!0,this.G.update(t)},sjcl.misc.hmac.prototype.digest=function(){var t=this.G.finalize(),t=new this.M(this.o[1]).update(t).finalize();return this.reset(),t},sjcl.misc.pbkdf2=function(t,e,s,i,n){s=s||1e3,(0>i||0>s)&&l(sjcl.exception.invalid("invalid params to pbkdf2")),"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t)),"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e)),n=n||sjcl.misc.hmac,t=new n(t);var c,r,o,a,h=[],u=sjcl.bitArray;for(a=1;32*h.length<(i||1);a++){for(n=c=t.encrypt(u.concat(e,[a])),r=1;s>r;r++)for(c=t.encrypt(c),o=0;oc;c++)n.push(4294967296*Math.random()|0);for(c=0;c=1<this.l&&(this.l=r),this.F++,this.a=sjcl.hash.sha256.hash(this.a.concat(n)),this.B=new sjcl.cipher.aes(this.a),s=0;4>s&&(this.i[s]=this.i[s]+1|0,!this.i[s]);s++);}for(s=0;t>s;s+=4)0===(s+1)%this.R&&ba(this),n=S(this),i.push(n[0],n[1],n[2],n[3]);return ba(this),i.slice(0,t)},setDefaultParanoia:function(t,e){0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e&&l("Setting paranoia=0 will ruin your security; use it only for testing"),this.C=t},addEntropy:function(t,e,i){i=i||"user";var n,c,r=(new Date).valueOf(),o=this.s[i],a=this.isReady(),h=0;switch(n=this.J[i],n===s&&(n=this.J[i]=this.V++),o===s&&(o=this.s[i]=0),this.s[i]=(this.s[i]+1)%this.f.length,typeof t){case"number":e===s&&(e=1),this.f[o].update([n,this.D++,1,e,r,1,0|t]);break;case"object":if(i=Object.prototype.toString.call(t),"[object Uint32Array]"===i){for(c=[],i=0;i0;)e++,c>>>=1;this.f[o].update([n,this.D++,2,e,r,t.length].concat(t))}break;case"string":e===s&&(e=t.length),this.f[o].update([n,this.D++,3,e,r,t.length]),this.f[o].update(t);break;default:h=1}h&&l(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.k[o]+=e,this.g+=e,a===this.n&&(this.isReady()!==this.n&&ca("seeded",Math.max(this.l,this.g)),ca("progress",this.getProgress()))},isReady:function(t){return t=this.H[t!==s?t:this.C],this.l&&this.l>=t?this.k[0]>this.Q&&(new Date).valueOf()>this.N?this.w|this.u:this.u:this.g>=t?this.w|this.n:this.n},getProgress:function(t){return t=this.H[t?t:this.C],this.l>=t?1:this.g>t?1:this.g/t},startCollectors:function(){this.r||(this.b={loadTimeCollector:T(this,this.aa),mouseCollector:T(this,this.ba),keyboardCollector:T(this,this.Z),accelerometerCollector:T(this,this.T)},window.addEventListener?(window.addEventListener("load",this.b.loadTimeCollector,v),window.addEventListener("mousemove",this.b.mouseCollector,v),window.addEventListener("keypress",this.b.keyboardCollector,v),window.addEventListener("devicemotion",this.b.accelerometerCollector,v)):document.attachEvent?(document.attachEvent("onload",this.b.loadTimeCollector),document.attachEvent("onmousemove",this.b.mouseCollector),document.attachEvent("keypress",this.b.keyboardCollector)):l(new sjcl.exception.bug("can't attach event")),this.r=!0)},stopCollectors:function(){this.r&&(window.removeEventListener?(window.removeEventListener("load",this.b.loadTimeCollector,v),window.removeEventListener("mousemove",this.b.mouseCollector,v),window.removeEventListener("keypress",this.b.keyboardCollector,v),window.removeEventListener("devicemotion",this.b.accelerometerCollector,v)):document.detachEvent&&(document.detachEvent("onload",this.b.loadTimeCollector),document.detachEvent("onmousemove",this.b.mouseCollector),document.detachEvent("keypress",this.b.keyboardCollector)),this.r=v)},addEventListener:function(t,e){this.A[t][this.U++]=e},removeEventListener:function(t,e){var s,i,n=this.A[t],c=[];for(i in n)n.hasOwnProperty(i)&&n[i]===e&&c.push(i);for(s=0;s=r.iter||64!==r.ts&&96!==r.ts&&128!==r.ts||128!==r.ks&&192!==r.ks&&256!==r.ks||2>r.iv.length||4=e.iter||64!==e.ts&&96!==e.ts&&128!==e.ts||128!==e.ks&&192!==e.ks&&256!==e.ks||!e.iv||2>e.iv.length||4=t){var n;null==p?(n=g.splice(0,t),a.skip||(n=n.slice())):(a.skip||(n=g.slice(p,t)),p=t),a.skip?a.cb():a.cb(n)}}}function o(n){function o(){w||n.next()}var u=i(function(t,n){return function(r){e(t,function(t){v.set(r,n(t)),o()})}});return u.tap=function(t){n.nest(t,v.store)},u.into=function(t,e){v.get(t)||v.set(t,{});var r=v;v=c(r.get(t)),n.nest(function(){e.apply(this,arguments),this.tap(function(){v=r})},v.store)},u.flush=function(){v.store={},o()},u.loop=function(t){var e=!1;n.nest(!1,function r(){this.vars=v.store,t.call(this,function(){e=!0,o()},v.store),this.tap(function(){e?n.next():r.call(this)}.bind(this))},v.store)},u.buffer=function(t,n){"string"==typeof n&&(n=v.get(n)),e(n,function(n){v.set(t,n),o()})},u.skip=function(t){"string"==typeof t&&(t=v.get(t)),e(t,function(){o()})},u.scan=function(n,e){if("string"==typeof e)e=new t(e);else if(!t.isBuffer(e))throw new Error("search must be a Buffer or a string");var i=0;a=function(){var t=g.indexOf(e,p+i),u=t-p-i;-1!==t?(a=null,null!=p?(v.set(n,g.slice(p,p+i+u)),p+=i+u+e.length):(v.set(n,g.slice(0,i+u)),g.splice(0,i+u+e.length)),o(),r()):u=Math.max(g.length-e.length-p-i,0),i+=u},r()},u.peek=function(t){p=0,n.nest(function(){t.call(this,v.store),this.tap(function(){p=null})})},u}if(n)return exports.apply(null,arguments);var a=null,p=null,h=u.light(o);h.writable=!0;var g=f();h.write=function(t){g.push(t),r()};var v=c(),w=!1,b=!1;return h.end=function(){b=!0},h.pipe=l.prototype.pipe,Object.getOwnPropertyNames(s.prototype).forEach(function(t){h[t]=s.prototype[t]}),h},exports.parse=function(n){var e=i(function(t,i){return function(u){if(r+t<=n.length){var s=n.slice(r,r+t);r+=t,o.set(u,i(s))}else o.set(u,null);return e}}),r=0,o=c();return e.vars=o.store,e.tap=function(t){return t.call(e,o.store),e},e.into=function(t,n){o.get(t)||o.set(t,{});var r=o;return o=c(r.get(t)),n.call(e,o.store),o=r,e},e.loop=function(t){for(var n=!1,r=function(){n=!0};n===!1;)t.call(e,r,o.store);return e},e.buffer=function(t,i){"string"==typeof i&&(i=o.get(i));var u=n.slice(r,Math.min(n.length,r+i));return r+=i,o.set(t,u),e},e.skip=function(t){return"string"==typeof t&&(t=o.get(t)),r+=t,e},e.scan=function(i,u){if("string"==typeof u)u=new t(u);else if(!t.isBuffer(u))throw new Error("search must be a Buffer or a string");o.set(i,null);for(var s=0;s+r<=n.length-u.length+1;s++){for(var f=0;f=n.length},e}}).call(this,require("buffer").Buffer)},{"./lib/vars.js":20,buffer:29,buffers:"OBo3aV",chainsaw:21,events:38,stream:43}],20:[function(require,module,exports){module.exports=function(t){function n(t,n){var e=r.store,o=t.split(".");o.slice(0,-1).forEach(function(t){void 0===e[t]&&(e[t]={}),e=e[t]});var u=o[o.length-1];return 1==arguments.length?e[u]:e[u]=n}var r={get:function(t){return n(t)},set:function(t,r){return n(t,r)},store:t||{}};return r}},{}],21:[function(require,module,exports){(function(n){function t(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.record(),e.chain()}function e(n){n.step=0,n.pop=function(){return n.actions[n.step++]},n.trap=function(t,e){var r=Array.isArray(t)?t:[t];n.actions.push({path:r,step:n.step,cb:e,trap:!0})},n.down=function(t){var e=(Array.isArray(t)?t:[t]).join("/"),r=n.actions.slice(n.step).map(function(t){return t.trap&&t.step<=n.step?!1:t.path.join("/")==e}).indexOf(!0);r>=0?n.step+=r:n.step=n.actions.length;var a=n.actions[n.step-1];a&&a.trap?(n.step=a.step,a.cb()):n.next()},n.jump=function(t){n.step=t,n.next()}}var r=require("traverse"),a=require("events").EventEmitter;module.exports=t,t.light=function(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.chain()},t.saw=function(o,s){var i=new a;return i.handlers=s,i.actions=[],i.chain=function(){var t=r(i.handlers).map(function(n){if(this.isRoot)return n;var e=this.path;"function"==typeof n&&this.update(function(){return i.actions.push({path:e,args:[].slice.call(arguments)}),t})});return n.nextTick(function(){i.emit("begin"),i.next()}),t},i.pop=function(){return i.actions.shift()},i.next=function(){var n=i.pop();if(n){if(!n.trap){var t=i.handlers;n.path.forEach(function(n){t=t[n]}),t.apply(i.handlers,n.args)}}else i.emit("end")},i.nest=function(n){var e=[].slice.call(arguments,1),r=!0;if("boolean"==typeof n){var r=n;n=e.shift()}var a=t.saw(o,{}),s=o.call(a.handlers,a);void 0!==s&&(a.handlers=s),"undefined"!=typeof i.step&&a.record(),n.apply(a.chain(),e),r!==!1&&a.on("end",i.next)},i.record=function(){e(i)},["trap","down","jump"].forEach(function(n){i[n]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),i}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,events:38,traverse:22}],22:[function(require,module,exports){function Traverse(e){return this instanceof Traverse?void(this.value=e):new Traverse(e)}function walk(e,t,r){var n=[],o=[],a=!0;return function i(e){var c=r?copy(e):e,s={},f={node:c,node_:e,path:[].concat(n),parent:o.slice(-1)[0],key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(e){f.isRoot||(f.parent.node[f.key]=e),f.node=e},"delete":function(){delete f.parent.node[f.key]},remove:function(){Array.isArray(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key]},before:function(e){s.before=e},after:function(e){s.after=e},pre:function(e){s.pre=e},post:function(e){s.post=e},stop:function(){a=!1}};if(!a)return f;if("object"==typeof c&&null!==c){f.isLeaf=0==Object.keys(c).length;for(var u=0;ua;a++){r=t.apply(null,e.try[a].map(function(r){return e[r]||r})),s.push(r);try{return o=e.path?require.resolve(r):require(r),e.path||(o.path=r),o}catch(l){if(!/not find/i.test(l.message))throw l}}throw n=new Error("Could not locate the bindings file. Tried:\n"+s.map(function(r){return e.arrow+r}).join("\n")),n.tries=s,n}var n=require("fs"),i=require("path"),t=i.join,s=i.dirname,a=n.existsSync||i.existsSync,d={arrow:e.env.NODE_BINDINGS_ARROW||" → ",compiled:e.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:e.platform,arch:e.arch,version:e.versions.node,bindings:"bindings.node","try":[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"]]};module.exports=exports=o,exports.getFileName=function(){var e,o=Error.prepareStackTrace,n=Error.stackTraceLimit,i={};return Error.stackTraceLimit=10,Error.prepareStackTrace=function(o,n){for(var i=0,t=n.length;t>i;i++)if(e=n[i].getFileName(),e!==r)return},Error.captureStackTrace(i),i.stack,Error.prepareStackTrace=o,Error.stackTraceLimit=n,e},exports.getRoot=function(r){for(var o,n=s(r);;){if("."===n&&(n=e.cwd()),a(t(n,"package.json"))||a(t(n,"node_modules")))return n;if(o===n)throw new Error('Could not find module root given file: "'+r+'". Do you have a `package.json` file? ');o=n,n=t(n,"..")}}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/node_modules/bindings/bindings.js")},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,fs:27,path:41}],24:[function(require,module,exports){function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function assertEqual(t,i,r){if(t!=i)throw new Error(r||"Assertion failed: "+t+" != "+i)}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,void(null!==t&&this._init(t||0,i||10)))}function zero6(t){return 5===t.length?"0"+t:4===t.length?"00"+t:3===t.length?"000"+t:2===t.length?"0000"+t:1===t.length?"00000"+t:t}function zero14(t){return 13===t.length?"0"+t:12===t.length?"00"+t:11===t.length?"000"+t:10===t.length?"0000"+t:9===t.length?"00000"+t:8===t.length?"000000"+t:7===t.length?"0000000"+t:6===t.length?"00000000"+t:5===t.length?"000000000"+t:4===t.length?"0000000000"+t:3===t.length?"00000000000"+t:2===t.length?"000000000000"+t:1===t.length?"0000000000000"+t:t}function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new BN(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.invm(this.m),this.minv=this.rinv.mul(this.r).sub(new BN(1)).div(this.m).neg().mod(this.r)}"object"==typeof module&&(module.exports=BN),BN.BN=BN,BN.wordSize=26,BN.prototype._init=function(t,i){if("number"==typeof t)return 0>t&&(this.sign=!0,t=-t),void(67108864>t?(this.words=[67108863&t],this.length=1):(this.words=[67108863&t,t/67108864&67108863],this.length=2));if("object"==typeof t){assert("number"==typeof t.length),this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3){var e=t[r]|t[r-1]<<8|t[r-2]<<16;this.words[n]|=e<>>26-s&67108863,s+=24,s>=26&&(s-=26,n++)}return this.strip()}"hex"===i&&(i=16),assert(16>=i),t=t.toString().replace(/\s+/g,"");var o=0;"-"===t[0]&&o++,16===i?this._parseHex(t,o):this._parseBase(t,i,o),"-"===t[0]&&(this.sign=!0),this.strip()},BN.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6){var e=parseInt(t.slice(r,r+6),16);this.words[n]|=e<>>26-s&4194303,s+=24,s>=26&&(s-=26,n++)}if(r+6!==i){var e=parseInt(t.slice(i,r+6),16);this.words[n]|=e<>>26-s&4194303}this.strip()},BN.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var s=0,n=1,e=0,o=null,h=r;h=d?0|d:d>="a"?d.charCodeAt(0)-97+10:d.charCodeAt(0)-65+10,s*=i,s+=f,n*=i,e++,n>1048575&&(assert(67108863>=n),o||(o=new BN(n)),this.mul(o).copy(this),this.iadd(new BN(s)),s=0,n=1,e=0)}0!==e&&(this.mul(new BN(n)).copy(this),this.iadd(new BN(s)))},BN.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},BN.prototype.inspect=function(){return(this.red?""};var div10=new BN(null);div10.words=[8011776,1490116],div10.length=2,BN.prototype.toString=function(t){if(t=t||10,16===t||"hex"===t){for(var i="",r=0,s=0,n=0;n>>24-r&16777215,i=0!==s||n!==this.length-1?zero6(o)+i:o+i,r+=2,r>=26&&(r-=26,n--)}return 0!==s&&(i=s.toString(16)+i),this.sign&&(i="-"+i),i}if(10===t){var i="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(1e6);h=h.idivn(1e6),i=0!==h.cmpn(0)?zero6(f+"")+i:f+i}return 0===this.cmpn(0)&&(i="0"+i),this.sign&&(i="-"+i),i}assert(!1,"Only 16 and 10 base are supported")},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toArray=function(){this.strip();var t=new Array(this.byteLength());t[0]=0;for(var i=this.clone(),r=0;0!==i.cmpn(0);r++){var s=i.andln(255);i.ishrn(8),t[t.length-r-1]=s +}return t},BN.prototype._countBits=function(t){return t>=33554432?26:t>=16777216?25:t>=8388608?24:t>=4194304?23:t>=2097152?22:t>=1048576?21:t>=524288?20:t>=262144?19:t>=131072?18:t>=65536?17:t>=32768?16:t>=16384?15:t>=8192?14:t>=4096?13:t>=2048?12:t>=1024?11:t>=512?10:t>=256?9:t>=128?8:t>=64?7:t>=32?6:t>=16?5:t>=8?4:t>=4?3:t>=2?2:t>=1?1:0},BN.prototype.bitLength=function(){var t=0,i=this.words[this.length-1],t=this._countBits(i);return 26*(this.length-1)+t},BN.prototype.byteLength=function(){this.words[this.length-1];return Math.ceil(this.bitLength()/8)},BN.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},BN.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var i=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var i=this.isub(t);return t.sign=!0,i._normSign()}var r,s;this.length>t.length?(r=this,s=t):(r=t,s=this);for(var n=0,e=0;e>>26}for(;0!==n&&e>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function(t){if(t.sign){t.sign=!1;var i=this.iadd(t);return t.sign=!0,i._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;if(r>0)var s=this,n=t;else var s=t,n=this;for(var e=0,o=0;oi?(i+=67108864,e=1):e=0,this.words[o]=i}for(;0!==e&&oi?(i+=67108864,e=1):e=0,this.words[o]=i}if(0===e&&o>>26,e=67108863&r,o=Math.min(s,t.length-1),h=Math.max(0,s-this.length+1);o>=h;h++){var f=s-h,d=this.words[f],u=t.words[h],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}i.words[s]=e,r=n}return 0!==r?i.words[s]=r:i.length--,i.strip()},BN.prototype.mul=function(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var i=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var s=this.length-2;s>=0;s--){for(var n=0,e=0,o=Math.min(s,r-1),h=Math.max(0,s-i+1);o>=h;h++){var f=s-h,d=this.words[f],u=t.words[h],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}this.words[s]=e,this.words[s+1]+=n,n=0}for(var n=0,f=1;f>>26}return this.strip()},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.mul(this)},BN.prototype.ishln=function(t){assert("number"==typeof t&&t>=0);{var i=t%26,r=(t-i)/26,s=67108863>>>26-i<<26-i;this.clone()}if(0!==i){for(var n=0,e=0;e>>26-i}n&&(this.words[e]=n,this.length++)}if(0!==r){for(var e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(var e=0;r>e;e++)this.words[e]=0;this.length+=r}return this.strip()},BN.prototype.ishrn=function(t,i,r){assert("number"==typeof t&&t>=0),i=i?(i-i%26)/26:0;var s=t%26,n=Math.min((t-s)/26,this.length),e=67108863^67108863>>>s<h;h++)o.words[h]=this.words[h];o.length=n}if(0===n);else if(this.length>n){this.length-=n;for(var h=0;h=0&&(0!==f||h>=i);h--){var d=this.words[h];this.words[h]=f<<26-s|d>>>s,f=d&e}return o&&0!==f&&(o.words[o.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),r?{hi:this,lo:o}:this},BN.prototype.shln=function(t){return this.clone().ishln(t)},BN.prototype.shrn=function(t){return this.clone().ishrn(t)},BN.prototype.testn=function(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,s=1<=0);var i=t%26,r=(t-i)/26;if(assert(!this.sign,"imaskn works only with positive numbers"),0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var s=67108863^67108863>>>i<t)return this.isubn(t);this.words[0]+=t;for(var i=0;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},BN.prototype.isubn=function(t){if(assert("number"==typeof t),assert(this.cmpn(t)>=0,"Sign change is not supported in isubn"),0>t)return this.iaddn(-t);this.words[0]-=t;for(var i=0;in.length;){var o=67108864*s.words[s.length-1]+s.words[s.length-2],h=o/n.words[n.length-1],f=h/67108864|0,d=67108863&h;h=new BN(null),h.words=[d,f],h.length=2;var r=26*(s.length-n.length-1);if(e){var u=h.shln(r);s.sign?e.isub(u):e.iadd(u)}h=h.mul(n).ishln(r),s.sign?s.iadd(h):s.isub(h)}for(;s.ucmp(n)>=0;){var o=s.words[s.length-1],h=new BN(o/n.words[n.length-1]|0),r=26*(s.length-n.length);if(e){var u=h.shln(r);s.sign?e.isub(u):e.iadd(u)}h=h.mul(n).ishln(r),s.sign?s.iadd(h):s.isub(h)}return s.sign&&(e&&e.isubn(1),s.iadd(n)),{div:e?e:null,mod:s}},BN.prototype.divmod=function(t,i){if(assert(0!==t.cmpn(0)),this.sign&&!t.sign){var r,s,n=this.neg().divmod(t,i);return"mod"!==i&&(r=n.div.neg()),"div"!==i&&(s=0===n.mod.cmpn(0)?n.mod:t.sub(n.mod)),{div:r,mod:s}}if(!this.sign&&t.sign){var r,n=this.divmod(t.neg(),i);return"mod"!==i&&(r=n.div.neg()),{div:r,mod:n.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),i):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,i)},BN.prototype.div=function(t){return this.divmod(t,"div").div},BN.prototype.mod=function(t){return this.divmod(t,"mod").mod},BN.prototype.divRound=function(t){var i=this.divmod(t);if(0===i.mod.cmpn(0))return i.div;var r=i.div.sign?i.mod.isub(t):i.mod,s=t.shrn(1),n=t.andln(1),e=r.cmp(s);return 0>e||1===n&&0===e?i.div:i.div.sign?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modn=function(t){assert(67108863>=t);for(var i=(1<<26)%t,r=0,s=this.length-1;s>=0;s--)r=(i*r+this.words[s])%t;return r},BN.prototype.idivn=function(t){assert(67108863>=t);for(var i=0,r=this.length-1;r>=0;r--){var s=this.words[r]+67108864*i;this.words[r]=s/t|0,i=s%t}return this.strip()},BN.prototype.divn=function(t){return this.clone().idivn(t)},BN.prototype._egcd=function(t,i){assert(!i.sign),assert(0!==i.cmpn(0));var r=this,s=i.clone();r=r.sign?r.mod(i):r.clone();for(var n=new BN(0);r.cmpn(1)>0&&s.cmpn(1)>0;){for(;r.isEven();)r.ishrn(1),t.isEven()?t.ishrn(1):t.iadd(i).ishrn(1);for(;s.isEven();)s.ishrn(1),n.isEven()?n.ishrn(1):n.iadd(i).ishrn(1);r.cmp(s)>=0?(r.isub(s),t.isub(n)):(s.isub(r),n.isub(t))}return 0===r.cmpn(1)?t:n},BN.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var i=this.clone(),r=t.clone();i.sign=!1,r.sign=!1;for(var s=0;i.isEven()&&r.isEven();s++)i.ishrn(1),r.ishrn(1);for(;i.isEven();)i.ishrn(1);do{for(;r.isEven();)r.ishrn(1);if(i.cmp(r)<0){var n=i;i=r,r=n}i.isub(i.div(r).mul(r))}while(0!==i.cmpn(0)&&0!==r.cmpn(0));return 0===i.cmpn(0)?r.ishln(s):i.ishln(s)},BN.prototype.invm=function(t){return this._egcd(new BN(1),t).mod(t)},BN.prototype.isEven=function(){return 0===(1&this.words[0])},BN.prototype.isOdd=function(){return 1===(1&this.words[0])},BN.prototype.andln=function(t){return this.words[0]&t},BN.prototype.bincn=function(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,s=1<n;n++)this.words[n]=0;return this.words[r]|=s,this.length=r+1,this}for(var e=s,n=r;0!==e&&n>>26,o&=67108863,this.words[n]=o}return 0!==e&&(this.words[n]=e,this.length++),this},BN.prototype.cmpn=function(t){var i=0>t;if(i&&(t=-t),this.sign&&!i)return-1;if(!this.sign&&i)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var s=this.words[0];r=s===t?0:t>s?-1:1}return this.sign&&(r=-r),r},BN.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var i=this.ucmp(t);return this.sign?-i:i},BN.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;r--){var s=this.words[r],n=t.words[r];if(s!==n){n>s?i=-1:s>n&&(i=1);break}}return i},BN.red=function(t){return new Red(t)},BN.prototype.toRed=function(t){return assert(!this.red,"Already a number in reduction context"),assert(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(t){return this.red=t,this},BN.prototype.forceRed=function(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function(t){var i,r=t;do{var s=r.ishrn(this.n,0,this.tmp);r=this.imulK(s.hi),r=r.iadd(s.lo),i=r.bitLength()}while(i>this.n);var n=i0?r.isub(this.p):r.strip(),r},MPrime.prototype.imulK=function(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=t.length-3;i>=0;i--){var r=t.words[i],s=64*r,n=977*r;s+=n/67108864|0;var e=s/67108864|0;s&=67108863,n&=67108863,t.words[i+2]+=e,t.words[i+1]+=s,t.words[i]=n}var r=t.words[t.length-2];return r>=67108864&&(t.words[t.length-1]+=r>>>26,t.words[t.length-2]=67108863&r),0===t.words[t.length-1]&&t.length--,0===t.words[t.length-1]&&t.length--,t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function(t){for(var i=0,r=0;r>>=26,t.words[r]=n,i=s}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function t(i){if(primes[i])return primes[i];var t;if("k256"===i)t=new K256;else if("p224"===i)t=new P224;else if("p192"===i)t=new P192;else{if("p25519"!==i)throw new Error("Unknown prime "+i);t=new P25519}return primes[i]=t,t},Red.prototype._verify1=function(t){assert(!t.sign,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function(t,i){assert(!t.sign&&!i.sign,"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},Red.prototype.neg=function(t){var i=t.clone();return i.sign=!i.sign,i.iadd(this.m)._forceRed(this)},Red.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)},Red.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},Red.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)},Red.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.shln(i))},Red.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function(t){return this.imul(t,t)},Red.prototype.sqr=function(t){return this.mul(t,t)},Red.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var i=this.m.andln(3);if(assert(i%2===1),3===i){var r=this.m.add(new BN(1)).ishrn(2),s=this.pow(t,r);return s}for(var n=this.m.subn(1),e=0;0!==n.cmpn(0)&&0===n.andln(1);)e++,n.ishrn(1);assert(0!==n.cmpn(0));var o=new BN(1).toRed(this),h=o.redNeg(),f=this.m.subn(1).ishrn(1),d=this.m.bitLength();for(d=new BN(2*d*d).toRed(this);0!==this.pow(d,f).cmp(h);)d.redIAdd(h);for(var u=this.pow(d,n),s=this.pow(t,n.addn(1).ishrn(1)),l=this.pow(t,n),p=e;0!==l.cmp(o);){for(var a=l,g=0;0!==a.cmp(o);g++)a=a.redSqr();assert(p>g);var m=this.pow(u,new BN(1).ishln(p-g-1));s=s.redMul(m),u=m.redSqr(),l=l.redMul(u),p=g}return s},Red.prototype.invm=function(t){var i=t._egcd(new BN(1),this.m);return i.sign?(i.sign=!1,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function(t,i){for(var r=[],s=i.clone();0!==s.cmpn(0);)r.push(s.andln(1)),s.ishrn(1);for(var n=t,e=0;e=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},Mont.prototype.mul=function(t,i){if(0===t.cmpn(0)||0===i.cmpn(0))return new BN(0)._forceRed(this);var r=t.mul(i),s=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(s).ishrn(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)},Mont.prototype.invm=function(t){var i=this.imod(t.invm(this.m).mul(this.r2));return i._forceRed(this)}},{}],buffertools:[function(require,module,exports){module.exports=require("fugeBw")},{}],fugeBw:[function(require,module,exports){(function(t){"use strict";function r(){this.writable=!0,this.buffer=null}var e=require("events"),n=require("util"),i={};module.exports.Buffer=t;var o=function(r){return r instanceof t||r instanceof Uint8Array},f=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw new Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}return t.apply(r,arguments)}},u=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}var e=arguments[0];if("string"==typeof e||e instanceof String||o(e))return t.apply(r,arguments);throw new Error("Second argument must be a string or a buffer.")}};i.clear=f(function(){for(var t=0;tn;n++)this[e+n]="undefined"==typeof t.length?t:"string"==typeof t[n]?t[n].charCodeAt(0):t[n];return this}),i.indexOf=f(function(t,r){if(r=r||0,0===t.length)return-1;for(var e=r;en?1:-1;for(var i=0;e>i;i++){var o=r[i],f=t[i];if("string"==typeof f&&(f=f.charCodeAt(0)),o!==f)return o>f?1:-1}return 0}),i.concat=function(){for(var r=0,e=0;e2&&(e=e.substring(1,3)),t+=e}return t}),i.fromHex=f(function(){var r=this.length;if(r%2!==0)throw new Error("Invalid hex string length");for(var e=new t(r/2),n=0;n0?Array.prototype.slice.call(arguments):"function"==typeof Uint8Array?[t.prototype,Uint8Array.prototype]:[t.prototype];for(var e=0,n=r.length;n>e;e+=1){var o=r[e];for(var f in i)o[f]=i[f];o!==exports&&(o.concat=function(){var t=[this].concat(Array.prototype.slice.call(arguments));return i.concat.apply(i,t)})}},exports.extend(exports),n.inherits(r,e.EventEmitter),r.prototype._append=function(r,e){if(!this.writable)throw new Error("Stream is not writable.");if(t.isBuffer(r));else{if("string"!=typeof r)throw new Error("Argument should be either a buffer or a string.");r=new t(r,e||"utf8")}this.buffer?this.buffer=i.concat(this.buffer,r):(this.buffer=new t(r.length),r.copy(this.buffer))},r.prototype.write=function(t,r){return this._append(t,r),!0},r.prototype.end=function(t,r){t&&this._append(t,r),this.emit("close"),this.writable=!1},r.prototype.getBuffer=function(){return this.buffer?this.buffer:new t(0)},r.prototype.toString=function(){return this.getBuffer().toString()},exports.WritableBufferStream=r}).call(this,require("buffer").Buffer)},{buffer:29,events:38,util:51}],27:[function(require,module,exports){},{}],28:[function(require,module,exports){function replacer(t,e){return util.isUndefined(e)?""+e:!util.isNumber(e)||!isNaN(e)&&isFinite(e)?util.isFunction(e)||util.isRegExp(e)?e.toString():e:e.toString()}function truncate(t,e){return util.isString(t)?t.length=0;i--)if(s[i]!=n[i])return!1;for(i=s.length-1;i>=0;i--)if(r=s[i],!_deepEqual(t[r],e[r]))return!1;return!0}function expectedException(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function _throws(t,e,r,i){var s;util.isString(r)&&(i=r,r=null);try{e()}catch(n){s=n}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!s&&fail(s,r,"Missing expected exception"+i),!t&&expectedException(s,r)&&fail(s,r,"Got unwanted exception"+i),t&&s&&r&&!expectedException(s,r)||!t&&s)throw s}var util=require("util/"),pSlice=Array.prototype.slice,hasOwn=Object.prototype.hasOwnProperty,assert=module.exports=ok;assert.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var e=t.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var i=r.stack,s=e.name,n=i.indexOf("\n"+s);if(n>=0){var a=i.indexOf("\n",n+1);i=i.substring(a+1)}this.stack=i}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(t,e,r){t!=e&&fail(t,e,r,"==",assert.equal)},assert.notEqual=function(t,e,r){t==e&&fail(t,e,r,"!=",assert.notEqual)},assert.deepEqual=function(t,e,r){_deepEqual(t,e)||fail(t,e,r,"deepEqual",assert.deepEqual)},assert.notDeepEqual=function(t,e,r){_deepEqual(t,e)&&fail(t,e,r,"notDeepEqual",assert.notDeepEqual)},assert.strictEqual=function(t,e,r){t!==e&&fail(t,e,r,"===",assert.strictEqual)},assert.notStrictEqual=function(t,e,r){t===e&&fail(t,e,r,"!==",assert.notStrictEqual)},assert.throws=function(){_throws.apply(this,[!0].concat(pSlice.call(arguments)))},assert.doesNotThrow=function(){_throws.apply(this,[!1].concat(pSlice.call(arguments)))},assert.ifError=function(t){if(t)throw t};var objectKeys=Object.keys||function(t){var e=[];for(var r in t)hasOwn.call(t,r)&&e.push(r);return e}},{"util/":51}],29:[function(require,module,exports){function Buffer(e,t,r){if(!(this instanceof Buffer))return new Buffer(e,t,r);var n=typeof e;if("base64"===t&&"string"===n)for(e=stringtrim(e);e.length%4!==0;)e+="=";var i;if("number"===n)i=coerce(e);else if("string"===n)i=Buffer.byteLength(e,t);else{if("object"!==n)throw new Error("First argument needs to be a number, array or string.");i=coerce(e.length)}var s;Buffer._useTypedArrays?s=Buffer._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(Buffer._useTypedArrays&&"number"==typeof e.byteLength)s._set(e);else if(isArrayish(e))for(a=0;i>a;a++)s[a]=Buffer.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===n)s.write(e,0,t);else if("number"===n&&!Buffer._useTypedArrays&&!r)for(a=0;i>a;a++)s[a]=0;return s}function _hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;assert(s%2===0,"Invalid hex string"),n>s/2&&(n=s/2);for(var a=0;n>a;a++){var o=parseInt(t.substr(2*a,2),16);assert(!isNaN(o),"Invalid hex string"),e[r+a]=o}return Buffer._charsWritten=2*a,a}function _utf8Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf8ToBytes(t),e,r,n);return i}function _asciiWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(asciiToBytes(t),e,r,n);return i}function _binaryWrite(e,t,r,n){return _asciiWrite(e,t,r,n)}function _base64Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(base64ToBytes(t),e,r,n);return i}function _utf16leWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf16leToBytes(t),e,r,n);return i}function _base64Slice(e,t,r){return base64.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function _utf8Slice(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var s=t;r>s;s++)e[s]<=127?(n+=decodeUtf8Char(i)+String.fromCharCode(e[s]),i=""):i+="%"+e[s].toString(16);return n+decodeUtf8Char(i)}function _asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function _binarySlice(e,t,r){return _asciiSlice(e,t,r)}function _hexSlice(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",s=t;r>s;s++)i+=toHex(e[s]);return i}function _utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",s=0;s=i)){var s;return r?(s=e[t],i>t+1&&(s|=e[t+1]<<8)):(s=e[t]<<8,i>t+1&&(s|=e[t+1])),s}}function _readUInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3=i)){var s;return r?(i>t+2&&(s=e[t+2]<<16),i>t+1&&(s|=e[t+1]<<8),s|=e[t],i>t+3&&(s+=e[t+3]<<24>>>0)):(i>t+1&&(s=e[t+1]<<16),i>t+2&&(s|=e[t+2]<<8),i>t+3&&(s|=e[t+3]),s+=e[t]<<24>>>0),s}}function _readInt16(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+1=i)){var s=_readUInt16(e,t,r,!0),a=32768&s;return a?-1*(65535-s+1):s}}function _readInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3=i)){var s=_readUInt32(e,t,r,!0),a=2147483648&s;return a?-1*(4294967295-s+1):s}}function _readFloat(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+3=s))for(var a=0,o=Math.min(s-r,2);o>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function _writeUInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s))for(var a=0,o=Math.min(s-r,4);o>a;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function _writeInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1=s||(t>=0?_writeUInt16(e,t,r,n,i):_writeUInt16(e,65535+t+1,r,n,i))}function _writeInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s||(t>=0?_writeUInt32(e,t,r,n,i):_writeUInt32(e,4294967295+t+1,r,n,i))}function _writeFloat(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s||ieee754.write(e,t,r,n,23,4)}function _writeDouble(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+7=s||ieee754.write(e,t,r,n,52,8)}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function clamp(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function coerce(e){return e=~~Math.ceil(+e),0>e?0:e}function isArray(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function isArrayish(e){return isArray(e)||Buffer.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function toHex(e){return 16>e?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e){for(var t=[],r=0;r=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var s=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;a>8,n=t%256,i.push(n),i.push(r);return i}function base64ToBytes(e){return base64.toByteArray(e)}function blitBuffer(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function decodeUtf8Char(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function verifuint(e,t){assert("number"==typeof e,"cannot write a non-number as a number"),assert(e>=0,"specified a negative value for writing an unsigned value"),assert(t>=e,"value is larger than maximum value for type"),assert(Math.floor(e)===e,"value has a fractional component")}function verifsint(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value"),assert(Math.floor(e)===e,"value has a fractional component") +}function verifIEEE754(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value")}function assert(e,t){if(!e)throw new Error(t||"Failed assertion")}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192,Buffer._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(r){return!1}}(),Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},Buffer.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=utf8ToBytes(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=base64ToBytes(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},Buffer.concat=function(e,t){if(assert(isArray(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new Buffer(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;rs&&(r=s)):r=s,n=String(n||"utf8").toLowerCase();var a;switch(n){case"hex":a=_hexWrite(this,e,t,r);break;case"utf8":case"utf-8":a=_utf8Write(this,e,t,r);break;case"ascii":a=_asciiWrite(this,e,t,r);break;case"binary":a=_binaryWrite(this,e,t,r);break;case"base64":a=_base64Write(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=_utf16leWrite(this,e,t,r);break;default:throw new Error("Unknown encoding")}return a},Buffer.prototype.toString=function(e,t,r){var n=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=_hexSlice(n,t,r);break;case"utf8":case"utf-8":i=_utf8Slice(n,t,r);break;case"ascii":i=_asciiSlice(n,t,r);break;case"binary":i=_binarySlice(n,t,r);break;case"base64":i=_base64Slice(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=_utf16leSlice(n,t,r);break;default:throw new Error("Unknown encoding")}return i},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){assert(n>=r,"sourceEnd < sourceStart"),assert(t>=0&&t=0&&r=0&&n<=i.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-ts||!Buffer._useTypedArrays)for(var a=0;s>a;a++)e[a+t]=this[a+r];else e._set(this.subarray(r,r+s),t)}},Buffer.prototype.slice=function(e,t){var r=this.length;if(e=clamp(e,r,0),t=clamp(t,r,r),Buffer._useTypedArrays)return Buffer._augment(this.subarray(e,t));for(var n=t-e,i=new Buffer(n,void 0,!0),s=0;n>s;s++)i[s]=this[s+e];return i},Buffer.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},Buffer.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},Buffer.prototype.readUInt8=function(e,t){return t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e=this.length?void 0:this[e]},Buffer.prototype.readUInt16LE=function(e,t){return _readUInt16(this,e,!0,t)},Buffer.prototype.readUInt16BE=function(e,t){return _readUInt16(this,e,!1,t)},Buffer.prototype.readUInt32LE=function(e,t){return _readUInt32(this,e,!0,t)},Buffer.prototype.readUInt32BE=function(e,t){return _readUInt32(this,e,!1,t)},Buffer.prototype.readInt8=function(e,t){if(t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},Buffer.prototype.readInt16LE=function(e,t){return _readInt16(this,e,!0,t)},Buffer.prototype.readInt16BE=function(e,t){return _readInt16(this,e,!1,t)},Buffer.prototype.readInt32LE=function(e,t){return _readInt32(this,e,!0,t)},Buffer.prototype.readInt32BE=function(e,t){return _readInt32(this,e,!1,t)},Buffer.prototype.readFloatLE=function(e,t){return _readFloat(this,e,!0,t)},Buffer.prototype.readFloatBE=function(e,t){return _readFloat(this,e,!1,t)},Buffer.prototype.readDoubleLE=function(e,t){return _readDouble(this,e,!0,t)},Buffer.prototype.readDoubleBE=function(e,t){return _readDouble(this,e,!1,t)},Buffer.prototype.writeUInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t=this.length||(this[t]=e)},Buffer.prototype.writeUInt16LE=function(e,t,r){_writeUInt16(this,e,t,!0,r)},Buffer.prototype.writeUInt16BE=function(e,t,r){_writeUInt16(this,e,t,!1,r)},Buffer.prototype.writeUInt32LE=function(e,t,r){_writeUInt32(this,e,t,!0,r)},Buffer.prototype.writeUInt32BE=function(e,t,r){_writeUInt32(this,e,t,!1,r)},Buffer.prototype.writeInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},Buffer.prototype.writeInt16LE=function(e,t,r){_writeInt16(this,e,t,!0,r)},Buffer.prototype.writeInt16BE=function(e,t,r){_writeInt16(this,e,t,!1,r)},Buffer.prototype.writeInt32LE=function(e,t,r){_writeInt32(this,e,t,!0,r)},Buffer.prototype.writeInt32BE=function(e,t,r){_writeInt32(this,e,t,!1,r)},Buffer.prototype.writeFloatLE=function(e,t,r){_writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){_writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){_writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){_writeDouble(this,e,t,!1,r)},Buffer.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),assert("number"==typeof e&&!isNaN(e),"value is not a number"),assert(r>=t,"end < start"),r!==t&&0!==this.length){assert(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},Buffer.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=toHex(this[r]),r===exports.INSPECT_MAX_BYTES){e[r+1]="...";break}return""},Buffer.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(Buffer._useTypedArrays)return new Buffer(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var BP=Buffer.prototype;Buffer._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=BP.get,e.set=BP.set,e.write=BP.write,e.toString=BP.toString,e.toLocaleString=BP.toString,e.toJSON=BP.toJSON,e.copy=BP.copy,e.slice=BP.slice,e.readUInt8=BP.readUInt8,e.readUInt16LE=BP.readUInt16LE,e.readUInt16BE=BP.readUInt16BE,e.readUInt32LE=BP.readUInt32LE,e.readUInt32BE=BP.readUInt32BE,e.readInt8=BP.readInt8,e.readInt16LE=BP.readInt16LE,e.readInt16BE=BP.readInt16BE,e.readInt32LE=BP.readInt32LE,e.readInt32BE=BP.readInt32BE,e.readFloatLE=BP.readFloatLE,e.readFloatBE=BP.readFloatBE,e.readDoubleLE=BP.readDoubleLE,e.readDoubleBE=BP.readDoubleBE,e.writeUInt8=BP.writeUInt8,e.writeUInt16LE=BP.writeUInt16LE,e.writeUInt16BE=BP.writeUInt16BE,e.writeUInt32LE=BP.writeUInt32LE,e.writeUInt32BE=BP.writeUInt32BE,e.writeInt8=BP.writeInt8,e.writeInt16LE=BP.writeInt16LE,e.writeInt16BE=BP.writeInt16BE,e.writeInt32LE=BP.writeInt32LE,e.writeInt32BE=BP.writeInt32BE,e.writeFloatLE=BP.writeFloatLE,e.writeFloatBE=BP.writeFloatBE,e.writeDoubleLE=BP.writeDoubleLE,e.writeDoubleBE=BP.writeDoubleBE,e.fill=BP.fill,e.inspect=BP.inspect,e.toArrayBuffer=BP.toArrayBuffer,e}},{"base64-js":30,ieee754:31}],30:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function r(t){var r=t.charCodeAt(0);return r===h?62:r===c?63:o>r?-1:o+10>r?r-o+26+26:i+26>r?r-i:A+26>r?r-A+26:void 0}function e(t){function e(t){i[f++]=t}var n,h,c,o,A,i;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=t.length;A="="===t.charAt(u-2)?2:"="===t.charAt(u-1)?1:0,i=new a(3*t.length/4-A),c=A>0?t.length-4:t.length;var f=0;for(n=0,h=0;c>n;n+=4,h+=3)o=r(t.charAt(n))<<18|r(t.charAt(n+1))<<12|r(t.charAt(n+2))<<6|r(t.charAt(n+3)),e((16711680&o)>>16),e((65280&o)>>8),e(255&o);return 2===A?(o=r(t.charAt(n))<<2|r(t.charAt(n+1))>>4,e(255&o)):1===A&&(o=r(t.charAt(n))<<10|r(t.charAt(n+1))<<4|r(t.charAt(n+2))>>2,e(o>>8&255),e(255&o)),i}function n(t){function r(t){return lookup.charAt(t)}function e(t){return r(t>>18&63)+r(t>>12&63)+r(t>>6&63)+r(63&t)}var n,a,h,c=t.length%3,o="";for(n=0,h=t.length-c;h>n;n+=3)a=(t[n]<<16)+(t[n+1]<<8)+t[n+2],o+=e(a);switch(c){case 1:a=t[t.length-1],o+=r(a>>2),o+=r(a<<4&63),o+="==";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],o+=r(a>>10),o+=r(a>>4&63),o+=r(a<<2&63),o+="="}return o}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,h="+".charCodeAt(0),c="/".charCodeAt(0),o="0".charCodeAt(0),A="a".charCodeAt(0),i="A".charCodeAt(0);t.toByteArray=e,t.fromByteArray=n}("undefined"==typeof exports?this.base64js={}:exports)},{}],31:[function(require,module,exports){exports.read=function(o,t,a,r,h){var M,p,w=8*h-r-1,f=(1<>1,i=-7,n=a?h-1:0,s=a?-1:1,N=o[t+n];for(n+=s,M=N&(1<<-i)-1,N>>=-i,i+=w;i>0;M=256*M+o[t+n],n+=s,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+o[t+n],n+=s,i-=8);if(0===M)M=1-e;else{if(M===f)return p?0/0:1/0*(N?-1:1);p+=Math.pow(2,r),M-=e}return(N?-1:1)*p*Math.pow(2,M-r)},exports.write=function(o,t,a,r,h,M){var p,w,f,e=8*M-h-1,i=(1<>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:M-1,u=r?1:-1,l=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(w=isNaN(t)?1:0,p=i):(p=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-p))<1&&(p--,f*=2),t+=p+n>=1?s/f:s*Math.pow(2,1-n),t*f>=2&&(p++,f/=2),p+n>=i?(w=0,p=i):p+n>=1?(w=(t*f-1)*Math.pow(2,h),p+=n):(w=t*Math.pow(2,n-1)*Math.pow(2,h),p=0));h>=8;o[a+N]=255&w,N+=u,w/=256,h-=8);for(p=p<0;o[a+N]=255&p,N+=u,p/=256,e-=8);o[a+N-u]|=128*l}},{}],32:[function(require,module,exports){function toArray(r,e){if(r.length%intSize!==0){var f=r.length+(intSize-r.length%intSize);r=Buffer.concat([r,zeroBuffer],f)}for(var t=[],n=e?r.readInt32BE:r.readInt32LE,u=0;ublocksize?r=e(r):r.lengthi;i++)t[i]=54^r[i],n[i]=92^r[i];var c=e(Buffer.concat([t,f]));return e(Buffer.concat([n,c]))}function hash(e,r){e=e||"sha1";var f=algorithms[e],t=[],n=0;return f||error("algorithm:",e,"is not yet supported"),{update:function(e){return Buffer.isBuffer(e)||(e=new Buffer(e)),t.push(e),n+=e.length,this},digest:function(e){var n=Buffer.concat(t),i=r?hmac(f,r,n):f(n);return t=null,e?i.toString(e):i}}}function error(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function each(e,r){for(var f in e)r(e[f],f)}var Buffer=require("buffer").Buffer,sha=require("./sha"),sha256=require("./sha256"),rng=require("./rng"),md5=require("./md5"),algorithms={sha1:sha,sha256:sha256,md5:md5},blocksize=64,zeroBuffer=new Buffer(blocksize);zeroBuffer.fill(0),exports.createHash=function(e){return hash(e)},exports.createHmac=function(e,r){return hash(e,r)},exports.randomBytes=function(e,r){if(!r||!r.call)return new Buffer(rng(e));try{r.call(this,void 0,new Buffer(rng(e)))}catch(f){r(f)}},each(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){exports[e]=function(){error("sorry,",e,"is not implemented yet")}})},{"./md5":34,"./rng":35,"./sha":36,"./sha256":37,buffer:29}],34:[function(require,module,exports){function md5_vm_test(){return"900150983cd24fb0d6963f7d28e17f72"==hex_md5("abc")}function core_md5(d,_){d[_>>5]|=128<<_%32,d[(_+64>>>9<<4)+14]=_;for(var m=1732584193,f=-271733879,i=-1732584194,h=271733878,r=0;r>16)+(_>>16)+(m>>16);return f<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}var helpers=require("./helpers");module.exports=function(d){return helpers.hash(d,core_md5,16)}},{"./helpers":32}],35:[function(require,module,exports){!function(){var r,n,t=this;r=function(r){for(var n,n,t=new Array(r),o=0;r>o;o++)0==(3&o)&&(n=4294967296*Math.random()),t[o]=n>>>((3&o)<<3)&255;return t},t.crypto&&crypto.getRandomValues&&(n=function(r){var n=new Uint8Array(r);return crypto.getRandomValues(n),n}),module.exports=n||r}()},{}],36:[function(require,module,exports){function core_sha1(r,a){r[a>>5]|=128<<24-a%32,r[(a+64>>9<<4)+15]=a;for(var e=Array(80),d=1732584193,s=-271733879,f=-1732584194,n=271733878,t=-1009589776,o=0;oi;i++){e[i]=16>i?r[o+i]:rol(e[i-3]^e[i-8]^e[i-14]^e[i-16],1);var v=safe_add(safe_add(rol(d,5),sha1_ft(i,s,f,n)),safe_add(safe_add(t,e[i]),sha1_kt(i)));t=n,n=f,f=rol(s,30),s=d,d=v}d=safe_add(d,_),s=safe_add(s,u),f=safe_add(f,h),n=safe_add(n,l),t=safe_add(t,c)}return Array(d,s,f,n,t)}function sha1_ft(r,a,e,d){return 20>r?a&e|~a&d:40>r?a^e^d:60>r?a&e|a&d|e&d:a^e^d}function sha1_kt(r){return 20>r?1518500249:40>r?1859775393:60>r?-1894007588:-899497514}function safe_add(r,a){var e=(65535&r)+(65535&a),d=(r>>16)+(a>>16)+(e>>16);return d<<16|65535&e}function rol(r,a){return r<>>32-a}var helpers=require("./helpers");module.exports=function(r){return helpers.hash(r,core_sha1,20,!0)}},{"./helpers":32}],37:[function(require,module,exports){var helpers=require("./helpers"),safe_add=function(a,e){var r=(65535&a)+(65535&e),d=(a>>16)+(e>>16)+(r>>16);return d<<16|65535&r},S=function(a,e){return a>>>e|a<<32-e},R=function(a,e){return a>>>e},Ch=function(a,e,r){return a&e^~a&r},Maj=function(a,e,r){return a&e^a&r^e&r},Sigma0256=function(a){return S(a,2)^S(a,13)^S(a,22)},Sigma1256=function(a){return S(a,6)^S(a,11)^S(a,25)},Gamma0256=function(a){return S(a,7)^S(a,18)^R(a,3)},Gamma1256=function(a){return S(a,17)^S(a,19)^R(a,10)},core_sha256=function(a,e){var r,d,n,f,s,t,u,_,o,i,S,c,m=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),h=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),g=new Array(64);a[e>>5]|=128<<24-e%32,a[(e+64>>9<<4)+15]=e;for(var o=0;oi;i++)g[i]=16>i?a[i+o]:safe_add(safe_add(safe_add(Gamma1256(g[i-2]),g[i-7]),Gamma0256(g[i-15])),g[i-16]),S=safe_add(safe_add(safe_add(safe_add(_,Sigma1256(s)),Ch(s,t,u)),m[i]),g[i]),c=safe_add(Sigma0256(r),Maj(r,d,n)),_=u,u=t,t=s,s=safe_add(f,S),f=n,n=d,d=r,r=safe_add(S,c);h[0]=safe_add(r,h[0]),h[1]=safe_add(d,h[1]),h[2]=safe_add(n,h[2]),h[3]=safe_add(f,h[3]),h[4]=safe_add(s,h[4]),h[5]=safe_add(t,h[5]),h[6]=safe_add(u,h[6]),h[7]=safe_add(_,h[7])}return h};module.exports=function(a){return helpers.hash(a,core_sha256,32,!0)}},{"./helpers":32}],38:[function(require,module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!isNumber(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,n,s,i,r,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],isUndefined(n))return!1;if(isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];n.apply(this,i)}else if(isObject(n)){for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];for(o=n.slice(),s=o.length,r=0;s>r;r++)o[r].apply(this,i)}return!0},EventEmitter.prototype.addListener=function(e,t){var n;if(!isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,isFunction(t.listener)?t.listener:t),this._events[e]?isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,isObject(this._events[e])&&!this._events[e].warned){var n;n=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){function n(){this.removeListener(e,n),s||(s=!0,t.apply(this,arguments))}if(!isFunction(t))throw TypeError("listener must be a function");var s=!1;return n.listener=t,this.on(e,n),this},EventEmitter.prototype.removeListener=function(e,t){var n,s,i,r;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,s=-1,n===t||isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(n)){for(r=i;r-->0;)if(n[r]===t||n[r].listener&&n[r].listener===t){s=r;break}if(0>s)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],isFunction(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?isFunction(e._events[t])?1:e._events[t].length:0}},{}],39:[function(require,module,exports){module.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}},{}],40:[function(require,module,exports){function noop(){}var process=module.exports={};process.nextTick=function(){var o="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(o)return function(o){return window.setImmediate(o)};if(e){var n=[];return window.addEventListener("message",function(o){var e=o.source;if((e===window||null===e)&&"process-tick"===o.data&&(o.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(o){n.push(o),window.postMessage("process-tick","*")}}return function(o){setTimeout(o,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.on=noop,process.once=noop,process.off=noop,process.emit=noop,process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")}},{}],41:[function(require,module,exports){(function(r){function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}function e(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n=-1&&!s;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(n=i+"/"+n,s="/"===i.charAt(0))}return n=t(e(n.split("/"),function(r){return!!r}),!s).join("/"),(s?"/":"")+n||"."},exports.normalize=function(r){var n=exports.isAbsolute(r),s="/"===o(r,-1);return r=t(e(r.split("/"),function(r){return!!r}),!n).join("/"),r||n||(r="."),r&&s&&(r+="/"),(n?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(e(r,function(r){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;o>u;u++)if(n[u]!==s[u]){i=u;break}for(var l=[],u=i;ut&&(t=r.length+t),r.substr(t,e)}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40}],42:[function(require,module,exports){function Duplex(e){return this instanceof Duplex?(Readable.call(this,e),Writable.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",onend)):new Duplex(e)}function onend(){if(!this.allowHalfOpen&&!this._writableState.ended){var e=this;setImmediate(function(){e.end()})}}module.exports=Duplex;var inherits=require("inherits"),setImmediate=require("process/browser.js").nextTick,Readable=require("./readable.js"),Writable=require("./writable.js");inherits(Duplex,Readable),Duplex.prototype.write=Writable.prototype.write,Duplex.prototype.end=Writable.prototype.end,Duplex.prototype._write=Writable.prototype._write},{"./readable.js":46,"./writable.js":48,inherits:39,"process/browser.js":44}],43:[function(require,module,exports){function Stream(){EE.call(this)}module.exports=Stream;var EE=require("events").EventEmitter,inherits=require("inherits");inherits(Stream,EE),Stream.Readable=require("./readable.js"),Stream.Writable=require("./writable.js"),Stream.Duplex=require("./duplex.js"),Stream.Transform=require("./transform.js"),Stream.PassThrough=require("./passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(e,r){function t(r){e.writable&&!1===e.write(r)&&m.pause&&m.pause()}function n(){m.readable&&m.resume&&m.resume()}function o(){u||(u=!0,e.end())}function i(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(a(),0===EE.listenerCount(this,"error"))throw e}function a(){m.removeListener("data",t),e.removeListener("drain",n),m.removeListener("end",o),m.removeListener("close",i),m.removeListener("error",s),e.removeListener("error",s),m.removeListener("end",a),m.removeListener("close",a),e.removeListener("close",a)}var m=this;m.on("data",t),e.on("drain",n),e._isStdio||r&&r.end===!1||(m.on("end",o),m.on("close",i));var u=!1;return m.on("error",s),e.on("error",s),m.on("end",a),m.on("close",a),e.on("close",a),e.emit("pipe",m),e}},{"./duplex.js":42,"./passthrough.js":45,"./readable.js":46,"./transform.js":47,"./writable.js":48,events:38,inherits:39}],44:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(n){var o=[];return window.addEventListener("message",function(e){var n=e.source;if((n===window||null===n)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){var r=o.shift();r()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")}},{}],45:[function(require,module,exports){function PassThrough(r){return this instanceof PassThrough?void Transform.call(this,r):new PassThrough(r)}module.exports=PassThrough;var Transform=require("./transform.js"),inherits=require("inherits");inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,o){o(null,r)}},{"./transform.js":47,inherits:39}],46:[function(require,module,exports){(function(e){function t(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_||(_=require("string_decoder").StringDecoder),this.decoder=new _(e.encoding),this.encoding=e.encoding)}function n(e){return this instanceof n?(this._readableState=new t(e,this),this.readable=!0,void S.call(this)):new n(e)}function r(e,t,n,r,a){var o=d(t,n); +if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||s(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!a){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&a){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||a||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,a?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),h(e,t);else a||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function o(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e,t){var n=null;return R.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function s(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):v(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?E(function(){u(e)}):u(e))}function u(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,E(function(){f(e,t)}))}function f(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;return 0===r.pipesCount?(r.flowing=!1,void(M.listenerCount(e,"data")>0&&b(e))):void(r.ranOut=!0)}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,c(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?E(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,i=t.length,a=!!t.decoder,o=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(o)n=r.shift();else if(!e||e>=i)n=a?r.join(""):R.concat(r,i),r.length=0;else if(el&&e>s;l++){var d=r[0],h=Math.min(e-s,d.length);a?n+=d.slice(0,h):d.copy(n,s,0,h),h0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,E(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function y(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}module.exports=n,n.ReadableState=t;var _,M=require("events").EventEmitter,S=require("./index.js"),R=require("buffer").Buffer,E=require("process/browser.js").nextTick,C=require("inherits");C(n,S),n.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new R(e,t),t="")),r(this,n,e,t,!1)},n.prototype.unshift=function(e){var t=this._readableState;return r(this,t,e,"",!0)},n.prototype.setEncoding=function(e){_||(_=require("string_decoder").StringDecoder),this._readableState.decoder=new _(e),this._readableState.encoding=e};var L=8388608;n.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(e=o(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=o(n,t));var i;return i=e>0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),i},n.prototype._read=function(){this.emit("error",new Error("not implemented"))},n.prototype.pipe=function(t,n){function r(e){e===u&&a()}function i(){t.end()}function a(){t.removeListener("close",d),t.removeListener("finish",s),t.removeListener("drain",m),t.removeListener("error",o),t.removeListener("unpipe",r),u.removeListener("end",i),u.removeListener("end",a),(!t._writableState||t._writableState.needDrain)&&m()}function o(e){l(),0===v&&0===M.listenerCount(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",s),l()}function s(){t.removeListener("close",d),l()}function l(){u.unpipe(t)}var u=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=t;break;case 1:h.pipes=[h.pipes,t];break;default:h.pipes.push(t)}h.pipesCount+=1;var f=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,b=f?i:a;h.endEmitted?E(b):u.once("end",b),t.on("unpipe",r);var m=p(u);t.on("drain",m);var v=M.listenerCount(t,"error");return t.once("error",o),t.once("close",d),t.once("finish",s),t.emit("pipe",u),h.flowing||(this.on("readable",g),h.flowing=!0,E(function(){c(u)})),t},n.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=y(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},n.prototype.on=function(e,t){var n=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):this.read(0))}return n},n.prototype.addListener=n.prototype.on,n.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},n.prototype.pause=function(){b(this,!0),this.emit("pause")},n.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var a=r.push(i);a||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var a=["error","close","destroy","pause","resume"];return w(a,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},n._fromList=m}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":43,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,buffer:29,events:38,inherits:39,"process/browser.js":44,string_decoder:49}],47:[function(require,module,exports){function TransformState(r,t){this.afterTransform=function(r,n){return afterTransform(t,r,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function afterTransform(r,t,n){var e=r._transformState;e.transforming=!1;var a=e.writecb;if(!a)return r.emit("error",new Error("no writecb in Transform class"));e.writechunk=null,e.writecb=null,null!==n&&void 0!==n&&r.push(n),a&&a(t);var i=r._readableState;i.reading=!1,(i.needReadable||i.length=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,r,h),this.charReceived+=h-r,r=h,this.charReceived=55296&&56319>=i)){if(this.charReceived=this.charLength=0,h==e.length)return t;e=e.slice(h,e.length);break}this.charLength+=this.surrogateSize,t=""}var c=this.detectIncompleteChar(e),n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-c,n),this.charReceived=c,n-=c),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,n)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(2>=t&&r>>4==14){this.charLength=3;break}if(3>=t&&r>>3==30){this.charLength=4;break}}return t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,h=this.charBuffer,i=this.encoding;t+=h.slice(0,r).toString(i)}return t}},{buffer:29}],50:[function(require,module,exports){module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8}},{}],51:[function(require,module,exports){(function(e,t){function r(e,t){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&exports._extend(r,t),h(r.showHidden)&&(r.showHidden=!1),h(r.depth)&&(r.depth=2),h(r.colors)&&(r.colors=!1),h(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=n),s(r,e,r.depth)}function n(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function o(e){return e}function i(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==exports.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return x(n)||(n=s(e,n,r)),n}var o=u(e,t);if(o)return o;var g=Object.keys(t),y=i(g);if(e.showHidden&&(g=Object.getOwnPropertyNames(t)),O(t)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return c(t);if(0===g.length){if(S(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(O(t))return c(t)}var m="",b=!1,h=["{","}"];if(f(t)&&(b=!0,h=["[","]"]),S(t)){var w=t.name?": "+t.name:"";m=" [Function"+w+"]"}if(v(t)&&(m=" "+RegExp.prototype.toString.call(t)),j(t)&&(m=" "+Date.prototype.toUTCString.call(t)),O(t)&&(m=" "+c(t)),0===g.length&&(!b||0==t.length))return h[0]+m+h[1];if(0>r)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var z;return z=b?l(e,t,r,y,g):g.map(function(n){return a(e,t,r,y,n,b)}),e.seen.pop(),p(z,m,h)}function u(e,t){if(h(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,o){for(var i=[],s=0,u=t.length;u>s;++s)i.push(_(t,String(s))?a(e,t,r,n,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(a(e,t,r,n,o,!0))}),i}function a(e,t,r,n,o,i){var u,c,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?c=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),_(n,o)||(u="["+o+"]"),c||(e.seen.indexOf(l.value)<0?(c=y(r)?s(e,l.value,null):s(e,l.value,r-1),c.indexOf("\n")>-1&&(c=i?c.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+c.split("\n").map(function(e){return" "+e}).join("\n"))):c=e.stylize("[Circular]","special")),h(u)){if(i&&o.match(/^\d+$/))return c;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function p(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function f(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function d(e){return null==e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function h(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function j(e){return w(e)&&"[object Date]"===E(e)}function O(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function z(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return Object.prototype.toString.call(e)}function D(e){return 10>e?"0"+e.toString(10):e.toString(10)}function N(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),H[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=/%[sdj%]/g;exports.format=function(e){if(!x(e)){for(var t=[],n=0;n=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),u=o[n];i>n;u=o[++n])s+=y(u)||!w(u)?" "+u:" "+r(u);return s},exports.deprecate=function(r,n){function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}if(h(t.process))return function(){return exports.deprecate(r,n).apply(this,arguments)};if(e.noDeprecation===!0)return r;var i=!1;return o};var J,R={};exports.debuglog=function(t){if(h(J)&&(J=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(J)){var r=e.pid;R[t]=function(){var e=exports.format.apply(exports,arguments);console.error("%s %d: %s",t,r,e)}}else R[t]=function(){};return R[t]},exports.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=f,exports.isBoolean=g,exports.isNull=y,exports.isNullOrUndefined=d,exports.isNumber=m,exports.isString=x,exports.isSymbol=b,exports.isUndefined=h,exports.isRegExp=v,exports.isObject=w,exports.isDate=j,exports.isError=O,exports.isFunction=S,exports.isPrimitive=z,exports.isBuffer=require("./support/isBuffer");var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",N(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":50,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,inherits:39}],bufferput:[function(require,module,exports){module.exports=require("aXRuS6")},{}],aXRuS6:[function(require,module,exports){(function(t){function e(){this.words=[],this.len=0}module.exports=e,e.prototype.put=function(t){return this.words.push({buffer:t}),this.len+=t.length,this},e.prototype.word8=function(t){return this.words.push({bytes:1,value:t}),this.len+=1,this},e.prototype.floatle=function(t){return this.words.push({bytes:"float",endian:"little",value:t}),this.len+=4,this},e.prototype.varint=function(t){253>t?this.word8(t):65536>=t?(this.word8(253),this.word16le(t)):1>=t?(this.word8(254),this.word32le(t)):(this.word8(255),this.word64le(t))},[8,16,24,32,64].forEach(function(t){e.prototype["word"+t+"be"]=function(e){return this.words.push({endian:"big",bytes:t/8,value:e}),this.len+=t/8,this},e.prototype["word"+t+"le"]=function(e){return this.words.push({endian:"little",bytes:t/8,value:e}),this.len+=t/8,this}}),e.prototype.pad=function(t){return this.words.push({endian:"big",bytes:t,value:0}),this.len+=t,this},e.prototype.length=function(){return this.len},e.prototype.buffer=function(){var e=new t(this.len),o=0;return this.words.forEach(function(t){if(t.buffer)t.buffer.copy(e,o,0),o+=t.buffer.length;else if("float"==t.bytes){var r=Math.abs(t.value),i=1*(t.value>=0),n=Math.ceil(Math.log(r)/Math.LN2),s=r/(1<=0:l<8*t.bytes;l+=u[1])e[o++]=l>=32?255&Math.floor(t.value/Math.pow(2,l)):t.value>>l&255}),e},e.prototype.write=function(t){t.write(this.buffer())}}).call(this,require("buffer").Buffer)},{buffer:29}],buffers:[function(require,module,exports){module.exports=require("OBo3aV")},{}],OBo3aV:[function(require,module,exports){(function(t){function e(t){return this instanceof e?(this.buffers=t||[],void(this.length=this.buffers.reduce(function(t,e){return t+e.length},0))):new e(t)}module.exports=e,e.prototype.push=function(){for(var e=0;e=0?r:this.length-r,h=[].slice.call(arguments,2);void 0===n?n=this.length-i:n>this.length-i&&(n=this.length-i);for(var r=0;r0){var u=i-o;if(u+nr;r++)p[r]=g[r];for(var a=new t(g.length-u-n),r=u+n;r0){var c=h.slice();c.unshift(p),c.push(a),s.splice.apply(s,[l,1].concat(c)),l+=c.length,h=[]}else s.splice(l,1,p,a),l+=2}else f.push(s[l].slice(u)),s[l]=s[l].slice(0,u),l++}for(h.length>0&&(s.splice.apply(s,[l,0].concat(h)),l+=h.length);f.lengththis.length&&(r=this.length);for(var s=0,i=0;if&&o=r-e?Math.min(u+(r-e)-f,l):l;n[o].copy(h,f,u,g),f+=g-u}return h},e.prototype.pos=function(t){if(0>t||t>=this.length)throw new Error("oob");for(var e=t,r=0,n=null;;){if(n=this.buffers[r],e=this.buffers[s].length;)if(i=0,s++,s>=this.buffers.length)return-1;var l=this.buffers[s][i];if(l==e[h]){if(0==h&&(n={i:s,j:i,pos:f}),h++,h==e.length)return n.pos}else 0!=h&&(s=n.i,i=n.j,f=n.pos,h=0);i++,f++}},e.prototype.toBuffer=function(){return this.slice()},e.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)}}).call(this,require("buffer").Buffer)},{buffer:29}],56:[function(require,module,exports){var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("./elliptic/rand"),elliptic.hmacDRBG=require("./elliptic/hmac-drbg"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec")},{"../package.json":77,"./elliptic/curve":59,"./elliptic/curves":62,"./elliptic/ec":63,"./elliptic/hmac-drbg":66,"./elliptic/rand":67,"./elliptic/utils":68}],57:[function(require,module,exports){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)}function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),getNAF=elliptic.utils.getNAF,getJSF=elliptic.utils.getJSF;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){var n=t._getDoubles(),r=getNAF(e,1),i=(1<=s;e--)a=(a<<1)+r[e];o.push(a)}for(var u=this.jpoint(null,null,null),p=this.jpoint(null,null,null),l=i;l>0;l--){for(var s=0;s=0;a--){for(var e=0;a>=0&&0===o[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),0>a)break;var u=o[a];assert(0!==u),s="affine"===t.type?s.mixedAdd(u>0?i[u-1>>1]:i[-u-1>>1].neg()):s.add(u>0?i[u-1>>1]:i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function(t,e,n,r){for(var i=this._wnafT1,o=this._wnafT2,s=this._wnafT3,a=0,u=0;r>u;u++){var p=e[u],l=p._getNAFPoints(t);i[u]=l.wnd,o[u]=l.points}for(var u=r-1;u>=1;u-=2){var d=u-1,h=u;if(1===i[d]&&1===i[h]){var f=[e[d],null,null,e[h]];0===e[d].y.cmp(e[h].y)?(f[1]=e[d].add(e[h]),f[2]=e[d].toJ().mixedAdd(e[h].neg())):0===e[d].y.cmp(e[h].y.redNeg())?(f[1]=e[d].toJ().mixedAdd(e[h]),f[2]=e[d].add(e[h].neg())):(f[1]=e[d].toJ().mixedAdd(e[h]),f[2]=e[d].toJ().mixedAdd(e[h].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=getJSF(n[d],n[h]);a=Math.max(g[0].length,a),s[d]=new Array(a),s[h]=new Array(a);for(var m=0;a>m;m++){var c=0|g[0][m],w=0|g[1][m];s[d][m]=v[3*(c+1)+(w+1)],s[h][m]=0,o[d]=f}}else s[d]=getNAF(n[d],i[d]),s[h]=getNAF(n[h],i[h]),a=Math.max(s[d].length,a),a=Math.max(s[h].length,a)}for(var b=this.jpoint(null,null,null),y=this._wnafT4,u=a;u>=0;u--){for(var A=0;u>=0;){for(var _=!0,m=0;r>m;m++)y[m]=0|s[m][u],0!==y[m]&&(_=!1);if(!_)break;A++,u--}if(u>=0&&A++,b=b.dblp(A),0>u)break;for(var m=0;r>m;m++){var p,B=y[m];0!==B&&(B>0?p=o[m][B-1>>1]:0>B&&(p=o[m][-B-1>>1].neg()),b="affine"===p.type?b.mixedAdd(p):b.add(p))}}for(var u=0;r>u;u++)o[u]=null;return b.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.validate=function(){return this.curve.validate(this)},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._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles; +for(var n=[this],r=this,i=0;e>i;i+=t){for(var o=0;t>o;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<i;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;t>n;n++)e=e.dbl();return e}},{"../../elliptic":56,assert:28,"bn.js":69}],58:[function(require,module,exports){function EdwardsCurve(t){this.twisted=1!=t.a,this.mOneA=this.twisted&&-1==t.a,this.extended=this.mOneA,Base.call(this,"mont",t),this.a=new bn(t.a,16).mod(this.red.m).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==t.c}function Point(t,e,r,i,d){Base.BasePoint.call(this,t,"projective"),null===e&&null===r&&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(e,16),this.y=new bn(r,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 assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;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.point=function(t,e,r,i){return new Point(this,t,e,r,i)},EdwardsCurve.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},EdwardsCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},EdwardsCurve.prototype.pointFromX=function(t,e){e=new bn(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),d=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(d.redInvm()).redSqrt(),u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s,curve.one)},EdwardsCurve.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),d=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(d)},inherits(Point,Base.BasePoint),Point.fromJSON=function(t,e){return new Point(t,e[0],e[1],e[2])},Point.prototype.inspect=function(){return this.isInfinity()?"":""},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(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),d=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),u=s.redSub(r),n=i.redSub(e),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=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),r=this.y.redSqr();if(this.curve.twisted){var i=this.curve._mulA(e),d=i.redAdd(r);if(this.zOne)var s=t.redSub(e).redSub(r).redMul(d.redSub(this.curve.two)),u=d.redMul(i.redSub(r)),n=d.redSqr().redSub(d).redSub(d);else var h=this.z.redSqr(),o=d.redSub(h).redISub(h),s=t.redSub(e).redISub(r).redMul(o),u=d.redMul(i.redSub(r)),n=d.redMul(o)}else var i=e.redAdd(r),h=this.curve._mulC(redMul(this.z)).redSqr(),o=i.redSub(h).redSub(h),s=this.curve._mulC(t.redISub(i)).redMul(o),u=this.curve._mulC(i).redMul(e.redISub(r)),n=i.redMul(o);return this.curve.point(s,u,n)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=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=r.redSub(e),u=d.redSub(i),n=d.redAdd(i),h=r.redAdd(e),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 e=this.z.redMul(t.z),r=e.redSqr(),i=this.x.redMul(t.x),d=this.y.redMul(t.y),s=this.curve.d.redMul(i).redMul(d),u=r.redSub(s),n=r.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(d),o=e.redMul(u).redMul(h);if(this.curve.twisted)var l=e.redMul(n).redMul(d.redSub(this.curve._mulA(i))),c=u.redMul(n);else var l=e.redMul(n).redMul(d.redSub(i)),c=this.curve._mulC(u).redMul(n);return this.curve.point(o,l,c)},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.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2)},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.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],59:[function(require,module,exports){var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards")},{"./base":57,"./edwards":58,"./mont":60,"./short":61}],60:[function(require,module,exports){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,e,r){Base.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new bn(e,16),this.z=new bn(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.point=function(t,e){return new Point(this,t,e)},MontCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},MontCurve.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),n=i.redSqrt();return 0===n.redSqr().cmp(i)},inherits(Point,Base.BasePoint),Point.prototype.precompute=function(){},Point.fromJSON=function(t,e){return new Point(t,e[0],e[1]||t.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),n=e.redSub(i),o=e.redMul(i),d=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(o,d)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z),d=o.redMul(r),s=n.redMul(i),u=e.z.redMul(d.redAdd(s).redSqr()),h=e.x.redMul(d.redISub(s).redSqr());return this.curve.point(u,h)},Point.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=this,o=[];0!==e.cmpn(0);e.ishrn(1))o.push(e.andln(1));for(var d=o.length-1;d>=0;d--)0===o[d]?(r=r.diffAdd(i,n),i=i.dbl()):(i=r.diffAdd(i,n),r=r.dbl());return i},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},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":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],61:[function(require,module,exports){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 assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;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=d[0].cmp(d[1])<0?d[0]:d[1],e=e.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(1).toRed(e),new bn(3).toRed(e).redNeg().redSqrt().redMul(t)),n=d.redAdd(i).fromRed(),u=d.redSub(i).fromRed();return[n,u]},ShortCurve.prototype._getEndoBasis=function(r){for(var e,t,d,i,n,u,s,o=this.n.shrn(Math.floor(this.n.bitLength()/2)),h=r,p=this.n.clone(),l=new bn(1),a=new bn(0),b=new bn(0),f=new bn(1),c=0;0!==h.cmpn(0);){var S=p.div(h),v=p.sub(S.mul(h)),I=b.sub(S.mul(l)),y=f.sub(S.mul(a));if(!d&&v.cmp(o)<0)e=s.neg(),t=l,d=v.neg(),i=I;else if(d&&2===++c)break;s=v,p=h,h=v,b=l,l=I,f=a,a=y}n=v.neg(),u=I;var A=d.sqr().add(i.sqr()),m=n.sqr().add(u.sqr());return m.cmp(A)>=0&&(n=e,u=t),d.sign&&(d=d.neg(),i=i.neg()),n.sign&&(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),p=r.sub(u).sub(s),l=o.add(h).neg();return{k1:p,k2:l}},ShortCurve.prototype.point=function(r,e,t){return new Point(this,r,e,t)},ShortCurve.prototype.pointFromX=function(r,e){e=new bn(e,16),e.red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),d=t.redSqrt(),i=d.fromRed().isOdd();return(r&&!i||!r&&i)&&(d=d.redNeg()),this.point(e,d)},ShortCurve.prototype.jpoint=function(r,e,t){return new JPoint(this,r,e,t)},ShortCurve.prototype.pointFromJSON=function(r,e){return Point.fromJSON(this,r,e)},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){for(var t=this._endoWnafT1,d=this._endoWnafT2,i=0;ih;h++)t[h]=null,d[h]=null;return o},inherits(Point,Base.BasePoint),Point.prototype._getBeta=function(){function r(r){return d.point(r.x.redMul(d.endo.beta),r.y)}if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var d=this.curve;e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},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()?"":""},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.precomputed&&this.precomputed.doubles?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.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){function e(r){return r.neg()}if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var d=this.precomputed;t.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(e)},doubles:d.doubles&&{step:d.doubles.step,step:d.doubles.points.map(e)}}}return t},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r},inherits(JPoint,Base.BasePoint),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(),p=h.redMul(s),l=d.redMul(h),a=o.redSqr().redIAdd(p).redISub(l).redISub(l),b=o.redMul(l.redISub(a)).redISub(n.redMul(p)),f=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(a,b,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),p=t.redMul(o),l=s.redSqr().redIAdd(h).redISub(p).redISub(p),a=s.redMul(p.redISub(l)).redISub(i.redMul(h)),b=this.z.redMul(u);return this.curve.jpoint(l,a,b)},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;r>t;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;r>t;t++){var p=n.redSqr(),l=h.redSqr(),a=l.redSqr(),b=p.redAdd(p).redIAdd(p).redIAdd(d.redMul(o)),f=n.redMul(l),c=b.redSqr().redISub(f.redAdd(f)),S=f.redISub(c),v=b.redMul(S);v=v.redIAdd(v).redISub(a);var I=h.redMul(s);r>t+1&&(o=o.redMul(a)),n=c,s=I,h=v}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(){if(this.zOne){var r=this.x.redSqr(),e=this.y.redSqr(),t=e.redSqr(),d=this.x.redAdd(e).redSqr().redISub(r).redISub(t);d=d.redIAdd(d);var i=r.redAdd(r).redIAdd(r),n=i.redSqr().redISub(d).redISub(d),u=t.redIAdd(t);u=u.redIAdd(u),u=u.redIAdd(u);var s=n,o=i.redMul(d.redISub(n)).redISub(u),h=this.y.redAdd(this.y)}else{var p=this.x.redSqr(),l=this.y.redSqr(),a=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(p).redISub(a);b=b.redIAdd(b);var f=p.redAdd(p).redIAdd(p),c=f.redSqr(),S=a.redIAdd(a);S=S.redIAdd(S),S=S.redIAdd(S);var s=c.redISub(b).redISub(b),o=f.redMul(b.redISub(s)).redISub(S),h=this.y.redMul(this.z);h=h.redIAdd(h)}return this.curve.jpoint(s,o,h)},JPoint.prototype._threeDbl=function(){if(this.zOne){var r=this.x.redSqr(),e=this.y.redSqr(),t=e.redSqr(),d=this.x.redAdd(e).redSqr().redISub(r).redISub(t);d=d.redIAdd(d);var i=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),n=i.redSqr().redISub(d).redISub(d),u=n,s=t.redIAdd(t);s=s.redIAdd(s),s=s.redIAdd(s);var o=i.redMul(d.redISub(n)).redISub(s),h=this.y.redAdd(this.y)}else{var p=this.z.redSqr(),l=this.y.redSqr(),a=this.x.redMul(l),b=this.x.redSub(p).redMul(this.x.redAdd(p));b=b.redAdd(b).redIAdd(b);var f=a.redIAdd(a);f=f.redIAdd(f);var c=f.redAdd(f),u=b.redSqr().redISub(c),h=this.y.redAdd(this.z).redSqr().redISub(l).redISub(p),S=l.redSqr();S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var o=b.redMul(f.redISub(u)).redISub(S)}return this.curve.jpoint(u,o,h)},JPoint.prototype._dbl=function(){var r=this.curve.a,e=(this.curve.tinv,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);o=o.redIAdd(o);var h=o.redMul(u),p=s.redSqr().redISub(h.redAdd(h)),l=h.redISub(p),a=u.redSqr();a=a.redIAdd(a),a=a.redIAdd(a),a=a.redIAdd(a);var b=s.redMul(l).redISub(a),f=t.redAdd(t).redMul(d);return this.curve.jpoint(p,b,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);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(n);var s=u.redSqr(),o=d.redIAdd(d);o=o.redIAdd(o),o=o.redIAdd(o),o=o.redIAdd(o);var h=i.redIAdd(u).redSqr().redISub(n).redISub(s).redISub(o),p=e.redMul(h);p=p.redIAdd(p),p=p.redIAdd(p);var l=this.x.redMul(s).redISub(p);l=l.redIAdd(l),l=l.redIAdd(l);var a=this.y.redMul(h.redMul(o.redISub(h)).redISub(u.redMul(s)));a=a.redIAdd(a),a=a.redIAdd(a),a=a.redIAdd(a);var b=this.z.redAdd(u).redSqr().redISub(t).redISub(s);return this.curve.jpoint(l,a,b)},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.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],62:[function(require,module,exports){function PresetCurve(f){this.curve="short"===f.type?new elliptic.curve.short(f):"edwards"===f.type?new elliptic.curve.edwards(f):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 d=new PresetCurve(e);return Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,value:d}),d}})}var curves=exports,assert=require("assert"),hash=require("hash.js"),bn=require("bn.js"),elliptic=require("../elliptic");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("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",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"]}),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",{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"]]}}]}) +},{"../elliptic":56,assert:28,"bn.js":69,"hash.js":70}],63:[function(require,module,exports){function EC(t){return this instanceof EC?("string"==typeof t&&(t=elliptic.curves[t]),t instanceof elliptic.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new EC(t)}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,KeyPair=require("./key"),Signature=require("./signature");module.exports=EC,EC.prototype.keyPair=function(t,e){return new KeyPair(this,t,e)},EC.prototype.genKeyPair=function(t){t||(t={});for(var e=new elliptic.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||elliptic.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new bn(2));;){var r=new bn(e.generate(n));if(!(r.cmp(i)>0))return r.iaddn(1),this.keyPair(r)}},EC.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.shrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},EC.prototype.sign=function(t,e,n){e=this.keyPair(e,"hex"),t=this._truncateToN(new bn(t,16)),n||(n={});for(var i=this.n.byteLength(),r=e.getPrivate().toArray(),h=r.length;21>h;h++)r.unshift(0);for(var s=t.toArray(),h=s.length;i>h;h++)s.unshift(0);for(var u=new elliptic.hmacDRBG({hash:this.hash,entropy:r,nonce:s}),a=this.n.sub(new bn(1));;){var c=new bn(u.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(a)>=0)){var o=this.g.mul(c);if(!o.isInfinity()){var p=o.getX().mod(this.n);if(0!==p.cmpn(0)){var v=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t)).mod(this.n);if(0!==v.cmpn(0))return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v)),new Signature(p,v)}}}}},EC.prototype.verify=function(t,e,n){t=this._truncateToN(new bn(t,16)),n=this.keyPair(n,"hex"),e=new Signature(e,"hex");var i=e.r,r=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var h=r.invm(this.n),s=h.mul(t).mod(this.n),u=h.mul(i).mod(this.n),a=this.g.mulAdd(s,n.getPublic(),u);return a.isInfinity()?!1:0===a.getX().mod(this.n).cmp(i)}},{"../../elliptic":56,"./key":64,"./signature":65,assert:28,"bn.js":69}],64:[function(require,module,exports){function KeyPair(t,i,e){return i instanceof KeyPair?i:e instanceof KeyPair?e:(i||(i=e,e=null),null!==i&&"object"==typeof i&&(i.x?(e=i,i=null):(i.priv||i.pub)&&(e=i.pub,i=i.priv)),this.ec=t,this.priv=null,this.pub=null,void(this._importPublicHex(i,e)||("hex"===e&&(e=null),i&&this._importPrivate(i),e&&this._importPublic(e))))}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils;module.exports=KeyPair,KeyPair.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,i){if(this.pub||(this.pub=this.ec.g.mul(this.priv)),"string"==typeof t&&(i=t,t=null),!i)return this.pub;for(var e=this.ec.curve.p.byteLength(),r=this.pub.getX().toArray(),n=r.length;e>n;n++)r.unshift(0);if(t)var u=[this.pub.getY().isEven()?2:3].concat(r);else{for(var s=this.pub.getY().toArray(),n=s.length;e>n;n++)s.unshift(0);var u=[4].concat(r,s)}return utils.encode(u,i)},KeyPair.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16):this.priv},KeyPair.prototype._importPrivate=function(t){this.priv=new bn(t,16),this.priv=this.priv.mod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(t){this.pub=this.ec.curve.point(t.x,t.y)},KeyPair.prototype._importPublicHex=function(t,i){t=utils.toArray(t,i);var e=this.ec.curve.p.byteLength();if(4===t[0]&&t.length-1===2*e)this.pub=this.ec.curve.point(t.slice(1,1+e),t.slice(1+e,1+2*e));else{if(2!==t[0]&&3!==t[0]||t.length-1!==e)return!1;this.pub=this.ec.curve.pointFromX(3===t[0],t.slice(1,1+e))}return!0},KeyPair.prototype.derive=function(t){return t.mul(this.priv).getX()},KeyPair.prototype.sign=function(t){return this.ec.sign(t,this)},KeyPair.prototype.verify=function(t,i){return this.ec.verify(t,i,this)},KeyPair.prototype.inspect=function(){return""}},{"../../elliptic":56,assert:28,"bn.js":69}],65:[function(require,module,exports){function Signature(t,r){return t instanceof Signature?t:void(this._importDER(t,r)||(assert(t&&r,"Signature without r or s"),this.r=new bn(t,16),this.s=new bn(r,16)))}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils;module.exports=Signature,Signature.prototype._importDER=function(t,r){if(t=utils.toArray(t,r),t.length<6||48!==t[0]||2!==t[2])return!1;var e=t[1];if(1+e>t.length)return!1;var n=t[3];if(n>=128)return!1;if(4+n+2>=t.length)return!1;if(2!==t[4+n])return!1;var i=t[5+n];return i>=128?!1:4+n+2+i>t.length?!1:(this.r=new bn(t.slice(4,4+n)),this.s=new bn(t.slice(4+n+2,4+n+2+i)),!0)},Signature.prototype.toDER=function(t){var r=this.r.toArray(),e=this.s.toArray();128&r[0]&&(r=[0].concat(r)),128&e[0]&&(e=[0].concat(e));var n=r.length+e.length+4,i=[48,n,2,r.length];return i=i.concat(r,[2,e.length],e),utils.encode(i,t)}},{"../../elliptic":56,assert:28,"bn.js":69}],66:[function(require,module,exports){function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils.toArray(t.entropy,t.entropyEnc),i=utils.toArray(t.nonce,t.nonceEnc),s=utils.toArray(t.pers,t.persEnc);assert(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,s)}var assert=require("assert"),hash=require("hash.js"),elliptic=require("../elliptic"),utils=elliptic.utils;module.exports=HmacDRBG,HmacDRBG.prototype._init=function(t,e,i){var s=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this.reseed=1},HmacDRBG.prototype.generate=function(t,e,i,s){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(s=i,i=e,e=null),i&&(i=utils.toArray(i,s),this._update(i));for(var h=[];h.length>8,i=255&a;s?n.push(s,i):n.push(i)}else for(var t=0;t=0;){var s;if(a.isOdd()){var i=a.andln(t-1);s=i>(t>>1)-1?(t>>1)-i:i,a.isubn(s)}else s=0;n.push(s);for(var o=0!==a.cmpn(0)&&0===a.andln(t-1)?e+1:1,u=1;o>u;u++)n.push(0);a.ishrn(o)}return n}function getJSF(r,e){var n=[[],[]];r=r.clone(),e=e.clone();for(var t=0,a=0;r.cmpn(-t)>0||e.cmpn(-a)>0;){var s=r.andln(3)+t&3,i=e.andln(3)+a&3;3===s&&(s=-1),3===i&&(i=-1);var o;if(0===(1&s))o=0;else{var u=r.andln(7)+t&7;o=3!==u&&5!==u||2!==i?s:-s}n[0].push(o);var l;if(0===(1&i))l=0;else{var u=e.andln(7)+a&7;l=3!==u&&5!==u||2!==s?i:-i}n[1].push(l),2*t===o+1&&(t=1-t),2*a===l+1&&(a=1-a),r.ishrn(1),e.ishrn(1)}return n}var assert=require("assert"),bn=require("bn.js"),utils=exports;utils.toArray=toArray,utils.toHex=toHex,utils.encode=function(r,e){return"hex"===e?toHex(r):r},utils.zero2=zero2,utils.getNAF=getNAF,utils.getJSF=getJSF},{assert:28,"bn.js":69}],69:[function(require,module,exports){function assert(t,r){if(!t)throw new Error(r||"Assertion failed")}function assertEqual(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}function inherits(t,r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}function BN(t,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,void(null!==t&&this._init(t||0,r||10)))}function zero6(t){return 5===t.length?"0"+t:4===t.length?"00"+t:3===t.length?"000"+t:2===t.length?"0000"+t:1===t.length?"00000"+t:t}function zero14(t){return 13===t.length?"0"+t:12===t.length?"00"+t:11===t.length?"000"+t:10===t.length?"0000"+t:9===t.length?"00000"+t:8===t.length?"000000"+t:7===t.length?"0000000"+t:6===t.length?"00000000"+t:5===t.length?"000000000"+t:4===t.length?"0000000000"+t:3===t.length?"00000000000"+t:2===t.length?"000000000000"+t:1===t.length?"0000000000000"+t:t}function MPrime(t,r){this.name=t,this.p=new BN(r,16),this.n=this.p.bitLength(),this.k=new BN(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var r=BN._prime(t);this.m=r.p,this.prime=r}else this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new BN(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.invm(this.m),this.minv=this.rinv.mul(this.r).sub(new BN(1)).div(this.m).neg().mod(this.r)}module.exports=BN,BN.BN=BN,BN.wordSize=26,BN.prototype._init=function(t,r){if("number"==typeof t)return 0>t&&(this.sign=!0,t=-t),this.words=[67108863&t],void(this.length=1);if("object"==typeof t){assert("number"==typeof t.length),this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var e=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[n]|=e<>>26-s&67108863,s+=24,s>=26&&(s-=26,n++)}return this.strip()}"hex"===r&&(r=16),assert(16>=r),t=t.toString().replace(/\s+/g,"");var h=0;"-"===t[0]&&h++,16===r?this._parseHex(t,h):this._parseBase(t,r,h),"-"===t[0]&&(this.sign=!0),this.strip()},BN.prototype._parseHex=function(t,r){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var i=0;i=r;i-=6){var e=parseInt(t.slice(i,i+6),16);this.words[n]|=e<>>26-s&4194303,s+=24,s>=26&&(s-=26,n++)}if(i+6!==r){var e=parseInt(t.slice(r,i+6),16);this.words[n]|=e<>>26-s&4194303}this.strip()},BN.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var s=0,n=1,e=0,h=null,o=i;o=d?0|d:d>="a"?d.charCodeAt(0)-97+10:d.charCodeAt(0)-65+10,s*=r,s+=f,n*=r,e++,n>1048575&&(assert(67108863>=n),h||(h=new BN(n)),this.mul(h).copy(this),this.iadd(new BN(s)),s=0,n=1,e=0)}0!==e&&(this.mul(new BN(n)).copy(this),this.iadd(new BN(s)))},BN.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},BN.prototype.inspect=function(){return(this.red?""};var div10=new BN(null);div10.words=[8011776,1490116],div10.length=2,BN.prototype.toString=function(t){if(t=t||10,16===t||"hex"===t){for(var r="",i=0,s=0,n=0;n>>24-i&16777215,r=0!==s||n!==this.length-1?zero6(h)+r:h+r,i+=2,i>=26&&(i-=26,n--)}return 0!==s&&(r=s.toString(16)+r),this.sign&&(r="-"+r),r}if(10===t){var r="",o=this.clone();for(o.sign=!1;0!==o.cmpn(0);){var f=o.modn(1e6);o=o.idivn(1e6),r=0!==o.cmpn(0)?zero6(f+"")+r:f+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}assert(!1,"Only 16 and 10 base are supported")},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toArray=function(){this.strip();var t=new Array(this.byteLength());t[0]=0;for(var r=this.clone(),i=0;0!==r.cmpn(0);i++){var s=r.andln(255);r.ishrn(8),t[t.length-i-1]=s}return t},BN.prototype._countBits=function(t){return t>=33554432?26:t>=16777216?25:t>=8388608?24:t>=4194304?23:t>=2097152?22:t>=1048576?21:t>=524288?20:t>=262144?19:t>=131072?18:t>=65536?17:t>=32768?16:t>=16384?15:t>=8192?14:t>=4096?13:t>=2048?12:t>=1024?11:t>=512?10:t>=256?9:t>=128?8:t>=64?7:t>=32?6:t>=16?5:t>=8?4:t>=4?3:t>=2?2:t>=1?1:0},BN.prototype.bitLength=function(){var t=0,r=this.words[this.length-1],t=this._countBits(r);return 26*(this.length-1)+t},BN.prototype.byteLength=function(){this.words[this.length-1];return Math.ceil(this.bitLength()/8)},BN.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},BN.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var r=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var r=this.isub(t);return t.sign=!0,r._normSign()}var i,s;this.length>t.length?(i=this,s=t):(i=t,s=this);for(var n=0,e=0;e>>26}for(;0!==n&&e>>26}if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function(t){if(t.sign){t.sign=!1;var r=this.iadd(t);return t.sign=!0,r._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var i=this.cmp(t);if(0===i)return this.sign=!1,this.length=1,this.words[0]=0,this;if(i>0)var s=this,n=t;else var s=t,n=this;for(var e=0,h=0;hr?(r+=67108864,e=1):e=0,this.words[h]=r}for(;0!==e&&hr?(r+=67108864,e=1):e=0,this.words[h]=r}if(0===e&&h>>26,e=67108863&i,h=Math.min(s,t.length-1),o=Math.max(0,s-this.length+1);h>=o;o++){var f=s-o,d=this.words[f],u=t.words[o],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}r.words[s]=e,i=n}return 0!==i?r.words[s]=i:r.length--,r.strip()},BN.prototype.mul=function(t){var r=new BN(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},BN.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var r=this.length,i=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var s=this.length-2;s>=0;s--){for(var n=0,e=0,h=Math.min(s,i-1),o=Math.max(0,s-r+1);h>=o;o++){var f=s-o,d=this.words[f],u=t.words[o],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}this.words[s]=e,this.words[s+1]+=n,n=0}for(var n=0,f=1;f>>26}return this.strip()},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.mul(this)},BN.prototype.ishln=function(t){assert("number"==typeof t&&t>=0);{var r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;this.clone()}if(0!==r){for(var n=0,e=0;e>>26-r}n&&(this.words[e]=n,this.length++)}if(0!==i){for(var e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(var e=0;i>e;e++)this.words[e]=0;this.length+=i}return this.strip()},BN.prototype.ishrn=function(t,r,i){assert("number"==typeof t&&t>=0),r=r?(r-r%26)/26:0;var s=t%26,n=Math.min((t-s)/26,this.length),e=67108863^67108863>>>s<o;o++)h.words[o]=this.words[o];h.length=n}if(0===n);else if(this.length>n){this.length-=n;for(var o=0;o=0&&(0!==f||o>=r);o--){var d=this.words[o];this.words[o]=f<<26-s|d>>>s,f=d&e}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),i?{hi:this,lo:h}:this},BN.prototype.shln=function(t){return this.clone().ishln(t)},BN.prototype.shrn=function(t){return this.clone().ishrn(t)},BN.prototype.imaskn=function(t){assert("number"==typeof t&&t>=0);var r=t%26,i=(t-r)/26;if(assert(!this.sign,"imaskn works only with positive numbers"),0!==r&&i++,this.length=Math.min(i,this.length),0!==r){var s=67108863^67108863>>>r<t)return this.isubn(t);this.words[0]+=t;for(var r=0;r=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},BN.prototype.isubn=function(t){if(assert("number"==typeof t),assert(this.cmpn(t)>=0,"Sign change is not supported in isubn"),0>t)return this.iaddn(-t);this.words[0]-=t;for(var r=0;rn.length;){var h=67108864*s.words[s.length-1]+s.words[s.length-2],o=h/n.words[n.length-1],f=o/67108864|0,d=67108863&o;o=new BN(null),o.words=[d,f],o.length=2;var i=26*(s.length-n.length-1);if(e){var u=o.shln(i);s.sign?e.isub(u):e.iadd(u)}o=o.mul(n).ishln(i),s.sign?s.iadd(o):s.isub(o)}for(;s.ucmp(n)>=0;){var h=s.words[s.length-1],o=new BN(h/n.words[n.length-1]|0),i=26*(s.length-n.length);if(e){var u=o.shln(i);s.sign?e.isub(u):e.iadd(u)}o=o.mul(n).ishln(i),s.sign?s.iadd(o):s.isub(o)}return s.sign&&(e&&e.isubn(1),s.iadd(n)),{div:e?e:null,mod:s}},BN.prototype.divmod=function(t,r){if(assert(0!==t.cmpn(0)),this.sign&&!t.sign){var i,s,n=this.neg().divmod(t,r);return"mod"!==r&&(i=n.div.neg()),"div"!==r&&(s=0===n.mod.cmpn(0)?n.mod:t.sub(n.mod)),{div:i,mod:s}}if(!this.sign&&t.sign){var i,n=this.divmod(t.neg(),r);return"mod"!==r&&(i=n.div.neg()),{div:i,mod:n.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),r):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===r?{div:this.divn(t.words[0]),mod:null}:"mod"===r?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,r)},BN.prototype.div=function(t){return this.divmod(t,"div").div},BN.prototype.mod=function(t){return this.divmod(t,"mod").mod},BN.prototype.divRound=function(t){var r=this.divmod(t);if(0===r.mod.cmpn(0))return r.div;var i=r.div.sign?r.mod.isub(t):r.mod,s=t.shrn(1),n=t.andln(1),e=i.cmp(s);return 0>e||1===n&&0===e?r.div:r.div.sign?r.div.isubn(1):r.div.iaddn(1)},BN.prototype.modn=function(t){assert(67108863>=t);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+this.words[s])%t;return i},BN.prototype.idivn=function(t){assert(67108863>=t);for(var r=0,i=this.length-1;i>=0;i--){var s=this.words[i]+67108864*r;this.words[i]=s/t|0,r=s%t}return this.strip()},BN.prototype.divn=function(t){return this.clone().idivn(t)},BN.prototype._egcd=function(t,r){assert(!r.sign),assert(0!==r.cmpn(0));var i=this,s=r.clone();i=i.sign?i.mod(r):i.clone();for(var n=new BN(0);i.cmpn(1)>0&&s.cmpn(1)>0;){for(;i.isEven();)i.ishrn(1),t.isEven()?t.ishrn(1):t.iadd(r).ishrn(1);for(;s.isEven();)s.ishrn(1),n.isEven()?n.ishrn(1):n.iadd(r).ishrn(1);i.cmp(s)>=0?(i.isub(s),t.isub(n)):(s.isub(i),n.isub(t))}return 0===i.cmpn(1)?t:n},BN.prototype.invm=function(t){return this._egcd(new BN(1),t).mod(t)},BN.prototype.isEven=function(){return 0===(1&this.words[0])},BN.prototype.isOdd=function(){return 1===(1&this.words[0])},BN.prototype.andln=function(t){return this.words[0]&t},BN.prototype.bincn=function(t){assert("number"==typeof t);var r=t%26,i=(t-r)/26,s=1<n;n++)this.words[n]=0;return this.words[i]|=s,this.length=i+1,this}for(var e=s,n=i;0!==e&&n>>26,h&=67108863,this.words[n]=h}return 0!==e&&(this.words[n]=e,this.length++),this},BN.prototype.cmpn=function(t){var r=0>t;if(r&&(t=-t),this.sign&&!r)return-1;if(!this.sign&&r)return 1;t&=67108863,this.strip();var i;if(this.length>1)i=1;else{var s=this.words[0];i=s===t?0:t>s?-1:1}return this.sign&&(i=-i),i},BN.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var r=this.ucmp(t);return this.sign?-r:r},BN.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;i--){var s=this.words[i],n=t.words[i];if(s!==n){n>s?r=-1:s>n&&(r=1);break}}return r},BN.red=function(t){return new Red(t)},BN.prototype.toRed=function(t){return assert(!this.red,"Already a number in reduction context"),assert(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(t){return this.red=t,this},BN.prototype.forceRed=function(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function(t){var r,i=t;do{var s=i.ishrn(this.n,0,this.tmp);i=this.imulK(s.hi),i=i.iadd(s.lo),r=i.bitLength()}while(r>this.n);var n=r0?i.isub(this.p):i.strip(),i},MPrime.prototype.imulK=function(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=t.length-3;r>=0;r--){var i=t.words[r],s=64*i,n=977*i;s+=n/67108864|0;var e=s/67108864|0;s&=67108863,n&=67108863,t.words[r+2]+=e,t.words[r+1]+=s,t.words[r]=n}var i=t.words[t.length-2];return i>=67108864&&(t.words[t.length-1]+=i>>>26,t.words[t.length-2]=67108863&i),0===t.words[t.length-1]&&t.length--,0===t.words[t.length-1]&&t.length--,t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function(t){for(var r=0,i=0;i>>=26,t.words[i]=n,r=s}return 0!==r&&(t.words[t.length++]=r),t},BN._prime=function t(r){if(primes[r])return primes[r];var t;if("k256"===r)t=new K256;else if("p224"===r)t=new P224;else if("p192"===r)t=new P192;else{if("p25519"!==r)throw new Error("Unknown prime "+r);t=new P25519}return primes[r]=t,t},Red.prototype._verify1=function(t){assert(!t.sign,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function(t,r){assert(!t.sign&&!r.sign,"red works only with positives"),assert(t.red&&t.red===r.red,"red works only with red numbers")},Red.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},Red.prototype.neg=function(t){var r=t.clone();return r.sign=!r.sign,r.iadd(this.m)._forceRed(this)},Red.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Red.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Red.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Red.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Red.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.shln(r))},Red.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Red.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Red.prototype.isqr=function(t){return this.imul(t,t)},Red.prototype.sqr=function(t){return this.mul(t,t)},Red.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var r=this.m.andln(3);if(assert(r%2===1),3===r){var i=this.m.add(new BN(1)).ishrn(2),s=this.pow(t,i);return s}for(var n=this.m.subn(1),e=0;0!==n.cmpn(0)&&0===n.andln(1);)e++,n.ishrn(1);assert(0!==n.cmpn(0));var h=new BN(1).toRed(this),o=h.redNeg(),f=this.m.subn(1).ishrn(1),d=this.m.bitLength();for(d=new BN(2*d*d).toRed(this);0!==this.pow(d,f).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,n),s=this.pow(t,n.addn(1).ishrn(1)),l=this.pow(t,n),p=e;0!==l.cmp(h);){for(var a=l,g=0;0!==a.cmp(h);g++)a=a.redSqr();assert(p>g);var m=this.pow(u,new BN(1).ishln(p-g-1));s=s.redMul(m),u=m.redSqr(),l=l.redMul(u),p=g}return s},Red.prototype.invm=function(t){var r=t._egcd(new BN(1),this.m);return r.sign?(r.sign=!1,this.imod(r).redNeg()):this.imod(r)},Red.prototype.pow=function(t,r){for(var i=[],s=r.clone();0!==s.cmpn(0);)i.push(s.andln(1)),s.ishrn(1);for(var n=t,e=0;e=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},Mont.prototype.mul=function(t,r){if(0===t.cmpn(0)||0===r.cmpn(0))return new BN(0)._forceRed(this);var i=t.mul(r),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).ishrn(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)},Mont.prototype.invm=function(t){var r=this.imod(t.invm(this.m).mul(this.r2));return r._forceRed(this)}},{}],70:[function(require,module,exports){var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.ripemd160=hash.ripemd.ripemd160},{"./hash/common":71,"./hash/hmac":72,"./hash/ripemd":73,"./hash/sha":74,"./hash/utils":75}],71:[function(require,module,exports){function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.endian="big"}var hash=require("../hash"),utils=hash.utils,assert=utils.assert;exports.BlockHash=BlockHash,BlockHash.prototype.update=function(t,i){if(t=utils.toArray(t,i),this.pending=this.pending?this.pending.concat(t):t,this.pendingTotal+=t.length,this.pending.length>=this.blockSize/8){t=this.pending;var n=t.length%(this.blockSize/8);this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=utils.join32(t.slice(0,t.length-n),this.endian);for(var s=0;se;e++)s[e]=0;return t<<=3,"big"===this.endian?(s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=t>>>24&255,s[e++]=t>>>16&255,s[e++]=t>>>8&255,s[e++]=255&t):(s[e++]=255&t,s[e++]=t>>>8&255,s[e++]=t>>>16&255,s[e++]=t>>>24&255,s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=0),s}},{"../hash":70}],72:[function(require,module,exports){function Hmac(t,s,e){return this instanceof Hmac?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,void this._init(utils.toArray(s,e))):new Hmac(t,s,e)}var hmac=exports,hash=require("../hash"),utils=hash.utils,assert=utils.assert;module.exports=Hmac,Hmac.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),assert(t.length<=this.blockSize);for(var s=t.length;s=t?s^h^i:31>=t?s&h|~s&i:47>=t?(s|~h)^i:63>=t?s&i|h&~i:s^(h|~i)}function K(t){return 15>=t?0:31>=t?1518500249:47>=t?1859775393:63>=t?2400959708:2840853838}function Kh(t){return 15>=t?1352829926:31>=t?1548603684:47>=t?1836072691:63>=t?2053994217:0}var hash=require("../hash"),utils=hash.utils,rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=hash.common.BlockHash;utils.inherits(RIPEMD160,BlockHash),exports.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.prototype._update=function(t){for(var h=this.h[0],i=this.h[1],u=this.h[2],l=this.h[3],o=this.h[4],e=h,n=i,m=u,a=l,c=o,_=0;80>_;_++){var D=sum32(rotl32(sum32_4(h,f(_,i,u,l),t[r[_]],K(_)),s[_]),o);h=o,o=l,l=rotl32(u,10),u=i,i=D,D=sum32(rotl32(sum32_4(e,f(79-_,n,m,a),t[rh[_]],Kh(_)),sh[_]),c),e=c,c=a,a=rotl32(m,10),m=n,n=D}D=sum32_3(this.h[1],u,a),this.h[1]=sum32_3(this.h[2],l,c),this.h[2]=sum32_3(this.h[3],o,e),this.h[3]=sum32_3(this.h[4],h,n),this.h[4]=sum32_3(this.h[0],i,m),this.h[0]=D},RIPEMD160.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":70}],74:[function(require,module,exports){function SHA256(){return this instanceof SHA256?(BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],void(this.k=sha256_K)):new SHA256}function SHA224(){return this instanceof SHA224?(SHA256.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new SHA224}function ch32(t,s,h){return t&s^~t&h}function maj32(t,s,h){return t&s^t&h^s&h}function s0_256(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}function s1_256(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}function g0_256(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}function g1_256(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}var hash=require("../hash"),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.prototype._update=function(t){for(var s=new Array(64),h=0;16>h;h++)s[h]=t[h];for(;h>8,i=255&o;u?e.push(u,i):e.push(i)}else for(var n=0;n>>24|o>>>8&65280|o<<8&16711680|(255&o)<<24,0>o&&(o+=4294967296)),e+=zero8(o.toString(16))}return e}function zero2(t){return 1===t.length?"0"+t:t}function zero8(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function join32(t,r){assert(t.length%4===0);for(var e=new Array(t.length/4),n=0,o=0;nu&&(u+=4294967296),e[n]=u}return e}function split32(t,r){for(var e=new Array(4*t.length),n=0,o=0;n>>24,e[o+1]=u>>>16&255,e[o+2]=u>>>8&255,e[o+3]=255&u):(e[o+3]=u>>>24,e[o+2]=u>>>16&255,e[o+1]=u>>>8&255,e[o]=255&u)}return e}function rotr32(t,r){return t>>>r|t<<32-r}function rotl32(t,r){return t<>>32-r}function sum32(t,r){var e=t+r&4294967295;return 0>e&&(e+=4294967296),e}function sum32_3(t,r,e){var n=t+r+e&4294967295;return 0>n&&(n+=4294967296),n}function sum32_4(t,r,e,n){var o=t+r+e+n&4294967295;return 0>o&&(o+=4294967296),o}function sum32_5(t,r,e,n,o){var u=t+r+e+n+o&4294967295;return 0>u&&(u+=4294967296),u}function assert(t,r){if(!t)throw new Error(r||"Assertion failed")}var utils=exports;utils.toArray=toArray,utils.toHex=toHex,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits="function"==typeof Object.create?function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,r){t.super_=r;var e=function(){};e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t}},{}],76:[function(require,module,exports){module.exports=require(39)},{}],77:[function(require,module,exports){module.exports={name:"elliptic",version:"0.15.7",description:"EC cryptography",main:"lib/elliptic.js",scripts:{test:"mocha --reporter=spec test/*-test.js"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"fedor@indutny.com"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",mocha:"^1.18.2"},dependencies:{"bn.js":"^0.11.6","hash.js":"^0.2.0",inherits:"^2.0.1","uglify-js":"^2.4.13"},_id:"elliptic@0.15.7",_shasum:"33a3cfb88eeeeb04f0bbd06040f2cfc2fba93d2a",_from:"elliptic@=0.15.7",_npmVersion:"1.4.9",_npmUser:{name:"indutny",email:"fedor@indutny.com"},maintainers:[{name:"indutny",email:"fedor@indutny.com"}],dist:{shasum:"33a3cfb88eeeeb04f0bbd06040f2cfc2fba93d2a",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-0.15.7.tgz"},directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-0.15.7.tgz",readme:"ERROR: No README data found!"}},{}],78:[function(require,module,exports){var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.ripemd160=hash.ripemd.ripemd160},{"./hash/common":79,"./hash/hmac":80,"./hash/ripemd":81,"./hash/sha":82,"./hash/utils":83}],79:[function(require,module,exports){arguments[4][71][0].apply(exports,arguments)},{"../hash":78}],80:[function(require,module,exports){arguments[4][72][0].apply(exports,arguments)},{"../hash":78}],81:[function(require,module,exports){arguments[4][73][0].apply(exports,arguments)},{"../hash":78}],82:[function(require,module,exports){function SHA256(){return this instanceof SHA256?(BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],void(this.k=sha256_K)):new SHA256}function SHA224(){return this instanceof SHA224?(SHA256.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new SHA224}function SHA1(){return this instanceof SHA1?(BlockHash.call(this),void(this.h=[1732584193,4023233417,2562383102,271733878,3285377520])):new SHA1}function ch32(t,h,s){return t&h^~t&s}function maj32(t,h,s){return t&h^t&s^h&s}function p32(t,h,s){return t^h^s}function s0_256(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}function s1_256(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}function g0_256(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}function g1_256(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}function ft_1(t,h,s,i){return 0===t?ch32(h,s,i):1===t||3===t?p32(h,s,i):2===t?maj32(h,s,i):void 0}var hash=require("../hash"),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],sha1_K=[1518500249,1859775393,2400959708,3395469782];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.prototype._update=function(t){for(var h=new Array(64),s=0;16>s;s++)h[s]=t[s];for(;ss;s++)h[s]=t[s];for(;s>8,o=255&i;u?n.push(u,o):n.push(o)}else for(var e=0;e>>24|i>>>8&65280|i<<8&16711680|(255&i)<<24,0>i&&(i+=4294967296)),n+=zero8(i.toString(16))}return n}function zero2(r){return 1===r.length?"0"+r:r}function zero8(r){return 7===r.length?"0"+r:6===r.length?"00"+r:5===r.length?"000"+r:4===r.length?"0000"+r:3===r.length?"00000"+r:2===r.length?"000000"+r:1===r.length?"0000000"+r:r}function join32(r,t){assert(r.length%4===0);for(var n=new Array(r.length/4),e=0,i=0;eu&&(u+=4294967296),n[e]=u}return n}function split32(r,t){for(var n=new Array(4*r.length),e=0,i=0;e>>24,n[i+1]=u>>>16&255,n[i+2]=u>>>8&255,n[i+3]=255&u):(n[i+3]=u>>>24,n[i+2]=u>>>16&255,n[i+1]=u>>>8&255,n[i]=255&u)}return n}function rotr32(r,t){return r>>>t|r<<32-t}function rotl32(r,t){return r<>>32-t}function sum32(r,t){var n=r+t&4294967295;return 0>n&&(n+=4294967296),n}function sum32_3(r,t,n){var e=r+t+n&4294967295;return 0>e&&(e+=4294967296),e}function sum32_4(r,t,n,e){var i=r+t+n+e&4294967295;return 0>i&&(i+=4294967296),i}function sum32_5(r,t,n,e,i){var u=r+t+n+e+i&4294967295;return 0>u&&(u+=4294967296),u}function assert(r,t){if(!r)throw new Error(t||"Assertion failed")}var utils=exports,inherits=require("inherits");utils.toArray=toArray,utils.toHex=toHex,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits=inherits},{inherits:84}],84:[function(require,module,exports){module.exports=require(39)},{}],85:[function(require,module,exports){(function(n){function t(n,t){this.data=n,t||"string"!=typeof n?("undefined"==typeof this.encodings[t]&&(t="binary"),this.converters=this.encodings[t].converters,this._encoding=this.encodings[t]._encoding):(t="base58",this.converters=this.encodings[t].converters,this._encoding=this.encodings[t]._encoding)}var i=require("../lib/Base58").base58Check;t.prototype.encoding=function(n){return n&&n!=this._encoding&&(this.data=this.as(n),this.converters=this.encodings[n].converters,this._encoding=this.encodings[n]._encoding),this._encoding},t.prototype.withEncoding=function(n){return new t(this.as(n),n)},t.prototype.as=function(n){if(!e[n])throw new Error("invalid encoding: "+n);return this.converters[n].call(this)},t.prototype._validate=function(){this.withEncoding("binary")},t.prototype.isValid=function(){try{return this.validate(),!0}catch(n){return!1}},t.prototype.validate=function(){this._validate()},t.prototype.toString=function(){return this.as("base58")},t.prototype.doAsBinary=function(n){var t=this.encoding();this.encoding("binary"),n.apply(this),this.encoding(t)};var e={binary:{converters:{binary:function(){var t=new n(this.data.length);return this.data.copy(t),t},base58:function(){return i.encode(this.data)},hex:function(){return this.data.toString("hex")}},_validate:function(){}},base58:{converters:{binary:function(){return i.decode(this.data)},hex:function(){return this.withEncoding("binary").as("hex")}}},hex:{converters:{binary:function(){return new n(this.data,"hex")},base58:function(){return this.withEncoding("binary").as("base58")}}}},r=function(){return this.data};for(var o in e)e.hasOwnProperty(o)&&(e[o].converters[o]||(e[o].converters[o]=r),e[o]._encoding=o);t.applyEncodingsTo=function(n){var t={};for(var i in e){var r=e[i],o=Object.create(n.prototype);for(var s in r)o[s]=r[s];t[i]=o}n.prototype.encodings=t},t.applyEncodingsTo(t),module.exports=t}).call(this,require("buffer").Buffer)},{"../lib/Base58":3,buffer:29}],86:[function(require,module,exports){(function(i){function t(e,n){t.super_.call(this,e,n),"number"==typeof e&&(this.data=new i(n.length+1),this.encoding("binary"),this.version(e),this.payload(n))}var e=(require("../lib/Base58").base58Check,require("util")),n=require("./EncodedData");e.inherits(t,n),n.applyEncodingsTo(t),t.prototype.version=function(i){return i||0===i?(this.doAsBinary(function(){this.data.writeUInt8(i,0)}),i):this.as("binary").readUInt8(0)},t.prototype.payload=function(i){return i?(this.doAsBinary(function(){i.copy(this.data,1)}),i):this.as("binary").slice(1)},module.exports=t}).call(this,require("buffer").Buffer)},{"../lib/Base58":3,"./EncodedData":85,buffer:29,util:51}],87:[function(require,module,exports){module.exports=require("./util")},{"./util":"ACyo5H"}],88:[function(require,module,exports){exports.curtime=function(){return Math.round(Date.now()/1e3)}},{}],"./util/util":[function(require,module,exports){module.exports=require("ACyo5H")},{}],ACyo5H:[function(require,module,exports){(function(e,r){function t(e){for(e=e.substr(0,8);e.length<8;)e+="0";return e}function n(e){return i(e[1]).mul("100000000").add(t(e[2]))}function o(e){return i(t(e[1]))}function f(e){return i(e[1]).mul("100000000")}var u=require("crypto"),i=require("bignum"),s=require("binary"),a=require("bufferput"),c=require("buffertools"),l=require("../lib/sjcl");if(e.browser)var h=require("hash.js");{var p=exports.sha256=function(e){return new r(u.createHash("sha256").update(e).digest("binary"),"binary")},v=(exports.sha512=function(t){if(e.browser){var n=t.toString("hex"),o=l.codec.hex.toBits(n),f=l.hash.sha512.hash(o),i=l.codec.hex.fromBits(f),s=new r(i,"hex");return s}return new r(u.createHash("sha512").update(t).digest("binary"),"binary")},exports.sha512hmac=function(t,n){if(e.browser){var o=l.codec.hex.toBits(n.toString("hex")),f=l.codec.hex.toBits(t.toString("hex")),i=new l.misc.hmac(o,l.hash.sha512),s=i.encrypt(f),a=l.codec.hex.fromBits(s),c=new r(a,"hex");return c}var i=u.createHmac("sha512",n),h=i.update(t).digest();return h},exports.ripe160=function(t){if(!r.isBuffer(t))throw new Error("arg should be a buffer");return e.browser?new r(h.ripemd160().update(t).digest()):new r(u.createHash("rmd160").update(t).digest("binary"),"binary")}),w=(exports.sha1=function(e){return new r(u.createHash("sha1").update(e).digest("binary"),"binary")},exports.twoSha256=function(e){return p(p(e))},exports.sha256ripe160=function(e){return v(p(e))},exports.formatHash=function(e){var t=new r(10);return e.copy(t,0,22,32),c.reverse(t).toString("hex")},exports.formatHashFull=function(e){var t=new r(e.length);e.copy(t);var n=c.toHex(c.reverse(t));return n}),d=(exports.formatHashAlt=function(e){var r=w(e);return r=r.replace(/^0*/,""),r.substr(0,10)},exports.formatBuffer=function(e,t){null===t&&(t=10),(t>e.length||0===t)&&(t=e.length);var n=new r(t);e.copy(n,0,0,t);var o=c.toHex(n);return n.length=0&&(t[n]+=1,t[n]>=256&&(t[n]-=256),0===t[n]);n--);return t},exports.intToBuffer2C=function(e){var r=bytesNeededToStore(e),t=new a,n=e.toString(16),o="-"===n[0];n=n.replace("-","");for(var f=0;r>f;f++){var u=n.substring(n.length-2*(f+1),n.length-2*f);1===u.length&&(u="0"+u);var i=parseInt(u,16);t.word8(i)}var s=t.buffer();return o&&(s=c.reverse(s),s=negativeBuffer(s),s=c.reverse(s)),s};var g=function(e){var t;return 128&e[0]?(t=new r(e.length+1),e.copy(t,1),t[0]=0):t=e,t};exports.intToBufferSM=function(e){"number"==typeof e&&(e=i(e));var t,n,o=e.cmp(0);return o>0?(t=e.toBuffer(),n=g(t),n=c.reverse(n)):0==o?n=new r([]):(t=e.neg().toBuffer(),n=g(t),n[0]|=128,n=c.reverse(n)),n},exports.bufferSMToInt=function(e){if(!e.length)return i(0);if(e.length>4)throw new Error("Bigint cast overflow (> 4 bytes)");var t=new r(e.length);e.copy(t),t=c.reverse(t);var n=128&t[0];return n?(t[0]&=127,i.fromBuffer(t).neg()):i.fromBuffer(t)};var x=(exports.formatValue=function(e){for(var r=d(e).toString(),t=r.length>8?r.substr(0,r.length-8):"0",n=r.length>8?r.substr(r.length-8):r;n.length<8;)n="0"+n;for(n=n.replace(/0*$/,"");n.length<2;)n+="0";return t+"."+n},/^\s*(\d+)\.(\d+)/),b=/^\s*\.(\d+)/,B=/^\s*(\d+)/;exports.parseValue=function(e){"string"!=typeof e&&(e=e.toString());var r=e.match(x);return r?n(r):(r=e.match(b))?o(r):(r=e.match(B),r?f(r):void 0)};{var m=(exports.createSynchrotron=function(e){var r={};return function(t){var n=Array.prototype.slice.call(arguments),o=function(){n[0]=function(){r[t]&&(r[t].length?r[t].shift()():delete r[t])},e.apply(null,n)};r[t]?r[t].push(o):(r[t]=[],o())}},exports.decodeDiffBits=function(e,t){e=+e;for(var n=i(16777215&e),o=8*((e>>>24)-3);o-->0;)n=n.mul(2);if(t)return n;var f=n.toBuffer(),u=new r(32);return c.fill(u,0),f.copy(u,32-f.length),u}),y=(exports.encodeDiffBits=function(e){if(r.isBuffer(e))e=i.fromBuffer(e);else if("function"!=typeof e.toBuffer)throw new Error("Incorrect variable type for difficulty");var t=e.toBuffer("mpint"),n=t.length-4,o=n<<24;return n>=1&&(o|=t[4]<<16),n>=2&&(o|=t[5]<<8),n>=3&&(o|=t[6]),o},exports.calcDifficulty=function(e){r.isBuffer(e)||(e=m(e));var t=i.fromBuffer(e,{order:"forward"}),n=i.fromBuffer(S,{order:"forward"});return n.div(t).toNumber()},exports.reverseBytes32=function(e){if(e.length%4)throw new Error("Util.reverseBytes32(): Data length must be multiple of 4");for(var r=new a,t=s.parse(e);!t.eof();){var n=t.word32le("word").vars.word;r.word32be(n)}return r.buffer()},exports.getVarIntSize=function(e){return 253>e?1:65536>e?3:4294967296>e?5:9},exports.varIntBuf=function(e){var t=void 0;return 253>e?(t=new r(1),t.writeUInt8(e,0)):65536>e?(t=new r(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):4294967296>e?(t=new r(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=new r(9),t.writeUInt8(255,0),t.writeInt32LE(-1&e,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t});exports.varStrBuf=function(e){return r.concat([y(e.length),e])}}exports.NULL_HASH=c.fill(new r(32),0),exports.EMPTY_BUFFER=new r(0),exports.ZERO_VALUE=c.fill(new r(8),0);var I=new r("ffffffffffffffff","hex");exports.INT64_MAX=I,exports.COIN=1e8,exports.BIT=100;var S=exports.MAX_TARGET=new r("00000000FFFF0000000000000000000000000000000000000000000000000000","hex")}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer)},{"../lib/sjcl":17,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,bignum:9,binary:19,buffer:29,bufferput:"aXRuS6",buffertools:"fugeBw",crypto:33,"hash.js":78}]},{},[]);!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.bitauth=e()}}(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;o0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer"); +return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return""};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;iremaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||valuebuf.length)throw new TypeError("index out of range")}Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||valuebuf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;if(end=target.length)throw new TypeError("targetStart out of bounds");if(start<0||start>=source.length)throw new TypeError("sourceStart out of bounds");if(end<0||end>source.length)throw new TypeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start=this.length)throw new TypeError("start out of bounds");if(end<0||end>this.length)throw new TypeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/package.json b/package.json index 4ab72f2..c91e004 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "uglify-js": "~2.4.14", - "browserify": "~4.1.11", + "browserify": "=6.1.0", "chai": "=1.9.1", "mocha": "~1.20.1" } diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh index 4a2650e..46eaeec 100644 --- a/scripts/make-dist.sh +++ b/scripts/make-dist.sh @@ -1,11 +1,10 @@ cd node_modules/bitcore echo "Building browser bundle for bitcore..." node browser/build -s lib/Key,lib/SINKey,lib/SIN,util/util -echo "Building browser bundle for bitauth..." cd ../../ -node_modules/.bin/browserify lib/bitauth.js -s bitauth -x buffertools -i bitcore -o dist/bitauth.browser.js -echo "Compiling bitcore and bitauth..." -node_modules/.bin/uglifyjs node_modules/bitcore/browser/bundle.js dist/bitauth.browser.js -b -o dist/bitauth.browser.js -echo "Minifying bundle..." -node_modules/.bin/uglifyjs dist/bitauth.browser.js -o dist/bitauth.browser.min.js +cp node_modules/bitcore/browser/bundle.js dist/bitcore.bundle.js +echo "Building browser bundle for bitauth..." +browserify lib/bitauth.js -s bitauth -x buffertools -x bitcore -o dist/bitauth.bundle.js +echo "Minifying bitcore and bitauth..." +node_modules/.bin/uglifyjs dist/bitcore.bundle.js dist/bitauth.bundle.js -o dist/bitauth.browser.min.js echo "Done!" From f5de5891c257524895fc787f6cc53b7962e66a1a Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 20 Oct 2014 20:18:03 -0400 Subject: [PATCH 4/5] use projects locally installed browserify --- scripts/make-dist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh index 46eaeec..6b01c4b 100644 --- a/scripts/make-dist.sh +++ b/scripts/make-dist.sh @@ -4,7 +4,7 @@ node browser/build -s lib/Key,lib/SINKey,lib/SIN,util/util cd ../../ cp node_modules/bitcore/browser/bundle.js dist/bitcore.bundle.js echo "Building browser bundle for bitauth..." -browserify lib/bitauth.js -s bitauth -x buffertools -x bitcore -o dist/bitauth.bundle.js +node_modules/.bin/browserify lib/bitauth.js -s bitauth -x buffertools -x bitcore -o dist/bitauth.bundle.js echo "Minifying bitcore and bitauth..." node_modules/.bin/uglifyjs dist/bitcore.bundle.js dist/bitauth.bundle.js -o dist/bitauth.browser.min.js echo "Done!" From c18ee6fc9e30e61e99600f1be1edd7b83d266bd4 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 22 Oct 2014 15:11:01 -0400 Subject: [PATCH 5/5] gitignore any files in dist --- .gitignore | 3 +-- dist/.gitignore | 3 +++ dist/bitauth.browser.min.js | 9 --------- 3 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 dist/.gitignore delete mode 100644 dist/bitauth.browser.min.js diff --git a/.gitignore b/.gitignore index 31129c2..a56a7ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules -dist/bitauth.bundle.js -dist/bitcore.bundle.js + diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 0000000..600a000 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1,3 @@ +# Ignore everything in this directory +* +!.gitignore \ No newline at end of file diff --git a/dist/bitauth.browser.min.js b/dist/bitauth.browser.min.js deleted file mode 100644 index abc0d2d..0000000 --- a/dist/bitauth.browser.min.js +++ /dev/null @@ -1,9 +0,0 @@ -require=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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0){var i=new e(t);return i.fill(0),t==r.length?i:(n=n.toBuffer(),e.concat([i,n],t+n.length))}return n.toBuffer()}},s={encode:function(r){var t=new e(r.length+4),o=n(r);return r.copy(t),o.copy(t,r.length),l.encode(t)},decode:function(e){var r=l.decode(e);if(r.length<4)throw new Error("invalid input: too short");var t=r.slice(0,-4),o=r.slice(-4),i=n(t),c=i.slice(0,4);if(o.toString("hex")!==c.toString("hex"))throw new Error("checksum mismatch");return t}};exports.setBuffer=function(e){i=e},exports.base58=l,exports.base58Check=s,exports.encode=l.encode,exports.decode=l.decode}).call(this,require("buffer").Buffer)},{bignum:9,buffer:29,crypto:33}],4:[function(require,module,exports){(function(e){function i(e,i){if(e.lengthn;n++)t*=256,t+=e[n];return t}function t(e){return i(e,1)}function n(e){return i(e,4)}var r=require("./Base58").base58,s=require("../util"),h=require("./Key"),a=require("./Point"),c=require("./SecureRandom"),o=require("bignum"),d=require("../networks"),l=new o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16),u=(new o("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",16),function(i){if("undefined"==typeof i||"mainnet"==i||"livenet"==i?(i="livenet",this.version=d.livenet.hkeyPrivateVersion):"testnet"==i&&(this.version=d.testnet.hkeyPrivateVersion),"livenet"==i||"testnet"==i)return this.depth=0,this.parentFingerprint=new e([0,0,0,0]),this.childIndex=new e([0,0,0,0]),this.chainCode=c.getRandomBuffer(32),this.eckey=h.generateSync(),this.hasPrivateKey=!0,this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.buildExtendedPublicKey(),void this.buildExtendedPrivateKey();if("string"==typeof i){var t=r.decode(i);if(82!=t.length)throw new Error("Not enough data, expected 82 and received "+t.length);var n=t.slice(78,82);i=t.slice(0,78);var a=s.sha256(s.sha256(i));if(a[0]!=n[0]||a[1]!=n[1]||a[2]!=n[2]||a[3]!=n[3])throw new Error("Invalid checksum")}void 0!==i&&null!==i&&this.initFromBytes(i)});u.seed=function(i,t){if(t||(t="livenet"),e.isBuffer(i)||(i=new e(i,"hex")),i.length<16)return!1;if(i.length>64)return!1;var n=s.sha512hmac(i,new e("Bitcoin seed")),r=new u(null);return r.depth=0,r.parentFingerprint=new e([0,0,0,0]),r.childIndex=new e([0,0,0,0]),r.chainCode=n.slice(32,64),r.version=d[t].hkeyPrivateVersion,r.eckey=new h,r.eckey.private=n.slice(0,32),r.eckey.regenerateSync(),r.hasPrivateKey=!0,r.pubKeyHash=s.sha256ripe160(r.eckey.public),r.buildExtendedPublicKey(),r.buildExtendedPrivateKey(),r},u.prototype.initFromBytes=function(e){if(78!=e.length)throw new Error("not enough data");this.version=n(e.slice(0,4)),this.depth=t(e.slice(4,5)),this.parentFingerprint=e.slice(5,9),this.childIndex=n(e.slice(9,13)),this.chainCode=e.slice(13,45);var i=e.slice(45,78),r=this.version==d.livenet.hkeyPrivateVersion||this.version==d.testnet.hkeyPrivateVersion,a=this.version==d.livenet.hkeyPublicVersion||this.version==d.testnet.hkeyPublicVersion;if(r&&0==i[0])this.eckey=new h,this.eckey.private=i.slice(1,33),this.eckey.compressed=!0,this.eckey.regenerateSync(),this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.hasPrivateKey=!0;else{if(!a||2!=i[0]&&3!=i[0])throw new Error("Invalid key");this.eckey=new h,this.eckey.public=i,this.pubKeyHash=s.sha256ripe160(this.eckey.public),this.hasPrivateKey=!1}this.buildExtendedPublicKey(),this.buildExtendedPrivateKey()},u.prototype.buildExtendedPublicKey=function(){this.extendedPublicKey=new e([]);var i=null;switch(this.version){case d.livenet.hkeyPublicVersion:case d.livenet.hkeyPrivateVersion:i=d.livenet.hkeyPublicVersion;break;case d.testnet.hkeyPublicVersion:case d.testnet.hkeyPrivateVersion:i=d.testnet.hkeyPublicVersion;break;default:throw new Error("Unknown version")}this.extendedPublicKey=e.concat([new e([i>>24]),new e([i>>16&255]),new e([i>>8&255]),new e([255&i]),new e([this.depth]),this.parentFingerprint,new e([this.childIndex>>>24]),new e([this.childIndex>>>16&255]),new e([this.childIndex>>>8&255]),new e([255&this.childIndex]),this.chainCode,this.eckey.public])},u.prototype.extendedPublicKeyString=function(i){if(void 0===i||"base58"===i){var t=s.sha256(s.sha256(this.extendedPublicKey)),n=t.slice(0,4),h=e.concat([this.extendedPublicKey,n]);return r.encode(h)}if("hex"===i)return this.extendedPublicKey.toString("hex");throw new Error("bad format")},u.prototype.buildExtendedPrivateKey=function(){if(this.hasPrivateKey){this.extendedPrivateKey=new e([]);var i=this.version;this.extendedPrivateKey=e.concat([new e([i>>24]),new e([i>>16&255]),new e([i>>8&255]),new e([255&i]),new e([this.depth]),this.parentFingerprint,new e([this.childIndex>>>24]),new e([this.childIndex>>>16&255]),new e([this.childIndex>>>8&255]),new e([255&this.childIndex]),this.chainCode,new e([0]),this.eckey.private])}},u.prototype.extendedPrivateKeyString=function(i){if(void 0===i||"base58"===i){var t=s.sha256(s.sha256(this.extendedPrivateKey)),n=t.slice(0,4),h=e.concat([this.extendedPrivateKey,n]);return r.encode(h)}if("hex"===i)return this.extendedPrivateKey.toString("hex");throw new Error("bad format")},u.prototype.derive=function(e){var i=e.split("/");if("m"==e||"M"==e||"m'"==e||"M'"==e)return this;var t=this;for(var n in i){var r=i[n];if(0!=n){var s=r.length>1&&"'"==r[r.length-1],h=2147483647&parseInt(s?r.slice(0,r.length-1):r);s&&(h+=2147483648),t=t.deriveChild(h)}else if("m"!=r)throw new Error("invalid path")}return t},u.prototype.deriveChild=function(i){var t=[];t.push(i>>24&255),t.push(i>>16&255),t.push(i>>8&255),t.push(255&i),t=new e(t);var n=0!=(2147483648&i),r=this.version==d.livenet.hkeyPrivateVersion||this.version==d.testnet.hkeyPrivateVersion;if(n&&(!this.hasPrivateKey||!r))throw new Error("Cannot do private key derivation without private key");var c=null;if(this.hasPrivateKey){var y=null;y=e.concat(n?[new e([0]),this.eckey.private,t]:[this.eckey.public,t]);var v=s.sha512hmac(y,this.chainCode),p=o.fromBuffer(v.slice(0,32),{size:32}),w=v.slice(32,64),b=o.fromBuffer(this.eckey.private,{size:32}),f=p.add(b).mod(l);c=new u(null),c.chainCode=w,c.eckey=new h,c.eckey.private=f.toBuffer({size:32}),c.eckey.regenerateSync(),c.hasPrivateKey=!0}else{var y=e.concat([this.eckey.public,t]),v=s.sha512hmac(y,this.chainCode),p=v.slice(0,32),w=v.slice(32,64),k=new h;k.private=p,k.regenerateSync(),k.compressed=!1;var P=a.fromUncompressedPubKey(k.public),F=new h;F.public=this.eckey.public,F.compressed=!1;var x=a.fromUncompressedPubKey(F.public),K=a.add(P,x).toUncompressedPubKey();c=new u(null),c.chainCode=new e(w);var g=new h;g.public=K,g.compressed=!0,c.eckey=g,c.hasPrivateKey=!1}return c.childIndex=i,c.parentFingerprint=this.pubKeyHash.slice(0,4),c.version=this.version,c.depth=this.depth+1,c.eckey.compressed=!0,c.pubKeyHash=s.sha256ripe160(c.eckey.public),c.buildExtendedPublicKey(),c.buildExtendedPrivateKey(),c},module.exports=u}).call(this,require("buffer").Buffer)},{"../networks":18,"../util":87,"./Base58":3,"./Key":"ALJ4PS","./Point":12,"./SecureRandom":13,bignum:9,buffer:29}],"./lib/SIN":[function(require,module,exports){module.exports=require("tBM27q")},{}],tBM27q:[function(require,module,exports){(function(t){function i(n,e){return"number"!=typeof n?void i.super_.call(this,n,e):(this.data=new t(2+e.length),this.converters=this.encodings.binary.converters,this._encoding=this.encodings.binary._encoding,this.encoding("binary"),this.prefix(15),this.type(n),void this.payload(e))}var n=require("../util/VersionedData"),e=require("../util/EncodedData"),r=require("util");r.inherits(i,n),e.applyEncodingsTo(i),i.SIN_PERSIST_MAINNET=1,i.SIN_PERSIST_TESTNET=17,i.SIN_EPHEM=2,i.prototype.prefix=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,0)}),t):this.as("binary").readUInt8(0)},i.prototype.type=function(t){return t||0===t?(this.doAsBinary(function(){this.data.writeUInt8(t,1)}),t):this.as("binary").readUInt8(1)},i.prototype.payload=function(t){return t?(this.doAsBinary(function(){t.copy(this.data,2)}),t):this.as("binary").slice(1)},i.prototype.validate=function(){this.doAsBinary(function(){if(i.super_.prototype.validate.call(this),22!=this.data.length)throw new Error("invalid data length")})},module.exports=i}).call(this,require("buffer").Buffer)},{"../util/EncodedData":85,"../util/VersionedData":86,buffer:29,util:51}],"./lib/SINKey":[function(require,module,exports){module.exports=require("EyghZQ")},{}],EyghZQ:[function(require,module,exports){function SINKey(e){"object"!=typeof e&&(e={}),this.created=e.created,this.privKey=e.privKey}var coinUtil=require("../util"),timeUtil=require("../util/time"),Key=require("./Key"),SIN=require("./SIN");SINKey.prototype.generate=function(){this.privKey=Key.generateSync(),this.created=timeUtil.curtime()},SINKey.prototype.pubkeyHash=function(){return coinUtil.sha256ripe160(this.privKey.public)},SINKey.prototype.storeObj=function(){var e=this.privKey.public.toString("hex"),t=this.pubkeyHash(),i=new SIN(SIN.SIN_EPHEM,t),r={created:this.created,priv:this.privKey.private.toString("hex"),pub:e,sin:i.toString()};return r},module.exports=SINKey},{"../util":87,"../util/time":88,"./Key":"ALJ4PS","./SIN":"tBM27q"}],9:[function(require,module,exports){(function(t){function e(t){r.prototype["_"+t]=n.prototype[t];var e=function(e){return"string"==typeof e?e=new n(e):"number"==typeof e&&(e=new n(e.toString())),this["_"+t](e)};r.prototype[t]=e}var n=require("bn.js"),r=function o(t){return this instanceof o?(arguments[0]=t,n.apply(this,arguments)):new r(t)};r.prototype=n.prototype;var i=function(t,e){for(var n=0;ne.size)n=n.slice(o-n.length,n.length);else if(o0},n.prototype.lt=function(t){return this.cmp(t)<0},e("add"),e("sub"),e("mul"),e("mod"),e("div"),e("cmp"),e("gt"),e("lt"),r.prototype.toNumber=function(){return parseInt(this.toString(10),10)},module.exports=r}).call(this,require("buffer").Buffer)},{"bn.js":24,buffer:29}],"./lib/Key":[function(require,module,exports){module.exports=require("ALJ4PS")},{}],ALJ4PS:[function(require,module,exports){(function(e){var r=require("../SecureRandom"),t=require("bignum"),i=require("elliptic"),s=require("./Point"),n=require("../common/Key"),o=(require("util"),function(){this._pub=null,this._compressed=!0});for(var u in n)n.hasOwnProperty(u)&&(o[u]=n[u]);o.bufferToArray=function(e){for(var r=[],t=e.length,i=0;t>i;i++)r.push(e.readUInt8(i));return r};Object.defineProperty(o.prototype,"public",{set:function(r){if(!e.isBuffer(r))throw new Error("Arg should be a buffer");var t=r[0];this._compressed=4!==t,this._pub=r},get:function(){return this._pub}}),Object.defineProperty(o.prototype,"compressed",{set:function(r){var n=this._compressed;if(this._compressed=!!r,n!=this._compressed){{this._pub}if(this._pub)if(this._compressed){var o=this._pub.slice(1,33),u=this._pub.slice(33,65),p=new t(o),c=new t(u),f=new s(p,c);this._pub=f.toCompressedPubKey()}else{var h=i.curves.secp256k1,o=this._pub.slice(1,33),a=3==this._pub[0]?!0:!1,f=h.curve.pointFromX(a,o),u=new e(f.y.toArray()),y=new t(o),v=new t(u),b=new s(y,v);this._pub=b.toUncompressedPubKey()}!this._compressed}},get:function(){return this._compressed}}),o.generateSync=function(){for(var e,s=i.curves.secp256k1;;)if(e=r.getRandomBuffer(32),t.fromBuffer(e,{size:32}).cmp(s.n)<0)break;var n=new o;return n.private=e,n.regenerateSync(),n},o.prototype.regenerateSync=function(){if(!this.private)throw new Error("Key does not have a private key set");var e=i.curves.secp256k1,r=(e.g,e.g.mul(this.private)),n=new t(r.x.toArray()),o=new t(r.y.toArray()),u=new s(n,o);return this._pub=this.compressed?u.toCompressedPubKey():u.toUncompressedPubKey(),this},o.prototype.signSync=function(r){i.curves.secp256k1;if(!this.private)throw new Error("Key does not have a private key set");if(!e.isBuffer(r)||32!==r.length)throw new Error("Arg should be a 32 bytes hash buffer");var s=new t(this.private),n=o.sign(r,s),u=o.rs2DER(n.r,n.s);return u},o.prototype.verifySignature=function(e,r,t){try{var i=this.verifySignatureSync(e,r);t(null,i)}catch(s){t(s)}},o.prototype.verifySignatureSync=function(e,r){var t=new i.ec(i.curves.secp256k1),s=e.toString("hex"),n=this._pub.toString("hex"),r=r.toString("hex"),o=t.verify(s,r,n);return o},module.exports=o}).call(this,require("buffer").Buffer)},{"../SecureRandom":13,"../common/Key":14,"./Point":12,bignum:9,buffer:29,elliptic:56,util:51}],12:[function(require,module,exports){(function(e){"use strict";var r=(require("./Key"),require("bignum")),u=(require("assert"),require("elliptic")),i=require("../common/Point");i.add=function(e,r){var t=u.curves.secp256k1,n=t.curve.point(e.x,e.y),s=t.curve.point(r.x,r.y),c=n.add(s),f=new i(c.x,c.y);return f},i.multiply=function(t,n){if(e.isBuffer(n)&&32!==n.length)throw new Error("if x is a buffer, it must be 32 bytes");var s=u.curves.secp256k1,c=s.curve.point(t.x,t.y);"string"==typeof n&&(n=new r(n));var f=c.mul(n),o=new i(f.x,f.y);return o},module.exports=i}).call(this,require("buffer").Buffer)},{"../common/Point":15,"./Key":"ALJ4PS",assert:28,bignum:9,buffer:29,elliptic:56}],13:[function(require,module,exports){(function(o){var r=require("../common/SecureRandom");r.getRandomBuffer=function(r){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var e=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");var e=window.msCrypto}var n=new Uint8Array(r);e.getRandomValues(n);var w=new o(n);return w},module.exports=r}).call(this,require("buffer").Buffer)},{"../common/SecureRandom":16,buffer:29}],14:[function(require,module,exports){(function(r){var e=require("bignum"),n=require("./Point"),t=require("./SecureRandom"),o=function(){};o.parseDERsig=function(n){if(!r.isBuffer(n))throw new Error("DER formatted signature should be a buffer");var t=n[0];if(48!==t)throw new Error("Header byte should be 0x30");var o=n[1];if(o!==n.slice(2).length)throw new Error("Length byte should length of what follows");var f=n[2];if(2!==f)throw new Error("Integer byte for r should be 0x02");var u=n[3],i=n.slice(4,4+u),h=e.fromBuffer(i),a=0===n[4]?!0:!1;if(u!==i.length)throw new Error("Length of r incorrect");var g=n[4+u+0];if(2!==g)throw new Error("Integer byte for s should be 0x02");var l=n[4+u+1],w=n.slice(4+u+2,4+u+2+l),s=e.fromBuffer(w),c=0===n[4+u+2+2]?!0:!1;if(l!==w.length)throw new Error("Length of s incorrect");var d=4+u+2+l;if(o!==d-2)throw new Error("Length of signature incorrect");var m={header:t,length:o,rheader:f,rlength:u,rneg:a,rbuf:i,r:h,sheader:g,slength:l,sneg:c,sbuf:w,s:s};return m},o.rs2DER=function(e,n){var t=e.toBuffer(),o=n.toBuffer(),f=128&t[0]?!0:!1,u=128&o[0]?!0:!1,i=f?r.concat([new r([0]),t]):t,h=u?r.concat([new r([0]),o]):o,a=2+i.length+2+h.length,g=i.length,l=h.length,w=2,s=2,c=48,d=r.concat([new r([c,a,w,g]),i,new r([s,l]),h]);return d},o.sign=function(r,t,f){var u=t,i=n.getN(),h=new e(r);do var f=f||o.genk(),a=n.getG(),g=n.multiply(a,f),l=g.x.mod(i),w=f.invm(i).mul(h.add(u.mul(l))).mod(i);while(l.cmp(new e(0))<=0||w.cmp(new e(0))<=0);return{r:l,s:w}},o.genk=function(){return new e(t.getRandomBuffer(8))},module.exports=o}).call(this,require("buffer").Buffer)},{"./Point":15,"./SecureRandom":16,bignum:9,buffer:29}],15:[function(require,module,exports){(function(e){var r=require("bignum"),F=function(e,r){this.x=e,this.y=r},f=r.fromBuffer(new e("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex"),{size:32});F.getN=function(){return f};var t;F.getG=function(){return t=t||new F(r.fromBuffer(new e("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex"),{size:32}),r.fromBuffer(new e("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex"),{size:32}))},F.fromUncompressedPubKey=function(e){var f=new F;return f.x=r.fromBuffer(e.slice(1,33),{size:32}),f.y=r.fromBuffer(e.slice(33,65),{size:32}),f},F.prototype.toUncompressedPubKey=function(){var r=this.x.toBuffer({size:32}),F=this.y.toBuffer({size:32}),f=new e([4]),t=e.concat([f,r,F]);return t},F.prototype.toCompressedPubKey=function(){var r=this.x.toBuffer({size:32}),F=this.y.toBuffer({size:32});if(F[F.length-1]%2)var f=e.concat([new e([3]),r]);else var f=e.concat([new e([2]),r]);return f},module.exports=F}).call(this,require("buffer").Buffer)},{bignum:9,buffer:29}],16:[function(require,module,exports){(function(f){var e=function(){};e.getRandomBuffer=function(){},e.getPseudoRandomBuffer=function(e){for(var n=4294967296,o=new f(e),u=0;e>=u;u++){var t=Math.floor(u/4),a=u-4*t;0==a?(r=Math.random()*n,o[u]=255&r):o[u]=255&(r>>>=8)}return o},module.exports=e}).call(this,require("buffer").Buffer)},{buffer:29}],17:[function(require,module,exports){"use strict";function l(t){throw t}function aa(t,e,s){4!==e.length&&l(new sjcl.exception.invalid("invalid aes block size"));var i=t.a[s],n=e[0]^i[0],c=e[s?3:1]^i[1],r=e[2]^i[2];e=e[s?1:3]^i[3];var o,a,h,u,d=i.length/4-2,p=4,f=[0,0,0,0];o=t.m[s],t=o[0];var m=o[1],j=o[2],g=o[3],y=o[4];for(u=0;d>u;u++)o=t[n>>>24]^m[c>>16&255]^j[r>>8&255]^g[255&e]^i[p],a=t[c>>>24]^m[r>>16&255]^j[e>>8&255]^g[255&n]^i[p+1],h=t[r>>>24]^m[e>>16&255]^j[n>>8&255]^g[255&c]^i[p+2],e=t[e>>>24]^m[n>>16&255]^j[c>>8&255]^g[255&r]^i[p+3],p+=4,n=o,c=a,r=h;for(u=0;4>u;u++)f[s?3&-u:u]=y[n>>>24]<<24^y[c>>16&255]<<16^y[r>>8&255]<<8^y[255&e]^i[p++],o=n,n=c,c=r,r=e,e=o;return f}function ca(t,e){var s,i=sjcl.random.A[t],n=[];for(s in i)i.hasOwnProperty(s)&&n.push(i[s]);for(s=0;se&&(t.i[e]=t.i[e]+1|0,!t.i[e]);e++);return t.B.encrypt(t.i)}function T(t,e){return function(){e.apply(t,arguments)}}var s=void 0,v=!1,sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};"undefined"!=typeof module&&module.exports&&(module.exports=sjcl),sjcl.cipher.aes=function(t){this.m[0][0][0]||this.q();var e,s,i,n,c=this.m[0][4],r=this.m[1];e=t.length;var o=1;for(4!==e&&6!==e&&8!==e&&l(new sjcl.exception.invalid("invalid aes key size")),this.a=[i=t.slice(0),n=[]],t=e;4*e+28>t;t++)s=i[t-1],(0===t%e||8===e&&4===t%e)&&(s=c[s>>>24]<<24^c[s>>16&255]<<16^c[s>>8&255]<<8^c[255&s],0===t%e&&(s=s<<8^s>>>24^o<<24,o=o<<1^283*(o>>7))),i[t]=i[t-e]^s;for(e=0;t;e++,t--)s=i[3&e?t:t-4],n[e]=4>=t||4>e?s:r[0][c[s>>>24]]^r[1][c[s>>16&255]]^r[2][c[s>>8&255]]^r[3][c[255&s]]},sjcl.cipher.aes.prototype={encrypt:function(t){return aa(this,t,0)},decrypt:function(t){return aa(this,t,1)},m:[[[],[],[],[],[]],[[],[],[],[],[]]],q:function(){var t,e,s,i,n,c,r,o=this.m[0],a=this.m[1],l=o[4],h=a[4],u=[],d=[];for(t=0;256>t;t++)d[(u[t]=t<<1^283*(t>>7))^t]=t;for(e=s=0;!l[e];e^=i||1,s=d[s]||1)for(c=s^s<<1^s<<2^s<<3^s<<4,c=c>>8^255&c^99,l[e]=c,h[c]=e,n=u[t=u[i=u[e]]],r=16843009*n^65537*t^257*i^16843008*e,n=257*u[c]^16843008*c,t=0;4>t;t++)o[t][e]=n=n<<24^n>>>8,a[t][c]=r=r<<24^r>>>8;for(t=0;5>t;t++)o[t]=o[t].slice(0),a[t]=a[t].slice(0)}},sjcl.bitArray={bitSlice:function(t,e,i){return t=sjcl.bitArray.O(t.slice(e/32),32-(31&e)).slice(1),i===s?t:sjcl.bitArray.clamp(t,i-e)},extract:function(t,e,s){var i=Math.floor(-e-s&31);return(-32&(e+s-1^e)?t[e/32|0]<<32-i^t[e/32+1|0]>>>i:t[e/32|0]>>>i)&(1<0&&e&&(t[s-1]=sjcl.bitArray.partial(e,t[s-1]&2147483648>>e-1,1)),t},partial:function(t,e,s){return 32===t?e:(s?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(sjcl.bitArray.bitLength(t)!==sjcl.bitArray.bitLength(e))return v;var s,i=0;for(s=0;s=32;e-=32)n.push(i),i=0;if(0===e)return n.concat(t);for(c=0;c>>e),i=t[c]<<32-e;return c=t.length?t[t.length-1]:0,t=sjcl.bitArray.getPartial(c),n.push(sjcl.bitArray.partial(e+t&31,e+t>32?i:n.pop(),1)),n},t:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]}},sjcl.codec.utf8String={fromBits:function(t){var e,s,i="",n=sjcl.bitArray.bitLength(t);for(e=0;n/8>e;e++)0===(3&e)&&(s=t[e/4]),i+=String.fromCharCode(s>>>24),s<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,s=[],i=0;for(e=0;e>>n)>>>26),6>n?(r=t[s]<<6-n,n+=26,s++):(r<<=6,n-=6);for(;3&i.length&&!e;)i+="=";return i},toBits:function(t,e){t=t.replace(/\s|=/g,"");var s,i,n=[],c=0,r=sjcl.codec.base64.I,o=0;for(e&&(r=r.substr(0,62)+"-_"),s=0;si&&l(new sjcl.exception.invalid("this isn't base64!")),c>26?(c-=26,n.push(o^i>>>c),o=i<<32-c):(c+=6,o^=i<<32-c);return 56&c&&n.push(sjcl.bitArray.partial(56&c,o,1)),n}},sjcl.codec.base64url={fromBits:function(t){return sjcl.codec.base64.fromBits(t,1,1)},toBits:function(t){return sjcl.codec.base64.toBits(t,1)}},sjcl.hash.sha256=function(t){this.a[0]||this.q(),t?(this.e=t.e.slice(0),this.d=t.d.slice(0),this.c=t.c):this.reset()},sjcl.hash.sha256.hash=function(t){return(new sjcl.hash.sha256).update(t).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.e=this.j.slice(0),this.d=[],this.c=0,this},update:function(t){"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t));var e,s=this.d=sjcl.bitArray.concat(this.d,t);for(e=this.c,t=this.c=e+sjcl.bitArray.bitLength(t),e=512+e&-512;t>=e;e+=512)this.p(s.splice(0,16));return this},finalize:function(){var t,e=this.d,s=this.e,e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)]);for(t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.c/4294967296)),e.push(0|this.c);e.length;)this.p(e.splice(0,16));return this.reset(),s},j:[],a:[],q:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}var e,s=0,i=2;t:for(;64>s;i++){for(e=2;i>=e*e;e++)if(0===i%e)continue t;8>s&&(this.j[s]=t(Math.pow(i,.5))),this.a[s]=t(Math.pow(i,1/3)),s++}},p:function(t){var e,s,i=t.slice(0),n=this.e,c=this.a,r=n[0],o=n[1],a=n[2],l=n[3],h=n[4],u=n[5],d=n[6],p=n[7];for(t=0;64>t;t++)16>t?e=i[t]:(e=i[t+1&15],s=i[t+14&15],e=i[15&t]=(e>>>7^e>>>18^e>>>3^e<<25^e<<14)+(s>>>17^s>>>19^s>>>10^s<<15^s<<13)+i[15&t]+i[t+9&15]|0),e=e+p+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(d^h&(u^d))+c[t],p=d,d=u,u=h,h=l+e|0,l=a,a=o,o=r,r=e+(o&a^l&(o^a))+(o>>>2^o>>>13^o>>>22^o<<30^o<<19^o<<10)|0;n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+l|0,n[4]=n[4]+h|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0}},sjcl.hash.sha512=function(t){this.a[0]||this.q(),t?(this.e=t.e.slice(0),this.d=t.d.slice(0),this.c=t.c):this.reset()},sjcl.hash.sha512.hash=function(t){return(new sjcl.hash.sha512).update(t).finalize()},sjcl.hash.sha512.prototype={blockSize:1024,reset:function(){return this.e=this.j.slice(0),this.d=[],this.c=0,this},update:function(t){"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t));var e,s=this.d=sjcl.bitArray.concat(this.d,t);for(e=this.c,t=this.c=e+sjcl.bitArray.bitLength(t),e=1024+e&-1024;t>=e;e+=1024)this.p(s.splice(0,32));return this},finalize:function(){var t,e=this.d,s=this.e,e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)]);for(t=e.length+4;31&t;t++)e.push(0);for(e.push(0),e.push(0),e.push(Math.floor(this.c/4294967296)),e.push(0|this.c);e.length;)this.p(e.splice(0,32));return this.reset(),s},j:[],Y:[12372232,13281083,9762859,1914609,15106769,4090911,4308331,8266105],a:[],$:[2666018,15689165,5061423,9034684,4764984,380953,1658779,7176472,197186,7368638,14987916,16757986,8096111,1480369,13046325,6891156,15813330,5187043,9229749,11312229,2818677,10937475,4324308,1135541,6741931,11809296,16458047,15666916,11046850,698149,229999,945776,13774844,2541862,12856045,9810911,11494366,7844520,15576806,8533307,15795044,4337665,16291729,5553712,15684120,6662416,7413802,12308920,13816008,4303699,9366425,10176680,13195875,4295371,6546291,11712675,15708924,1519456,15772530,6568428,6495784,8568297,13007125,7492395,2515356,12632583,14740254,7262584,1535930,13146278,16321966,1853211,294276,13051027,13221564,1051980,4080310,6651434,14088940,4675607],q:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}function e(t){return 1099511627776*(t-Math.floor(t))&255}var s,i=0,n=2;t:for(;80>i;n++){for(s=2;n>=s*s;s++)if(0===n%s)continue t;8>i&&(this.j[2*i]=t(Math.pow(n,.5)),this.j[2*i+1]=e(Math.pow(n,.5))<<24|this.Y[i]),this.a[2*i]=t(Math.pow(n,1/3)),this.a[2*i+1]=e(Math.pow(n,1/3))<<24|this.$[i],i++}},p:function(t){var e,s,i=t.slice(0),n=this.e,c=this.a,r=n[0],o=n[1],a=n[2],l=n[3],h=n[4],u=n[5],d=n[6],p=n[7],f=n[8],m=n[9],j=n[10],g=n[11],y=n[12],v=n[13],b=n[14],w=n[15],k=r,A=o,x=a,B=l,C=h,L=u,S=d,E=p,M=f,P=m,z=j,R=g,O=y,U=v,T=b,V=w;for(t=0;80>t;t++){if(16>t)e=i[2*t],s=i[2*t+1];else{s=i[2*(t-15)];var I=i[2*(t-15)+1];e=(I<<31|s>>>1)^(I<<24|s>>>8)^s>>>7;var q=(s<<31|I>>>1)^(s<<24|I>>>8)^(s<<25|I>>>7);s=i[2*(t-2)];var D=i[2*(t-2)+1],I=(D<<13|s>>>19)^(s<<3|D>>>29)^s>>>6,D=(s<<13|D>>>19)^(D<<3|s>>>29)^(s<<26|D>>>6),G=i[2*(t-7)],$=i[2*(t-16)],K=i[2*(t-16)+1];s=q+i[2*(t-7)+1],e=e+G+(q>>>0>s>>>0?1:0),s+=D,e+=I+(D>>>0>s>>>0?1:0),s+=K,e+=$+(K>>>0>s>>>0?1:0)}i[2*t]=e|=0,i[2*t+1]=s|=0;var G=M&z^~M&O,N=P&R^~P&U,D=k&x^k&C^x&C,W=A&B^A&L^B&L,$=(A<<4|k>>>28)^(k<<30|A>>>2)^(k<<25|A>>>7),K=(k<<4|A>>>28)^(A<<30|k>>>2)^(A<<25|k>>>7),Y=c[2*t],F=c[2*t+1],I=V+((M<<18|P>>>14)^(M<<14|P>>>18)^(P<<23|M>>>9)),q=T+((P<<18|M>>>14)^(P<<14|M>>>18)^(M<<23|P>>>9))+(V>>>0>I>>>0?1:0),I=I+N,q=q+(G+(N>>>0>I>>>0?1:0)),I=I+F,q=q+(Y+(F>>>0>I>>>0?1:0)),I=I+s,q=q+(e+(s>>>0>I>>>0?1:0));s=K+W,e=$+D+(K>>>0>s>>>0?1:0),T=O,V=U,O=z,U=R,z=M,R=P,P=E+I|0,M=S+q+(E>>>0>P>>>0?1:0)|0,S=C,E=L,C=x,L=B,x=k,B=A,A=I+s|0,k=q+e+(I>>>0>A>>>0?1:0)|0}o=n[1]=o+A|0,n[0]=r+k+(A>>>0>o>>>0?1:0)|0,l=n[3]=l+B|0,n[2]=a+x+(B>>>0>l>>>0?1:0)|0,u=n[5]=u+L|0,n[4]=h+C+(L>>>0>u>>>0?1:0)|0,p=n[7]=p+E|0,n[6]=d+S+(E>>>0>p>>>0?1:0)|0,m=n[9]=m+P|0,n[8]=f+M+(P>>>0>m>>>0?1:0)|0,g=n[11]=g+R|0,n[10]=j+z+(R>>>0>g>>>0?1:0)|0,v=n[13]=v+U|0,n[12]=y+O+(U>>>0>v>>>0?1:0)|0,w=n[15]=w+V|0,n[14]=b+T+(V>>>0>w>>>0?1:0)|0}},sjcl.mode.ccm={name:"ccm",encrypt:function(t,e,s,i,n){var c,r=e.slice(0),o=sjcl.bitArray,a=o.bitLength(s)/8,h=o.bitLength(r)/8;for(n=n||64,i=i||[],7>a&&l(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),c=2;4>c&&h>>>8*c;c++);return 15-a>c&&(c=15-a),s=o.clamp(s,8*(15-c)),e=sjcl.mode.ccm.K(t,e,s,i,n,c),r=sjcl.mode.ccm.L(t,r,s,e,n,c),o.concat(r.data,r.tag) -},decrypt:function(t,e,s,i,n){n=n||64,i=i||[];var c=sjcl.bitArray,r=c.bitLength(s)/8,o=c.bitLength(e),a=c.clamp(e,o-n),h=c.bitSlice(e,o-n),o=(o-n)/8;for(7>r&&l(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),e=2;4>e&&o>>>8*e;e++);return 15-r>e&&(e=15-r),s=c.clamp(s,8*(15-e)),a=sjcl.mode.ccm.L(t,a,s,h,n,e),t=sjcl.mode.ccm.K(t,a.data,s,i,n,e),c.equal(a.tag,t)||l(new sjcl.exception.corrupt("ccm: tag doesn't match")),a.data},K:function(t,e,s,i,n,c){var r=[],o=sjcl.bitArray,a=o.t;if(n/=8,(n%2||4>n||n>16)&&l(new sjcl.exception.invalid("ccm: invalid tag length")),(4294967295=s?r=[o.partial(16,s)]:4294967295>=s&&(r=o.concat([o.partial(16,65534)],[s])),r=o.concat(r,i),i=0;ir;r+=4)s[3]++,n=t.encrypt(s),e[r]^=n[0],e[r+1]^=n[1],e[r+2]^=n[2],e[r+3]^=n[3];return{tag:i,data:o.clamp(e,l)}}},sjcl.beware===s&&(sjcl.beware={}),sjcl.beware["CBC mode is dangerous because it doesn't protect message integrity."]=function(){sjcl.mode.cbc={name:"cbc",encrypt:function(t,e,s,i){i&&i.length&&l(new sjcl.exception.invalid("cbc can't authenticate data")),128!==sjcl.bitArray.bitLength(s)&&l(new sjcl.exception.invalid("cbc iv must be 128 bits"));var n=sjcl.bitArray,c=n.t,r=n.bitLength(e),o=0,a=[];for(7&r&&l(new sjcl.exception.invalid("pkcs#5 padding only works for multiples of a byte")),i=0;r>=o+128;i+=4,o+=128)s=t.encrypt(c(s,e.slice(i,i+4))),a.splice(i,0,s[0],s[1],s[2],s[3]);return r=16843009*(16-(r>>3&15)),s=t.encrypt(c(s,n.concat(e,[r,r,r,r]).slice(i,i+4))),a.splice(i,0,s[0],s[1],s[2],s[3]),a},decrypt:function(t,e,s,i){i&&i.length&&l(new sjcl.exception.invalid("cbc can't authenticate data")),128!==sjcl.bitArray.bitLength(s)&&l(new sjcl.exception.invalid("cbc iv must be 128 bits")),(127&sjcl.bitArray.bitLength(e)||!e.length)&&l(new sjcl.exception.corrupt("cbc ciphertext must be a positive multiple of the block size"));var n,c=sjcl.bitArray,r=c.t,o=[];for(i=0;i16)&&l(new sjcl.exception.corrupt("pkcs#5 padding corrupt")),s=16843009*n,c.equal(c.bitSlice([s,s,s,s],0,8*n),c.bitSlice(o,32*o.length-8*n,32*o.length))||l(new sjcl.exception.corrupt("pkcs#5 padding corrupt")),c.bitSlice(o,0,32*o.length-8*n)}}},sjcl.misc.hmac=function(t,e){this.M=e=e||sjcl.hash.sha256;var s,i=[[],[]],n=e.prototype.blockSize/32;for(this.o=[new e,new e],t.length>n&&(t=e.hash(t)),s=0;n>s;s++)i[0][s]=909522486^t[s],i[1][s]=1549556828^t[s];this.o[0].update(i[0]),this.o[1].update(i[1]),this.G=new e(this.o[0])},sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(t){return this.P&&l(new sjcl.exception.invalid("encrypt on already updated hmac called!")),this.update(t),this.digest(t)},sjcl.misc.hmac.prototype.reset=function(){this.G=new this.M(this.o[0]),this.P=v},sjcl.misc.hmac.prototype.update=function(t){this.P=!0,this.G.update(t)},sjcl.misc.hmac.prototype.digest=function(){var t=this.G.finalize(),t=new this.M(this.o[1]).update(t).finalize();return this.reset(),t},sjcl.misc.pbkdf2=function(t,e,s,i,n){s=s||1e3,(0>i||0>s)&&l(sjcl.exception.invalid("invalid params to pbkdf2")),"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t)),"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e)),n=n||sjcl.misc.hmac,t=new n(t);var c,r,o,a,h=[],u=sjcl.bitArray;for(a=1;32*h.length<(i||1);a++){for(n=c=t.encrypt(u.concat(e,[a])),r=1;s>r;r++)for(c=t.encrypt(c),o=0;oc;c++)n.push(4294967296*Math.random()|0);for(c=0;c=1<this.l&&(this.l=r),this.F++,this.a=sjcl.hash.sha256.hash(this.a.concat(n)),this.B=new sjcl.cipher.aes(this.a),s=0;4>s&&(this.i[s]=this.i[s]+1|0,!this.i[s]);s++);}for(s=0;t>s;s+=4)0===(s+1)%this.R&&ba(this),n=S(this),i.push(n[0],n[1],n[2],n[3]);return ba(this),i.slice(0,t)},setDefaultParanoia:function(t,e){0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e&&l("Setting paranoia=0 will ruin your security; use it only for testing"),this.C=t},addEntropy:function(t,e,i){i=i||"user";var n,c,r=(new Date).valueOf(),o=this.s[i],a=this.isReady(),h=0;switch(n=this.J[i],n===s&&(n=this.J[i]=this.V++),o===s&&(o=this.s[i]=0),this.s[i]=(this.s[i]+1)%this.f.length,typeof t){case"number":e===s&&(e=1),this.f[o].update([n,this.D++,1,e,r,1,0|t]);break;case"object":if(i=Object.prototype.toString.call(t),"[object Uint32Array]"===i){for(c=[],i=0;i0;)e++,c>>>=1;this.f[o].update([n,this.D++,2,e,r,t.length].concat(t))}break;case"string":e===s&&(e=t.length),this.f[o].update([n,this.D++,3,e,r,t.length]),this.f[o].update(t);break;default:h=1}h&&l(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.k[o]+=e,this.g+=e,a===this.n&&(this.isReady()!==this.n&&ca("seeded",Math.max(this.l,this.g)),ca("progress",this.getProgress()))},isReady:function(t){return t=this.H[t!==s?t:this.C],this.l&&this.l>=t?this.k[0]>this.Q&&(new Date).valueOf()>this.N?this.w|this.u:this.u:this.g>=t?this.w|this.n:this.n},getProgress:function(t){return t=this.H[t?t:this.C],this.l>=t?1:this.g>t?1:this.g/t},startCollectors:function(){this.r||(this.b={loadTimeCollector:T(this,this.aa),mouseCollector:T(this,this.ba),keyboardCollector:T(this,this.Z),accelerometerCollector:T(this,this.T)},window.addEventListener?(window.addEventListener("load",this.b.loadTimeCollector,v),window.addEventListener("mousemove",this.b.mouseCollector,v),window.addEventListener("keypress",this.b.keyboardCollector,v),window.addEventListener("devicemotion",this.b.accelerometerCollector,v)):document.attachEvent?(document.attachEvent("onload",this.b.loadTimeCollector),document.attachEvent("onmousemove",this.b.mouseCollector),document.attachEvent("keypress",this.b.keyboardCollector)):l(new sjcl.exception.bug("can't attach event")),this.r=!0)},stopCollectors:function(){this.r&&(window.removeEventListener?(window.removeEventListener("load",this.b.loadTimeCollector,v),window.removeEventListener("mousemove",this.b.mouseCollector,v),window.removeEventListener("keypress",this.b.keyboardCollector,v),window.removeEventListener("devicemotion",this.b.accelerometerCollector,v)):document.detachEvent&&(document.detachEvent("onload",this.b.loadTimeCollector),document.detachEvent("onmousemove",this.b.mouseCollector),document.detachEvent("keypress",this.b.keyboardCollector)),this.r=v)},addEventListener:function(t,e){this.A[t][this.U++]=e},removeEventListener:function(t,e){var s,i,n=this.A[t],c=[];for(i in n)n.hasOwnProperty(i)&&n[i]===e&&c.push(i);for(s=0;s=r.iter||64!==r.ts&&96!==r.ts&&128!==r.ts||128!==r.ks&&192!==r.ks&&256!==r.ks||2>r.iv.length||4=e.iter||64!==e.ts&&96!==e.ts&&128!==e.ts||128!==e.ks&&192!==e.ks&&256!==e.ks||!e.iv||2>e.iv.length||4=t){var n;null==p?(n=g.splice(0,t),a.skip||(n=n.slice())):(a.skip||(n=g.slice(p,t)),p=t),a.skip?a.cb():a.cb(n)}}}function o(n){function o(){w||n.next()}var u=i(function(t,n){return function(r){e(t,function(t){v.set(r,n(t)),o()})}});return u.tap=function(t){n.nest(t,v.store)},u.into=function(t,e){v.get(t)||v.set(t,{});var r=v;v=c(r.get(t)),n.nest(function(){e.apply(this,arguments),this.tap(function(){v=r})},v.store)},u.flush=function(){v.store={},o()},u.loop=function(t){var e=!1;n.nest(!1,function r(){this.vars=v.store,t.call(this,function(){e=!0,o()},v.store),this.tap(function(){e?n.next():r.call(this)}.bind(this))},v.store)},u.buffer=function(t,n){"string"==typeof n&&(n=v.get(n)),e(n,function(n){v.set(t,n),o()})},u.skip=function(t){"string"==typeof t&&(t=v.get(t)),e(t,function(){o()})},u.scan=function(n,e){if("string"==typeof e)e=new t(e);else if(!t.isBuffer(e))throw new Error("search must be a Buffer or a string");var i=0;a=function(){var t=g.indexOf(e,p+i),u=t-p-i;-1!==t?(a=null,null!=p?(v.set(n,g.slice(p,p+i+u)),p+=i+u+e.length):(v.set(n,g.slice(0,i+u)),g.splice(0,i+u+e.length)),o(),r()):u=Math.max(g.length-e.length-p-i,0),i+=u},r()},u.peek=function(t){p=0,n.nest(function(){t.call(this,v.store),this.tap(function(){p=null})})},u}if(n)return exports.apply(null,arguments);var a=null,p=null,h=u.light(o);h.writable=!0;var g=f();h.write=function(t){g.push(t),r()};var v=c(),w=!1,b=!1;return h.end=function(){b=!0},h.pipe=l.prototype.pipe,Object.getOwnPropertyNames(s.prototype).forEach(function(t){h[t]=s.prototype[t]}),h},exports.parse=function(n){var e=i(function(t,i){return function(u){if(r+t<=n.length){var s=n.slice(r,r+t);r+=t,o.set(u,i(s))}else o.set(u,null);return e}}),r=0,o=c();return e.vars=o.store,e.tap=function(t){return t.call(e,o.store),e},e.into=function(t,n){o.get(t)||o.set(t,{});var r=o;return o=c(r.get(t)),n.call(e,o.store),o=r,e},e.loop=function(t){for(var n=!1,r=function(){n=!0};n===!1;)t.call(e,r,o.store);return e},e.buffer=function(t,i){"string"==typeof i&&(i=o.get(i));var u=n.slice(r,Math.min(n.length,r+i));return r+=i,o.set(t,u),e},e.skip=function(t){return"string"==typeof t&&(t=o.get(t)),r+=t,e},e.scan=function(i,u){if("string"==typeof u)u=new t(u);else if(!t.isBuffer(u))throw new Error("search must be a Buffer or a string");o.set(i,null);for(var s=0;s+r<=n.length-u.length+1;s++){for(var f=0;f=n.length},e}}).call(this,require("buffer").Buffer)},{"./lib/vars.js":20,buffer:29,buffers:"OBo3aV",chainsaw:21,events:38,stream:43}],20:[function(require,module,exports){module.exports=function(t){function n(t,n){var e=r.store,o=t.split(".");o.slice(0,-1).forEach(function(t){void 0===e[t]&&(e[t]={}),e=e[t]});var u=o[o.length-1];return 1==arguments.length?e[u]:e[u]=n}var r={get:function(t){return n(t)},set:function(t,r){return n(t,r)},store:t||{}};return r}},{}],21:[function(require,module,exports){(function(n){function t(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.record(),e.chain()}function e(n){n.step=0,n.pop=function(){return n.actions[n.step++]},n.trap=function(t,e){var r=Array.isArray(t)?t:[t];n.actions.push({path:r,step:n.step,cb:e,trap:!0})},n.down=function(t){var e=(Array.isArray(t)?t:[t]).join("/"),r=n.actions.slice(n.step).map(function(t){return t.trap&&t.step<=n.step?!1:t.path.join("/")==e}).indexOf(!0);r>=0?n.step+=r:n.step=n.actions.length;var a=n.actions[n.step-1];a&&a.trap?(n.step=a.step,a.cb()):n.next()},n.jump=function(t){n.step=t,n.next()}}var r=require("traverse"),a=require("events").EventEmitter;module.exports=t,t.light=function(n){var e=t.saw(n,{}),r=n.call(e.handlers,e);return void 0!==r&&(e.handlers=r),e.chain()},t.saw=function(o,s){var i=new a;return i.handlers=s,i.actions=[],i.chain=function(){var t=r(i.handlers).map(function(n){if(this.isRoot)return n;var e=this.path;"function"==typeof n&&this.update(function(){return i.actions.push({path:e,args:[].slice.call(arguments)}),t})});return n.nextTick(function(){i.emit("begin"),i.next()}),t},i.pop=function(){return i.actions.shift()},i.next=function(){var n=i.pop();if(n){if(!n.trap){var t=i.handlers;n.path.forEach(function(n){t=t[n]}),t.apply(i.handlers,n.args)}}else i.emit("end")},i.nest=function(n){var e=[].slice.call(arguments,1),r=!0;if("boolean"==typeof n){var r=n;n=e.shift()}var a=t.saw(o,{}),s=o.call(a.handlers,a);void 0!==s&&(a.handlers=s),"undefined"!=typeof i.step&&a.record(),n.apply(a.chain(),e),r!==!1&&a.on("end",i.next)},i.record=function(){e(i)},["trap","down","jump"].forEach(function(n){i[n]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),i}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,events:38,traverse:22}],22:[function(require,module,exports){function Traverse(e){return this instanceof Traverse?void(this.value=e):new Traverse(e)}function walk(e,t,r){var n=[],o=[],a=!0;return function i(e){var c=r?copy(e):e,s={},f={node:c,node_:e,path:[].concat(n),parent:o.slice(-1)[0],key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(e){f.isRoot||(f.parent.node[f.key]=e),f.node=e},"delete":function(){delete f.parent.node[f.key]},remove:function(){Array.isArray(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key]},before:function(e){s.before=e},after:function(e){s.after=e},pre:function(e){s.pre=e},post:function(e){s.post=e},stop:function(){a=!1}};if(!a)return f;if("object"==typeof c&&null!==c){f.isLeaf=0==Object.keys(c).length;for(var u=0;ua;a++){r=t.apply(null,e.try[a].map(function(r){return e[r]||r})),s.push(r);try{return o=e.path?require.resolve(r):require(r),e.path||(o.path=r),o}catch(l){if(!/not find/i.test(l.message))throw l}}throw n=new Error("Could not locate the bindings file. Tried:\n"+s.map(function(r){return e.arrow+r}).join("\n")),n.tries=s,n}var n=require("fs"),i=require("path"),t=i.join,s=i.dirname,a=n.existsSync||i.existsSync,d={arrow:e.env.NODE_BINDINGS_ARROW||" → ",compiled:e.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:e.platform,arch:e.arch,version:e.versions.node,bindings:"bindings.node","try":[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"]]};module.exports=exports=o,exports.getFileName=function(){var e,o=Error.prepareStackTrace,n=Error.stackTraceLimit,i={};return Error.stackTraceLimit=10,Error.prepareStackTrace=function(o,n){for(var i=0,t=n.length;t>i;i++)if(e=n[i].getFileName(),e!==r)return},Error.captureStackTrace(i),i.stack,Error.prepareStackTrace=o,Error.stackTraceLimit=n,e},exports.getRoot=function(r){for(var o,n=s(r);;){if("."===n&&(n=e.cwd()),a(t(n,"package.json"))||a(t(n,"node_modules")))return n;if(o===n)throw new Error('Could not find module root given file: "'+r+'". Do you have a `package.json` file? ');o=n,n=t(n,"..")}}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/node_modules/bindings/bindings.js")},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,fs:27,path:41}],24:[function(require,module,exports){function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function assertEqual(t,i,r){if(t!=i)throw new Error(r||"Assertion failed: "+t+" != "+i)}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,void(null!==t&&this._init(t||0,i||10)))}function zero6(t){return 5===t.length?"0"+t:4===t.length?"00"+t:3===t.length?"000"+t:2===t.length?"0000"+t:1===t.length?"00000"+t:t}function zero14(t){return 13===t.length?"0"+t:12===t.length?"00"+t:11===t.length?"000"+t:10===t.length?"0000"+t:9===t.length?"00000"+t:8===t.length?"000000"+t:7===t.length?"0000000"+t:6===t.length?"00000000"+t:5===t.length?"000000000"+t:4===t.length?"0000000000"+t:3===t.length?"00000000000"+t:2===t.length?"000000000000"+t:1===t.length?"0000000000000"+t:t}function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new BN(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.invm(this.m),this.minv=this.rinv.mul(this.r).sub(new BN(1)).div(this.m).neg().mod(this.r)}"object"==typeof module&&(module.exports=BN),BN.BN=BN,BN.wordSize=26,BN.prototype._init=function(t,i){if("number"==typeof t)return 0>t&&(this.sign=!0,t=-t),void(67108864>t?(this.words=[67108863&t],this.length=1):(this.words=[67108863&t,t/67108864&67108863],this.length=2));if("object"==typeof t){assert("number"==typeof t.length),this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r=0;r-=3){var e=t[r]|t[r-1]<<8|t[r-2]<<16;this.words[n]|=e<>>26-s&67108863,s+=24,s>=26&&(s-=26,n++)}return this.strip()}"hex"===i&&(i=16),assert(16>=i),t=t.toString().replace(/\s+/g,"");var o=0;"-"===t[0]&&o++,16===i?this._parseHex(t,o):this._parseBase(t,i,o),"-"===t[0]&&(this.sign=!0),this.strip()},BN.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6){var e=parseInt(t.slice(r,r+6),16);this.words[n]|=e<>>26-s&4194303,s+=24,s>=26&&(s-=26,n++)}if(r+6!==i){var e=parseInt(t.slice(i,r+6),16);this.words[n]|=e<>>26-s&4194303}this.strip()},BN.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var s=0,n=1,e=0,o=null,h=r;h=d?0|d:d>="a"?d.charCodeAt(0)-97+10:d.charCodeAt(0)-65+10,s*=i,s+=f,n*=i,e++,n>1048575&&(assert(67108863>=n),o||(o=new BN(n)),this.mul(o).copy(this),this.iadd(new BN(s)),s=0,n=1,e=0)}0!==e&&(this.mul(new BN(n)).copy(this),this.iadd(new BN(s)))},BN.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},BN.prototype.inspect=function(){return(this.red?""};var div10=new BN(null);div10.words=[8011776,1490116],div10.length=2,BN.prototype.toString=function(t){if(t=t||10,16===t||"hex"===t){for(var i="",r=0,s=0,n=0;n>>24-r&16777215,i=0!==s||n!==this.length-1?zero6(o)+i:o+i,r+=2,r>=26&&(r-=26,n--)}return 0!==s&&(i=s.toString(16)+i),this.sign&&(i="-"+i),i}if(10===t){var i="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(1e6);h=h.idivn(1e6),i=0!==h.cmpn(0)?zero6(f+"")+i:f+i}return 0===this.cmpn(0)&&(i="0"+i),this.sign&&(i="-"+i),i}assert(!1,"Only 16 and 10 base are supported")},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toArray=function(){this.strip();var t=new Array(this.byteLength());t[0]=0;for(var i=this.clone(),r=0;0!==i.cmpn(0);r++){var s=i.andln(255);i.ishrn(8),t[t.length-r-1]=s -}return t},BN.prototype._countBits=function(t){return t>=33554432?26:t>=16777216?25:t>=8388608?24:t>=4194304?23:t>=2097152?22:t>=1048576?21:t>=524288?20:t>=262144?19:t>=131072?18:t>=65536?17:t>=32768?16:t>=16384?15:t>=8192?14:t>=4096?13:t>=2048?12:t>=1024?11:t>=512?10:t>=256?9:t>=128?8:t>=64?7:t>=32?6:t>=16?5:t>=8?4:t>=4?3:t>=2?2:t>=1?1:0},BN.prototype.bitLength=function(){var t=0,i=this.words[this.length-1],t=this._countBits(i);return 26*(this.length-1)+t},BN.prototype.byteLength=function(){this.words[this.length-1];return Math.ceil(this.bitLength()/8)},BN.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},BN.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var i=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var i=this.isub(t);return t.sign=!0,i._normSign()}var r,s;this.length>t.length?(r=this,s=t):(r=t,s=this);for(var n=0,e=0;e>>26}for(;0!==n&&e>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function(t){if(t.sign){t.sign=!1;var i=this.iadd(t);return t.sign=!0,i._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;if(r>0)var s=this,n=t;else var s=t,n=this;for(var e=0,o=0;oi?(i+=67108864,e=1):e=0,this.words[o]=i}for(;0!==e&&oi?(i+=67108864,e=1):e=0,this.words[o]=i}if(0===e&&o>>26,e=67108863&r,o=Math.min(s,t.length-1),h=Math.max(0,s-this.length+1);o>=h;h++){var f=s-h,d=this.words[f],u=t.words[h],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}i.words[s]=e,r=n}return 0!==r?i.words[s]=r:i.length--,i.strip()},BN.prototype.mul=function(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var i=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var s=this.length-2;s>=0;s--){for(var n=0,e=0,o=Math.min(s,r-1),h=Math.max(0,s-i+1);o>=h;h++){var f=s-h,d=this.words[f],u=t.words[h],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}this.words[s]=e,this.words[s+1]+=n,n=0}for(var n=0,f=1;f>>26}return this.strip()},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.mul(this)},BN.prototype.ishln=function(t){assert("number"==typeof t&&t>=0);{var i=t%26,r=(t-i)/26,s=67108863>>>26-i<<26-i;this.clone()}if(0!==i){for(var n=0,e=0;e>>26-i}n&&(this.words[e]=n,this.length++)}if(0!==r){for(var e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(var e=0;r>e;e++)this.words[e]=0;this.length+=r}return this.strip()},BN.prototype.ishrn=function(t,i,r){assert("number"==typeof t&&t>=0),i=i?(i-i%26)/26:0;var s=t%26,n=Math.min((t-s)/26,this.length),e=67108863^67108863>>>s<h;h++)o.words[h]=this.words[h];o.length=n}if(0===n);else if(this.length>n){this.length-=n;for(var h=0;h=0&&(0!==f||h>=i);h--){var d=this.words[h];this.words[h]=f<<26-s|d>>>s,f=d&e}return o&&0!==f&&(o.words[o.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),r?{hi:this,lo:o}:this},BN.prototype.shln=function(t){return this.clone().ishln(t)},BN.prototype.shrn=function(t){return this.clone().ishrn(t)},BN.prototype.testn=function(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,s=1<=0);var i=t%26,r=(t-i)/26;if(assert(!this.sign,"imaskn works only with positive numbers"),0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var s=67108863^67108863>>>i<t)return this.isubn(t);this.words[0]+=t;for(var i=0;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},BN.prototype.isubn=function(t){if(assert("number"==typeof t),assert(this.cmpn(t)>=0,"Sign change is not supported in isubn"),0>t)return this.iaddn(-t);this.words[0]-=t;for(var i=0;in.length;){var o=67108864*s.words[s.length-1]+s.words[s.length-2],h=o/n.words[n.length-1],f=h/67108864|0,d=67108863&h;h=new BN(null),h.words=[d,f],h.length=2;var r=26*(s.length-n.length-1);if(e){var u=h.shln(r);s.sign?e.isub(u):e.iadd(u)}h=h.mul(n).ishln(r),s.sign?s.iadd(h):s.isub(h)}for(;s.ucmp(n)>=0;){var o=s.words[s.length-1],h=new BN(o/n.words[n.length-1]|0),r=26*(s.length-n.length);if(e){var u=h.shln(r);s.sign?e.isub(u):e.iadd(u)}h=h.mul(n).ishln(r),s.sign?s.iadd(h):s.isub(h)}return s.sign&&(e&&e.isubn(1),s.iadd(n)),{div:e?e:null,mod:s}},BN.prototype.divmod=function(t,i){if(assert(0!==t.cmpn(0)),this.sign&&!t.sign){var r,s,n=this.neg().divmod(t,i);return"mod"!==i&&(r=n.div.neg()),"div"!==i&&(s=0===n.mod.cmpn(0)?n.mod:t.sub(n.mod)),{div:r,mod:s}}if(!this.sign&&t.sign){var r,n=this.divmod(t.neg(),i);return"mod"!==i&&(r=n.div.neg()),{div:r,mod:n.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),i):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,i)},BN.prototype.div=function(t){return this.divmod(t,"div").div},BN.prototype.mod=function(t){return this.divmod(t,"mod").mod},BN.prototype.divRound=function(t){var i=this.divmod(t);if(0===i.mod.cmpn(0))return i.div;var r=i.div.sign?i.mod.isub(t):i.mod,s=t.shrn(1),n=t.andln(1),e=r.cmp(s);return 0>e||1===n&&0===e?i.div:i.div.sign?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modn=function(t){assert(67108863>=t);for(var i=(1<<26)%t,r=0,s=this.length-1;s>=0;s--)r=(i*r+this.words[s])%t;return r},BN.prototype.idivn=function(t){assert(67108863>=t);for(var i=0,r=this.length-1;r>=0;r--){var s=this.words[r]+67108864*i;this.words[r]=s/t|0,i=s%t}return this.strip()},BN.prototype.divn=function(t){return this.clone().idivn(t)},BN.prototype._egcd=function(t,i){assert(!i.sign),assert(0!==i.cmpn(0));var r=this,s=i.clone();r=r.sign?r.mod(i):r.clone();for(var n=new BN(0);r.cmpn(1)>0&&s.cmpn(1)>0;){for(;r.isEven();)r.ishrn(1),t.isEven()?t.ishrn(1):t.iadd(i).ishrn(1);for(;s.isEven();)s.ishrn(1),n.isEven()?n.ishrn(1):n.iadd(i).ishrn(1);r.cmp(s)>=0?(r.isub(s),t.isub(n)):(s.isub(r),n.isub(t))}return 0===r.cmpn(1)?t:n},BN.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var i=this.clone(),r=t.clone();i.sign=!1,r.sign=!1;for(var s=0;i.isEven()&&r.isEven();s++)i.ishrn(1),r.ishrn(1);for(;i.isEven();)i.ishrn(1);do{for(;r.isEven();)r.ishrn(1);if(i.cmp(r)<0){var n=i;i=r,r=n}i.isub(i.div(r).mul(r))}while(0!==i.cmpn(0)&&0!==r.cmpn(0));return 0===i.cmpn(0)?r.ishln(s):i.ishln(s)},BN.prototype.invm=function(t){return this._egcd(new BN(1),t).mod(t)},BN.prototype.isEven=function(){return 0===(1&this.words[0])},BN.prototype.isOdd=function(){return 1===(1&this.words[0])},BN.prototype.andln=function(t){return this.words[0]&t},BN.prototype.bincn=function(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,s=1<n;n++)this.words[n]=0;return this.words[r]|=s,this.length=r+1,this}for(var e=s,n=r;0!==e&&n>>26,o&=67108863,this.words[n]=o}return 0!==e&&(this.words[n]=e,this.length++),this},BN.prototype.cmpn=function(t){var i=0>t;if(i&&(t=-t),this.sign&&!i)return-1;if(!this.sign&&i)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var s=this.words[0];r=s===t?0:t>s?-1:1}return this.sign&&(r=-r),r},BN.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var i=this.ucmp(t);return this.sign?-i:i},BN.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;r--){var s=this.words[r],n=t.words[r];if(s!==n){n>s?i=-1:s>n&&(i=1);break}}return i},BN.red=function(t){return new Red(t)},BN.prototype.toRed=function(t){return assert(!this.red,"Already a number in reduction context"),assert(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(t){return this.red=t,this},BN.prototype.forceRed=function(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function(t){var i,r=t;do{var s=r.ishrn(this.n,0,this.tmp);r=this.imulK(s.hi),r=r.iadd(s.lo),i=r.bitLength()}while(i>this.n);var n=i0?r.isub(this.p):r.strip(),r},MPrime.prototype.imulK=function(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=t.length-3;i>=0;i--){var r=t.words[i],s=64*r,n=977*r;s+=n/67108864|0;var e=s/67108864|0;s&=67108863,n&=67108863,t.words[i+2]+=e,t.words[i+1]+=s,t.words[i]=n}var r=t.words[t.length-2];return r>=67108864&&(t.words[t.length-1]+=r>>>26,t.words[t.length-2]=67108863&r),0===t.words[t.length-1]&&t.length--,0===t.words[t.length-1]&&t.length--,t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function(t){for(var i=0,r=0;r>>=26,t.words[r]=n,i=s}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function t(i){if(primes[i])return primes[i];var t;if("k256"===i)t=new K256;else if("p224"===i)t=new P224;else if("p192"===i)t=new P192;else{if("p25519"!==i)throw new Error("Unknown prime "+i);t=new P25519}return primes[i]=t,t},Red.prototype._verify1=function(t){assert(!t.sign,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function(t,i){assert(!t.sign&&!i.sign,"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},Red.prototype.neg=function(t){var i=t.clone();return i.sign=!i.sign,i.iadd(this.m)._forceRed(this)},Red.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)},Red.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},Red.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)},Red.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.shln(i))},Red.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function(t){return this.imul(t,t)},Red.prototype.sqr=function(t){return this.mul(t,t)},Red.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var i=this.m.andln(3);if(assert(i%2===1),3===i){var r=this.m.add(new BN(1)).ishrn(2),s=this.pow(t,r);return s}for(var n=this.m.subn(1),e=0;0!==n.cmpn(0)&&0===n.andln(1);)e++,n.ishrn(1);assert(0!==n.cmpn(0));var o=new BN(1).toRed(this),h=o.redNeg(),f=this.m.subn(1).ishrn(1),d=this.m.bitLength();for(d=new BN(2*d*d).toRed(this);0!==this.pow(d,f).cmp(h);)d.redIAdd(h);for(var u=this.pow(d,n),s=this.pow(t,n.addn(1).ishrn(1)),l=this.pow(t,n),p=e;0!==l.cmp(o);){for(var a=l,g=0;0!==a.cmp(o);g++)a=a.redSqr();assert(p>g);var m=this.pow(u,new BN(1).ishln(p-g-1));s=s.redMul(m),u=m.redSqr(),l=l.redMul(u),p=g}return s},Red.prototype.invm=function(t){var i=t._egcd(new BN(1),this.m);return i.sign?(i.sign=!1,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function(t,i){for(var r=[],s=i.clone();0!==s.cmpn(0);)r.push(s.andln(1)),s.ishrn(1);for(var n=t,e=0;e=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},Mont.prototype.mul=function(t,i){if(0===t.cmpn(0)||0===i.cmpn(0))return new BN(0)._forceRed(this);var r=t.mul(i),s=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(s).ishrn(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)},Mont.prototype.invm=function(t){var i=this.imod(t.invm(this.m).mul(this.r2));return i._forceRed(this)}},{}],buffertools:[function(require,module,exports){module.exports=require("fugeBw")},{}],fugeBw:[function(require,module,exports){(function(t){"use strict";function r(){this.writable=!0,this.buffer=null}var e=require("events"),n=require("util"),i={};module.exports.Buffer=t;var o=function(r){return r instanceof t||r instanceof Uint8Array},f=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw new Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}return t.apply(r,arguments)}},u=function(t){return function(){var r=this;if(o(r));else{if(!o(arguments[0]))throw Error("Argument should be a buffer object.");r=arguments[0],Array.prototype.shift.apply(arguments)}var e=arguments[0];if("string"==typeof e||e instanceof String||o(e))return t.apply(r,arguments);throw new Error("Second argument must be a string or a buffer.")}};i.clear=f(function(){for(var t=0;tn;n++)this[e+n]="undefined"==typeof t.length?t:"string"==typeof t[n]?t[n].charCodeAt(0):t[n];return this}),i.indexOf=f(function(t,r){if(r=r||0,0===t.length)return-1;for(var e=r;en?1:-1;for(var i=0;e>i;i++){var o=r[i],f=t[i];if("string"==typeof f&&(f=f.charCodeAt(0)),o!==f)return o>f?1:-1}return 0}),i.concat=function(){for(var r=0,e=0;e2&&(e=e.substring(1,3)),t+=e}return t}),i.fromHex=f(function(){var r=this.length;if(r%2!==0)throw new Error("Invalid hex string length");for(var e=new t(r/2),n=0;n0?Array.prototype.slice.call(arguments):"function"==typeof Uint8Array?[t.prototype,Uint8Array.prototype]:[t.prototype];for(var e=0,n=r.length;n>e;e+=1){var o=r[e];for(var f in i)o[f]=i[f];o!==exports&&(o.concat=function(){var t=[this].concat(Array.prototype.slice.call(arguments));return i.concat.apply(i,t)})}},exports.extend(exports),n.inherits(r,e.EventEmitter),r.prototype._append=function(r,e){if(!this.writable)throw new Error("Stream is not writable.");if(t.isBuffer(r));else{if("string"!=typeof r)throw new Error("Argument should be either a buffer or a string.");r=new t(r,e||"utf8")}this.buffer?this.buffer=i.concat(this.buffer,r):(this.buffer=new t(r.length),r.copy(this.buffer))},r.prototype.write=function(t,r){return this._append(t,r),!0},r.prototype.end=function(t,r){t&&this._append(t,r),this.emit("close"),this.writable=!1},r.prototype.getBuffer=function(){return this.buffer?this.buffer:new t(0)},r.prototype.toString=function(){return this.getBuffer().toString()},exports.WritableBufferStream=r}).call(this,require("buffer").Buffer)},{buffer:29,events:38,util:51}],27:[function(require,module,exports){},{}],28:[function(require,module,exports){function replacer(t,e){return util.isUndefined(e)?""+e:!util.isNumber(e)||!isNaN(e)&&isFinite(e)?util.isFunction(e)||util.isRegExp(e)?e.toString():e:e.toString()}function truncate(t,e){return util.isString(t)?t.length=0;i--)if(s[i]!=n[i])return!1;for(i=s.length-1;i>=0;i--)if(r=s[i],!_deepEqual(t[r],e[r]))return!1;return!0}function expectedException(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function _throws(t,e,r,i){var s;util.isString(r)&&(i=r,r=null);try{e()}catch(n){s=n}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!s&&fail(s,r,"Missing expected exception"+i),!t&&expectedException(s,r)&&fail(s,r,"Got unwanted exception"+i),t&&s&&r&&!expectedException(s,r)||!t&&s)throw s}var util=require("util/"),pSlice=Array.prototype.slice,hasOwn=Object.prototype.hasOwnProperty,assert=module.exports=ok;assert.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var e=t.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var i=r.stack,s=e.name,n=i.indexOf("\n"+s);if(n>=0){var a=i.indexOf("\n",n+1);i=i.substring(a+1)}this.stack=i}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(t,e,r){t!=e&&fail(t,e,r,"==",assert.equal)},assert.notEqual=function(t,e,r){t==e&&fail(t,e,r,"!=",assert.notEqual)},assert.deepEqual=function(t,e,r){_deepEqual(t,e)||fail(t,e,r,"deepEqual",assert.deepEqual)},assert.notDeepEqual=function(t,e,r){_deepEqual(t,e)&&fail(t,e,r,"notDeepEqual",assert.notDeepEqual)},assert.strictEqual=function(t,e,r){t!==e&&fail(t,e,r,"===",assert.strictEqual)},assert.notStrictEqual=function(t,e,r){t===e&&fail(t,e,r,"!==",assert.notStrictEqual)},assert.throws=function(){_throws.apply(this,[!0].concat(pSlice.call(arguments)))},assert.doesNotThrow=function(){_throws.apply(this,[!1].concat(pSlice.call(arguments)))},assert.ifError=function(t){if(t)throw t};var objectKeys=Object.keys||function(t){var e=[];for(var r in t)hasOwn.call(t,r)&&e.push(r);return e}},{"util/":51}],29:[function(require,module,exports){function Buffer(e,t,r){if(!(this instanceof Buffer))return new Buffer(e,t,r);var n=typeof e;if("base64"===t&&"string"===n)for(e=stringtrim(e);e.length%4!==0;)e+="=";var i;if("number"===n)i=coerce(e);else if("string"===n)i=Buffer.byteLength(e,t);else{if("object"!==n)throw new Error("First argument needs to be a number, array or string.");i=coerce(e.length)}var s;Buffer._useTypedArrays?s=Buffer._augment(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(Buffer._useTypedArrays&&"number"==typeof e.byteLength)s._set(e);else if(isArrayish(e))for(a=0;i>a;a++)s[a]=Buffer.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===n)s.write(e,0,t);else if("number"===n&&!Buffer._useTypedArrays&&!r)for(a=0;i>a;a++)s[a]=0;return s}function _hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;assert(s%2===0,"Invalid hex string"),n>s/2&&(n=s/2);for(var a=0;n>a;a++){var o=parseInt(t.substr(2*a,2),16);assert(!isNaN(o),"Invalid hex string"),e[r+a]=o}return Buffer._charsWritten=2*a,a}function _utf8Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf8ToBytes(t),e,r,n);return i}function _asciiWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(asciiToBytes(t),e,r,n);return i}function _binaryWrite(e,t,r,n){return _asciiWrite(e,t,r,n)}function _base64Write(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(base64ToBytes(t),e,r,n);return i}function _utf16leWrite(e,t,r,n){var i=Buffer._charsWritten=blitBuffer(utf16leToBytes(t),e,r,n);return i}function _base64Slice(e,t,r){return base64.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function _utf8Slice(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var s=t;r>s;s++)e[s]<=127?(n+=decodeUtf8Char(i)+String.fromCharCode(e[s]),i=""):i+="%"+e[s].toString(16);return n+decodeUtf8Char(i)}function _asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;i++)n+=String.fromCharCode(e[i]);return n}function _binarySlice(e,t,r){return _asciiSlice(e,t,r)}function _hexSlice(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",s=t;r>s;s++)i+=toHex(e[s]);return i}function _utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",s=0;s=i)){var s;return r?(s=e[t],i>t+1&&(s|=e[t+1]<<8)):(s=e[t]<<8,i>t+1&&(s|=e[t+1])),s}}function _readUInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3=i)){var s;return r?(i>t+2&&(s=e[t+2]<<16),i>t+1&&(s|=e[t+1]<<8),s|=e[t],i>t+3&&(s+=e[t+3]<<24>>>0)):(i>t+1&&(s=e[t+1]<<16),i>t+2&&(s|=e[t+2]<<8),i>t+3&&(s|=e[t+3]),s+=e[t]<<24>>>0),s}}function _readInt16(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+1=i)){var s=_readUInt16(e,t,r,!0),a=32768&s;return a?-1*(65535-s+1):s}}function _readInt32(e,t,r,n){n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(void 0!==t&&null!==t,"missing offset"),assert(t+3=i)){var s=_readUInt32(e,t,r,!0),a=2147483648&s;return a?-1*(4294967295-s+1):s}}function _readFloat(e,t,r,n){return n||(assert("boolean"==typeof r,"missing or invalid endian"),assert(t+3=s))for(var a=0,o=Math.min(s-r,2);o>a;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function _writeUInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s))for(var a=0,o=Math.min(s-r,4);o>a;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function _writeInt16(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+1=s||(t>=0?_writeUInt16(e,t,r,n,i):_writeUInt16(e,65535+t+1,r,n,i))}function _writeInt32(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s||(t>=0?_writeUInt32(e,t,r,n,i):_writeUInt32(e,4294967295+t+1,r,n,i))}function _writeFloat(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+3=s||ieee754.write(e,t,r,n,23,4)}function _writeDouble(e,t,r,n,i){i||(assert(void 0!==t&&null!==t,"missing value"),assert("boolean"==typeof n,"missing or invalid endian"),assert(void 0!==r&&null!==r,"missing offset"),assert(r+7=s||ieee754.write(e,t,r,n,52,8)}function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function clamp(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function coerce(e){return e=~~Math.ceil(+e),0>e?0:e}function isArray(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function isArrayish(e){return isArray(e)||Buffer.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function toHex(e){return 16>e?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e){for(var t=[],r=0;r=n)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&57343>=n&&r++;for(var s=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;a>8,n=t%256,i.push(n),i.push(r);return i}function base64ToBytes(e){return base64.toByteArray(e)}function blitBuffer(e,t,r,n){for(var i=0;n>i&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function decodeUtf8Char(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function verifuint(e,t){assert("number"==typeof e,"cannot write a non-number as a number"),assert(e>=0,"specified a negative value for writing an unsigned value"),assert(t>=e,"value is larger than maximum value for type"),assert(Math.floor(e)===e,"value has a fractional component")}function verifsint(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value"),assert(Math.floor(e)===e,"value has a fractional component") -}function verifIEEE754(e,t,r){assert("number"==typeof e,"cannot write a non-number as a number"),assert(t>=e,"value larger than maximum allowed value"),assert(e>=r,"value smaller than minimum allowed value")}function assert(e,t){if(!e)throw new Error(t||"Failed assertion")}var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192,Buffer._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(r){return!1}}(),Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},Buffer.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=utf8ToBytes(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=base64ToBytes(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},Buffer.concat=function(e,t){if(assert(isArray(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new Buffer(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;rs&&(r=s)):r=s,n=String(n||"utf8").toLowerCase();var a;switch(n){case"hex":a=_hexWrite(this,e,t,r);break;case"utf8":case"utf-8":a=_utf8Write(this,e,t,r);break;case"ascii":a=_asciiWrite(this,e,t,r);break;case"binary":a=_binaryWrite(this,e,t,r);break;case"base64":a=_base64Write(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=_utf16leWrite(this,e,t,r);break;default:throw new Error("Unknown encoding")}return a},Buffer.prototype.toString=function(e,t,r){var n=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=n.length,r===t)return"";var i;switch(e){case"hex":i=_hexSlice(n,t,r);break;case"utf8":case"utf-8":i=_utf8Slice(n,t,r);break;case"ascii":i=_asciiSlice(n,t,r);break;case"binary":i=_binarySlice(n,t,r);break;case"base64":i=_base64Slice(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=_utf16leSlice(n,t,r);break;default:throw new Error("Unknown encoding")}return i},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.copy=function(e,t,r,n){var i=this;if(r||(r=0),n||0===n||(n=this.length),t||(t=0),n!==r&&0!==e.length&&0!==i.length){assert(n>=r,"sourceEnd < sourceStart"),assert(t>=0&&t=0&&r=0&&n<=i.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-ts||!Buffer._useTypedArrays)for(var a=0;s>a;a++)e[a+t]=this[a+r];else e._set(this.subarray(r,r+s),t)}},Buffer.prototype.slice=function(e,t){var r=this.length;if(e=clamp(e,r,0),t=clamp(t,r,r),Buffer._useTypedArrays)return Buffer._augment(this.subarray(e,t));for(var n=t-e,i=new Buffer(n,void 0,!0),s=0;n>s;s++)i[s]=this[s+e];return i},Buffer.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},Buffer.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},Buffer.prototype.readUInt8=function(e,t){return t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e=this.length?void 0:this[e]},Buffer.prototype.readUInt16LE=function(e,t){return _readUInt16(this,e,!0,t)},Buffer.prototype.readUInt16BE=function(e,t){return _readUInt16(this,e,!1,t)},Buffer.prototype.readUInt32LE=function(e,t){return _readUInt32(this,e,!0,t)},Buffer.prototype.readUInt32BE=function(e,t){return _readUInt32(this,e,!1,t)},Buffer.prototype.readInt8=function(e,t){if(t||(assert(void 0!==e&&null!==e,"missing offset"),assert(e=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},Buffer.prototype.readInt16LE=function(e,t){return _readInt16(this,e,!0,t)},Buffer.prototype.readInt16BE=function(e,t){return _readInt16(this,e,!1,t)},Buffer.prototype.readInt32LE=function(e,t){return _readInt32(this,e,!0,t)},Buffer.prototype.readInt32BE=function(e,t){return _readInt32(this,e,!1,t)},Buffer.prototype.readFloatLE=function(e,t){return _readFloat(this,e,!0,t)},Buffer.prototype.readFloatBE=function(e,t){return _readFloat(this,e,!1,t)},Buffer.prototype.readDoubleLE=function(e,t){return _readDouble(this,e,!0,t)},Buffer.prototype.readDoubleBE=function(e,t){return _readDouble(this,e,!1,t)},Buffer.prototype.writeUInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t=this.length||(this[t]=e)},Buffer.prototype.writeUInt16LE=function(e,t,r){_writeUInt16(this,e,t,!0,r)},Buffer.prototype.writeUInt16BE=function(e,t,r){_writeUInt16(this,e,t,!1,r)},Buffer.prototype.writeUInt32LE=function(e,t,r){_writeUInt32(this,e,t,!0,r)},Buffer.prototype.writeUInt32BE=function(e,t,r){_writeUInt32(this,e,t,!1,r)},Buffer.prototype.writeInt8=function(e,t,r){r||(assert(void 0!==e&&null!==e,"missing value"),assert(void 0!==t&&null!==t,"missing offset"),assert(t=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},Buffer.prototype.writeInt16LE=function(e,t,r){_writeInt16(this,e,t,!0,r)},Buffer.prototype.writeInt16BE=function(e,t,r){_writeInt16(this,e,t,!1,r)},Buffer.prototype.writeInt32LE=function(e,t,r){_writeInt32(this,e,t,!0,r)},Buffer.prototype.writeInt32BE=function(e,t,r){_writeInt32(this,e,t,!1,r)},Buffer.prototype.writeFloatLE=function(e,t,r){_writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){_writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){_writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){_writeDouble(this,e,t,!1,r)},Buffer.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),assert("number"==typeof e&&!isNaN(e),"value is not a number"),assert(r>=t,"end < start"),r!==t&&0!==this.length){assert(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var n=t;r>n;n++)this[n]=e}},Buffer.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=toHex(this[r]),r===exports.INSPECT_MAX_BYTES){e[r+1]="...";break}return""},Buffer.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(Buffer._useTypedArrays)return new Buffer(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var BP=Buffer.prototype;Buffer._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=BP.get,e.set=BP.set,e.write=BP.write,e.toString=BP.toString,e.toLocaleString=BP.toString,e.toJSON=BP.toJSON,e.copy=BP.copy,e.slice=BP.slice,e.readUInt8=BP.readUInt8,e.readUInt16LE=BP.readUInt16LE,e.readUInt16BE=BP.readUInt16BE,e.readUInt32LE=BP.readUInt32LE,e.readUInt32BE=BP.readUInt32BE,e.readInt8=BP.readInt8,e.readInt16LE=BP.readInt16LE,e.readInt16BE=BP.readInt16BE,e.readInt32LE=BP.readInt32LE,e.readInt32BE=BP.readInt32BE,e.readFloatLE=BP.readFloatLE,e.readFloatBE=BP.readFloatBE,e.readDoubleLE=BP.readDoubleLE,e.readDoubleBE=BP.readDoubleBE,e.writeUInt8=BP.writeUInt8,e.writeUInt16LE=BP.writeUInt16LE,e.writeUInt16BE=BP.writeUInt16BE,e.writeUInt32LE=BP.writeUInt32LE,e.writeUInt32BE=BP.writeUInt32BE,e.writeInt8=BP.writeInt8,e.writeInt16LE=BP.writeInt16LE,e.writeInt16BE=BP.writeInt16BE,e.writeInt32LE=BP.writeInt32LE,e.writeInt32BE=BP.writeInt32BE,e.writeFloatLE=BP.writeFloatLE,e.writeFloatBE=BP.writeFloatBE,e.writeDoubleLE=BP.writeDoubleLE,e.writeDoubleBE=BP.writeDoubleBE,e.fill=BP.fill,e.inspect=BP.inspect,e.toArrayBuffer=BP.toArrayBuffer,e}},{"base64-js":30,ieee754:31}],30:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function r(t){var r=t.charCodeAt(0);return r===h?62:r===c?63:o>r?-1:o+10>r?r-o+26+26:i+26>r?r-i:A+26>r?r-A+26:void 0}function e(t){function e(t){i[f++]=t}var n,h,c,o,A,i;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=t.length;A="="===t.charAt(u-2)?2:"="===t.charAt(u-1)?1:0,i=new a(3*t.length/4-A),c=A>0?t.length-4:t.length;var f=0;for(n=0,h=0;c>n;n+=4,h+=3)o=r(t.charAt(n))<<18|r(t.charAt(n+1))<<12|r(t.charAt(n+2))<<6|r(t.charAt(n+3)),e((16711680&o)>>16),e((65280&o)>>8),e(255&o);return 2===A?(o=r(t.charAt(n))<<2|r(t.charAt(n+1))>>4,e(255&o)):1===A&&(o=r(t.charAt(n))<<10|r(t.charAt(n+1))<<4|r(t.charAt(n+2))>>2,e(o>>8&255),e(255&o)),i}function n(t){function r(t){return lookup.charAt(t)}function e(t){return r(t>>18&63)+r(t>>12&63)+r(t>>6&63)+r(63&t)}var n,a,h,c=t.length%3,o="";for(n=0,h=t.length-c;h>n;n+=3)a=(t[n]<<16)+(t[n+1]<<8)+t[n+2],o+=e(a);switch(c){case 1:a=t[t.length-1],o+=r(a>>2),o+=r(a<<4&63),o+="==";break;case 2:a=(t[t.length-2]<<8)+t[t.length-1],o+=r(a>>10),o+=r(a>>4&63),o+=r(a<<2&63),o+="="}return o}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,h="+".charCodeAt(0),c="/".charCodeAt(0),o="0".charCodeAt(0),A="a".charCodeAt(0),i="A".charCodeAt(0);t.toByteArray=e,t.fromByteArray=n}("undefined"==typeof exports?this.base64js={}:exports)},{}],31:[function(require,module,exports){exports.read=function(o,t,a,r,h){var M,p,w=8*h-r-1,f=(1<>1,i=-7,n=a?h-1:0,s=a?-1:1,N=o[t+n];for(n+=s,M=N&(1<<-i)-1,N>>=-i,i+=w;i>0;M=256*M+o[t+n],n+=s,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+o[t+n],n+=s,i-=8);if(0===M)M=1-e;else{if(M===f)return p?0/0:1/0*(N?-1:1);p+=Math.pow(2,r),M-=e}return(N?-1:1)*p*Math.pow(2,M-r)},exports.write=function(o,t,a,r,h,M){var p,w,f,e=8*M-h-1,i=(1<>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:M-1,u=r?1:-1,l=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(w=isNaN(t)?1:0,p=i):(p=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-p))<1&&(p--,f*=2),t+=p+n>=1?s/f:s*Math.pow(2,1-n),t*f>=2&&(p++,f/=2),p+n>=i?(w=0,p=i):p+n>=1?(w=(t*f-1)*Math.pow(2,h),p+=n):(w=t*Math.pow(2,n-1)*Math.pow(2,h),p=0));h>=8;o[a+N]=255&w,N+=u,w/=256,h-=8);for(p=p<0;o[a+N]=255&p,N+=u,p/=256,e-=8);o[a+N-u]|=128*l}},{}],32:[function(require,module,exports){function toArray(r,e){if(r.length%intSize!==0){var f=r.length+(intSize-r.length%intSize);r=Buffer.concat([r,zeroBuffer],f)}for(var t=[],n=e?r.readInt32BE:r.readInt32LE,u=0;ublocksize?r=e(r):r.lengthi;i++)t[i]=54^r[i],n[i]=92^r[i];var c=e(Buffer.concat([t,f]));return e(Buffer.concat([n,c]))}function hash(e,r){e=e||"sha1";var f=algorithms[e],t=[],n=0;return f||error("algorithm:",e,"is not yet supported"),{update:function(e){return Buffer.isBuffer(e)||(e=new Buffer(e)),t.push(e),n+=e.length,this},digest:function(e){var n=Buffer.concat(t),i=r?hmac(f,r,n):f(n);return t=null,e?i.toString(e):i}}}function error(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function each(e,r){for(var f in e)r(e[f],f)}var Buffer=require("buffer").Buffer,sha=require("./sha"),sha256=require("./sha256"),rng=require("./rng"),md5=require("./md5"),algorithms={sha1:sha,sha256:sha256,md5:md5},blocksize=64,zeroBuffer=new Buffer(blocksize);zeroBuffer.fill(0),exports.createHash=function(e){return hash(e)},exports.createHmac=function(e,r){return hash(e,r)},exports.randomBytes=function(e,r){if(!r||!r.call)return new Buffer(rng(e));try{r.call(this,void 0,new Buffer(rng(e)))}catch(f){r(f)}},each(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){exports[e]=function(){error("sorry,",e,"is not implemented yet")}})},{"./md5":34,"./rng":35,"./sha":36,"./sha256":37,buffer:29}],34:[function(require,module,exports){function md5_vm_test(){return"900150983cd24fb0d6963f7d28e17f72"==hex_md5("abc")}function core_md5(d,_){d[_>>5]|=128<<_%32,d[(_+64>>>9<<4)+14]=_;for(var m=1732584193,f=-271733879,i=-1732584194,h=271733878,r=0;r>16)+(_>>16)+(m>>16);return f<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}var helpers=require("./helpers");module.exports=function(d){return helpers.hash(d,core_md5,16)}},{"./helpers":32}],35:[function(require,module,exports){!function(){var r,n,t=this;r=function(r){for(var n,n,t=new Array(r),o=0;r>o;o++)0==(3&o)&&(n=4294967296*Math.random()),t[o]=n>>>((3&o)<<3)&255;return t},t.crypto&&crypto.getRandomValues&&(n=function(r){var n=new Uint8Array(r);return crypto.getRandomValues(n),n}),module.exports=n||r}()},{}],36:[function(require,module,exports){function core_sha1(r,a){r[a>>5]|=128<<24-a%32,r[(a+64>>9<<4)+15]=a;for(var e=Array(80),d=1732584193,s=-271733879,f=-1732584194,n=271733878,t=-1009589776,o=0;oi;i++){e[i]=16>i?r[o+i]:rol(e[i-3]^e[i-8]^e[i-14]^e[i-16],1);var v=safe_add(safe_add(rol(d,5),sha1_ft(i,s,f,n)),safe_add(safe_add(t,e[i]),sha1_kt(i)));t=n,n=f,f=rol(s,30),s=d,d=v}d=safe_add(d,_),s=safe_add(s,u),f=safe_add(f,h),n=safe_add(n,l),t=safe_add(t,c)}return Array(d,s,f,n,t)}function sha1_ft(r,a,e,d){return 20>r?a&e|~a&d:40>r?a^e^d:60>r?a&e|a&d|e&d:a^e^d}function sha1_kt(r){return 20>r?1518500249:40>r?1859775393:60>r?-1894007588:-899497514}function safe_add(r,a){var e=(65535&r)+(65535&a),d=(r>>16)+(a>>16)+(e>>16);return d<<16|65535&e}function rol(r,a){return r<>>32-a}var helpers=require("./helpers");module.exports=function(r){return helpers.hash(r,core_sha1,20,!0)}},{"./helpers":32}],37:[function(require,module,exports){var helpers=require("./helpers"),safe_add=function(a,e){var r=(65535&a)+(65535&e),d=(a>>16)+(e>>16)+(r>>16);return d<<16|65535&r},S=function(a,e){return a>>>e|a<<32-e},R=function(a,e){return a>>>e},Ch=function(a,e,r){return a&e^~a&r},Maj=function(a,e,r){return a&e^a&r^e&r},Sigma0256=function(a){return S(a,2)^S(a,13)^S(a,22)},Sigma1256=function(a){return S(a,6)^S(a,11)^S(a,25)},Gamma0256=function(a){return S(a,7)^S(a,18)^R(a,3)},Gamma1256=function(a){return S(a,17)^S(a,19)^R(a,10)},core_sha256=function(a,e){var r,d,n,f,s,t,u,_,o,i,S,c,m=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),h=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),g=new Array(64);a[e>>5]|=128<<24-e%32,a[(e+64>>9<<4)+15]=e;for(var o=0;oi;i++)g[i]=16>i?a[i+o]:safe_add(safe_add(safe_add(Gamma1256(g[i-2]),g[i-7]),Gamma0256(g[i-15])),g[i-16]),S=safe_add(safe_add(safe_add(safe_add(_,Sigma1256(s)),Ch(s,t,u)),m[i]),g[i]),c=safe_add(Sigma0256(r),Maj(r,d,n)),_=u,u=t,t=s,s=safe_add(f,S),f=n,n=d,d=r,r=safe_add(S,c);h[0]=safe_add(r,h[0]),h[1]=safe_add(d,h[1]),h[2]=safe_add(n,h[2]),h[3]=safe_add(f,h[3]),h[4]=safe_add(s,h[4]),h[5]=safe_add(t,h[5]),h[6]=safe_add(u,h[6]),h[7]=safe_add(_,h[7])}return h};module.exports=function(a){return helpers.hash(a,core_sha256,32,!0)}},{"./helpers":32}],38:[function(require,module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!isNumber(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,n,s,i,r,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],isUndefined(n))return!1;if(isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];n.apply(this,i)}else if(isObject(n)){for(s=arguments.length,i=new Array(s-1),r=1;s>r;r++)i[r-1]=arguments[r];for(o=n.slice(),s=o.length,r=0;s>r;r++)o[r].apply(this,i)}return!0},EventEmitter.prototype.addListener=function(e,t){var n;if(!isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,isFunction(t.listener)?t.listener:t),this._events[e]?isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,isObject(this._events[e])&&!this._events[e].warned){var n;n=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){function n(){this.removeListener(e,n),s||(s=!0,t.apply(this,arguments))}if(!isFunction(t))throw TypeError("listener must be a function");var s=!1;return n.listener=t,this.on(e,n),this},EventEmitter.prototype.removeListener=function(e,t){var n,s,i,r;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,s=-1,n===t||isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(n)){for(r=i;r-->0;)if(n[r]===t||n[r].listener&&n[r].listener===t){s=r;break}if(0>s)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],isFunction(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?isFunction(e._events[t])?1:e._events[t].length:0}},{}],39:[function(require,module,exports){module.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}},{}],40:[function(require,module,exports){function noop(){}var process=module.exports={};process.nextTick=function(){var o="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(o)return function(o){return window.setImmediate(o)};if(e){var n=[];return window.addEventListener("message",function(o){var e=o.source;if((e===window||null===e)&&"process-tick"===o.data&&(o.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(o){n.push(o),window.postMessage("process-tick","*")}}return function(o){setTimeout(o,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.on=noop,process.once=noop,process.off=noop,process.emit=noop,process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")}},{}],41:[function(require,module,exports){(function(r){function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}function e(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n=-1&&!s;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(n=i+"/"+n,s="/"===i.charAt(0))}return n=t(e(n.split("/"),function(r){return!!r}),!s).join("/"),(s?"/":"")+n||"."},exports.normalize=function(r){var n=exports.isAbsolute(r),s="/"===o(r,-1);return r=t(e(r.split("/"),function(r){return!!r}),!n).join("/"),r||n||(r="."),r&&s&&(r+="/"),(n?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(e(r,function(r){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;o>u;u++)if(n[u]!==s[u]){i=u;break}for(var l=[],u=i;ut&&(t=r.length+t),r.substr(t,e)}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40}],42:[function(require,module,exports){function Duplex(e){return this instanceof Duplex?(Readable.call(this,e),Writable.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",onend)):new Duplex(e)}function onend(){if(!this.allowHalfOpen&&!this._writableState.ended){var e=this;setImmediate(function(){e.end()})}}module.exports=Duplex;var inherits=require("inherits"),setImmediate=require("process/browser.js").nextTick,Readable=require("./readable.js"),Writable=require("./writable.js");inherits(Duplex,Readable),Duplex.prototype.write=Writable.prototype.write,Duplex.prototype.end=Writable.prototype.end,Duplex.prototype._write=Writable.prototype._write},{"./readable.js":46,"./writable.js":48,inherits:39,"process/browser.js":44}],43:[function(require,module,exports){function Stream(){EE.call(this)}module.exports=Stream;var EE=require("events").EventEmitter,inherits=require("inherits");inherits(Stream,EE),Stream.Readable=require("./readable.js"),Stream.Writable=require("./writable.js"),Stream.Duplex=require("./duplex.js"),Stream.Transform=require("./transform.js"),Stream.PassThrough=require("./passthrough.js"),Stream.Stream=Stream,Stream.prototype.pipe=function(e,r){function t(r){e.writable&&!1===e.write(r)&&m.pause&&m.pause()}function n(){m.readable&&m.resume&&m.resume()}function o(){u||(u=!0,e.end())}function i(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(a(),0===EE.listenerCount(this,"error"))throw e}function a(){m.removeListener("data",t),e.removeListener("drain",n),m.removeListener("end",o),m.removeListener("close",i),m.removeListener("error",s),e.removeListener("error",s),m.removeListener("end",a),m.removeListener("close",a),e.removeListener("close",a)}var m=this;m.on("data",t),e.on("drain",n),e._isStdio||r&&r.end===!1||(m.on("end",o),m.on("close",i));var u=!1;return m.on("error",s),e.on("error",s),m.on("end",a),m.on("close",a),e.on("close",a),e.emit("pipe",m),e}},{"./duplex.js":42,"./passthrough.js":45,"./readable.js":46,"./transform.js":47,"./writable.js":48,events:38,inherits:39}],44:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(n){var o=[];return window.addEventListener("message",function(e){var n=e.source;if((n===window||null===n)&&"process-tick"===e.data&&(e.stopPropagation(),o.length>0)){var r=o.shift();r()}},!0),function(e){o.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")}},{}],45:[function(require,module,exports){function PassThrough(r){return this instanceof PassThrough?void Transform.call(this,r):new PassThrough(r)}module.exports=PassThrough;var Transform=require("./transform.js"),inherits=require("inherits");inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,o){o(null,r)}},{"./transform.js":47,inherits:39}],46:[function(require,module,exports){(function(e){function t(e){e=e||{};var t=e.highWaterMark;this.highWaterMark=t||0===t?t:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(_||(_=require("string_decoder").StringDecoder),this.decoder=new _(e.encoding),this.encoding=e.encoding)}function n(e){return this instanceof n?(this._readableState=new t(e,this),this.readable=!0,void S.call(this)):new n(e)}function r(e,t,n,r,a){var o=d(t,n); -if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||s(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!a){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&a){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||a||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,a?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),h(e,t);else a||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function o(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e,t){var n=null;return R.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function s(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):v(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?E(function(){u(e)}):u(e))}function u(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,E(function(){f(e,t)}))}function f(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;return 0===r.pipesCount?(r.flowing=!1,void(M.listenerCount(e,"data")>0&&b(e))):void(r.ranOut=!0)}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,c(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?E(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,i=t.length,a=!!t.decoder,o=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(o)n=r.shift();else if(!e||e>=i)n=a?r.join(""):R.concat(r,i),r.length=0;else if(el&&e>s;l++){var d=r[0],h=Math.min(e-s,d.length);a?n+=d.slice(0,h):d.copy(n,s,0,h),h0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,E(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function y(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}module.exports=n,n.ReadableState=t;var _,M=require("events").EventEmitter,S=require("./index.js"),R=require("buffer").Buffer,E=require("process/browser.js").nextTick,C=require("inherits");C(n,S),n.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new R(e,t),t="")),r(this,n,e,t,!1)},n.prototype.unshift=function(e){var t=this._readableState;return r(this,t,e,"",!0)},n.prototype.setEncoding=function(e){_||(_=require("string_decoder").StringDecoder),this._readableState.decoder=new _(e),this._readableState.encoding=e};var L=8388608;n.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(e=o(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=o(n,t));var i;return i=e>0?m(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),i},n.prototype._read=function(){this.emit("error",new Error("not implemented"))},n.prototype.pipe=function(t,n){function r(e){e===u&&a()}function i(){t.end()}function a(){t.removeListener("close",d),t.removeListener("finish",s),t.removeListener("drain",m),t.removeListener("error",o),t.removeListener("unpipe",r),u.removeListener("end",i),u.removeListener("end",a),(!t._writableState||t._writableState.needDrain)&&m()}function o(e){l(),0===v&&0===M.listenerCount(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",s),l()}function s(){t.removeListener("close",d),l()}function l(){u.unpipe(t)}var u=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=t;break;case 1:h.pipes=[h.pipes,t];break;default:h.pipes.push(t)}h.pipesCount+=1;var f=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,b=f?i:a;h.endEmitted?E(b):u.once("end",b),t.on("unpipe",r);var m=p(u);t.on("drain",m);var v=M.listenerCount(t,"error");return t.once("error",o),t.once("close",d),t.once("finish",s),t.emit("pipe",u),h.flowing||(this.on("readable",g),h.flowing=!0,E(function(){c(u)})),t},n.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=y(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},n.prototype.on=function(e,t){var n=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):this.read(0))}return n},n.prototype.addListener=n.prototype.on,n.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},n.prototype.pause=function(){b(this,!0),this.emit("pause")},n.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var a=r.push(i);a||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var a=["error","close","destroy","pause","resume"];return w(a,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},n._fromList=m}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":43,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,buffer:29,events:38,inherits:39,"process/browser.js":44,string_decoder:49}],47:[function(require,module,exports){function TransformState(r,t){this.afterTransform=function(r,n){return afterTransform(t,r,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function afterTransform(r,t,n){var e=r._transformState;e.transforming=!1;var a=e.writecb;if(!a)return r.emit("error",new Error("no writecb in Transform class"));e.writechunk=null,e.writecb=null,null!==n&&void 0!==n&&r.push(n),a&&a(t);var i=r._readableState;i.reading=!1,(i.needReadable||i.length=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,r,h),this.charReceived+=h-r,r=h,this.charReceived=55296&&56319>=i)){if(this.charReceived=this.charLength=0,h==e.length)return t;e=e.slice(h,e.length);break}this.charLength+=this.surrogateSize,t=""}var c=this.detectIncompleteChar(e),n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-c,n),this.charReceived=c,n-=c),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,n)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(2>=t&&r>>4==14){this.charLength=3;break}if(3>=t&&r>>3==30){this.charLength=4;break}}return t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,h=this.charBuffer,i=this.encoding;t+=h.slice(0,r).toString(i)}return t}},{buffer:29}],50:[function(require,module,exports){module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8}},{}],51:[function(require,module,exports){(function(e,t){function r(e,t){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&exports._extend(r,t),h(r.showHidden)&&(r.showHidden=!1),h(r.depth)&&(r.depth=2),h(r.colors)&&(r.colors=!1),h(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=n),s(r,e,r.depth)}function n(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function o(e){return e}function i(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==exports.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return x(n)||(n=s(e,n,r)),n}var o=u(e,t);if(o)return o;var g=Object.keys(t),y=i(g);if(e.showHidden&&(g=Object.getOwnPropertyNames(t)),O(t)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return c(t);if(0===g.length){if(S(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(O(t))return c(t)}var m="",b=!1,h=["{","}"];if(f(t)&&(b=!0,h=["[","]"]),S(t)){var w=t.name?": "+t.name:"";m=" [Function"+w+"]"}if(v(t)&&(m=" "+RegExp.prototype.toString.call(t)),j(t)&&(m=" "+Date.prototype.toUTCString.call(t)),O(t)&&(m=" "+c(t)),0===g.length&&(!b||0==t.length))return h[0]+m+h[1];if(0>r)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var z;return z=b?l(e,t,r,y,g):g.map(function(n){return a(e,t,r,y,n,b)}),e.seen.pop(),p(z,m,h)}function u(e,t){if(h(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,r,n,o){for(var i=[],s=0,u=t.length;u>s;++s)i.push(_(t,String(s))?a(e,t,r,n,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(a(e,t,r,n,o,!0))}),i}function a(e,t,r,n,o,i){var u,c,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?c=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),_(n,o)||(u="["+o+"]"),c||(e.seen.indexOf(l.value)<0?(c=y(r)?s(e,l.value,null):s(e,l.value,r-1),c.indexOf("\n")>-1&&(c=i?c.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+c.split("\n").map(function(e){return" "+e}).join("\n"))):c=e.stylize("[Circular]","special")),h(u)){if(i&&o.match(/^\d+$/))return c;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function p(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function f(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function d(e){return null==e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function h(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function j(e){return w(e)&&"[object Date]"===E(e)}function O(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function z(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return Object.prototype.toString.call(e)}function D(e){return 10>e?"0"+e.toString(10):e.toString(10)}function N(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),H[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=/%[sdj%]/g;exports.format=function(e){if(!x(e)){for(var t=[],n=0;n=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),u=o[n];i>n;u=o[++n])s+=y(u)||!w(u)?" "+u:" "+r(u);return s},exports.deprecate=function(r,n){function o(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}if(h(t.process))return function(){return exports.deprecate(r,n).apply(this,arguments)};if(e.noDeprecation===!0)return r;var i=!1;return o};var J,R={};exports.debuglog=function(t){if(h(J)&&(J=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(J)){var r=e.pid;R[t]=function(){var e=exports.format.apply(exports,arguments);console.error("%s %d: %s",t,r,e)}}else R[t]=function(){};return R[t]},exports.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=f,exports.isBoolean=g,exports.isNull=y,exports.isNullOrUndefined=d,exports.isNumber=m,exports.isString=x,exports.isSymbol=b,exports.isUndefined=h,exports.isRegExp=v,exports.isObject=w,exports.isDate=j,exports.isError=O,exports.isFunction=S,exports.isPrimitive=z,exports.isBuffer=require("./support/isBuffer");var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",N(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":50,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,inherits:39}],bufferput:[function(require,module,exports){module.exports=require("aXRuS6")},{}],aXRuS6:[function(require,module,exports){(function(t){function e(){this.words=[],this.len=0}module.exports=e,e.prototype.put=function(t){return this.words.push({buffer:t}),this.len+=t.length,this},e.prototype.word8=function(t){return this.words.push({bytes:1,value:t}),this.len+=1,this},e.prototype.floatle=function(t){return this.words.push({bytes:"float",endian:"little",value:t}),this.len+=4,this},e.prototype.varint=function(t){253>t?this.word8(t):65536>=t?(this.word8(253),this.word16le(t)):1>=t?(this.word8(254),this.word32le(t)):(this.word8(255),this.word64le(t))},[8,16,24,32,64].forEach(function(t){e.prototype["word"+t+"be"]=function(e){return this.words.push({endian:"big",bytes:t/8,value:e}),this.len+=t/8,this},e.prototype["word"+t+"le"]=function(e){return this.words.push({endian:"little",bytes:t/8,value:e}),this.len+=t/8,this}}),e.prototype.pad=function(t){return this.words.push({endian:"big",bytes:t,value:0}),this.len+=t,this},e.prototype.length=function(){return this.len},e.prototype.buffer=function(){var e=new t(this.len),o=0;return this.words.forEach(function(t){if(t.buffer)t.buffer.copy(e,o,0),o+=t.buffer.length;else if("float"==t.bytes){var r=Math.abs(t.value),i=1*(t.value>=0),n=Math.ceil(Math.log(r)/Math.LN2),s=r/(1<=0:l<8*t.bytes;l+=u[1])e[o++]=l>=32?255&Math.floor(t.value/Math.pow(2,l)):t.value>>l&255}),e},e.prototype.write=function(t){t.write(this.buffer())}}).call(this,require("buffer").Buffer)},{buffer:29}],buffers:[function(require,module,exports){module.exports=require("OBo3aV")},{}],OBo3aV:[function(require,module,exports){(function(t){function e(t){return this instanceof e?(this.buffers=t||[],void(this.length=this.buffers.reduce(function(t,e){return t+e.length},0))):new e(t)}module.exports=e,e.prototype.push=function(){for(var e=0;e=0?r:this.length-r,h=[].slice.call(arguments,2);void 0===n?n=this.length-i:n>this.length-i&&(n=this.length-i);for(var r=0;r0){var u=i-o;if(u+nr;r++)p[r]=g[r];for(var a=new t(g.length-u-n),r=u+n;r0){var c=h.slice();c.unshift(p),c.push(a),s.splice.apply(s,[l,1].concat(c)),l+=c.length,h=[]}else s.splice(l,1,p,a),l+=2}else f.push(s[l].slice(u)),s[l]=s[l].slice(0,u),l++}for(h.length>0&&(s.splice.apply(s,[l,0].concat(h)),l+=h.length);f.lengththis.length&&(r=this.length);for(var s=0,i=0;if&&o=r-e?Math.min(u+(r-e)-f,l):l;n[o].copy(h,f,u,g),f+=g-u}return h},e.prototype.pos=function(t){if(0>t||t>=this.length)throw new Error("oob");for(var e=t,r=0,n=null;;){if(n=this.buffers[r],e=this.buffers[s].length;)if(i=0,s++,s>=this.buffers.length)return-1;var l=this.buffers[s][i];if(l==e[h]){if(0==h&&(n={i:s,j:i,pos:f}),h++,h==e.length)return n.pos}else 0!=h&&(s=n.i,i=n.j,f=n.pos,h=0);i++,f++}},e.prototype.toBuffer=function(){return this.slice()},e.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)}}).call(this,require("buffer").Buffer)},{buffer:29}],56:[function(require,module,exports){var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("./elliptic/rand"),elliptic.hmacDRBG=require("./elliptic/hmac-drbg"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec")},{"../package.json":77,"./elliptic/curve":59,"./elliptic/curves":62,"./elliptic/ec":63,"./elliptic/hmac-drbg":66,"./elliptic/rand":67,"./elliptic/utils":68}],57:[function(require,module,exports){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)}function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),getNAF=elliptic.utils.getNAF,getJSF=elliptic.utils.getJSF;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){var n=t._getDoubles(),r=getNAF(e,1),i=(1<=s;e--)a=(a<<1)+r[e];o.push(a)}for(var u=this.jpoint(null,null,null),p=this.jpoint(null,null,null),l=i;l>0;l--){for(var s=0;s=0;a--){for(var e=0;a>=0&&0===o[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),0>a)break;var u=o[a];assert(0!==u),s="affine"===t.type?s.mixedAdd(u>0?i[u-1>>1]:i[-u-1>>1].neg()):s.add(u>0?i[u-1>>1]:i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function(t,e,n,r){for(var i=this._wnafT1,o=this._wnafT2,s=this._wnafT3,a=0,u=0;r>u;u++){var p=e[u],l=p._getNAFPoints(t);i[u]=l.wnd,o[u]=l.points}for(var u=r-1;u>=1;u-=2){var d=u-1,h=u;if(1===i[d]&&1===i[h]){var f=[e[d],null,null,e[h]];0===e[d].y.cmp(e[h].y)?(f[1]=e[d].add(e[h]),f[2]=e[d].toJ().mixedAdd(e[h].neg())):0===e[d].y.cmp(e[h].y.redNeg())?(f[1]=e[d].toJ().mixedAdd(e[h]),f[2]=e[d].add(e[h].neg())):(f[1]=e[d].toJ().mixedAdd(e[h]),f[2]=e[d].toJ().mixedAdd(e[h].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=getJSF(n[d],n[h]);a=Math.max(g[0].length,a),s[d]=new Array(a),s[h]=new Array(a);for(var m=0;a>m;m++){var c=0|g[0][m],w=0|g[1][m];s[d][m]=v[3*(c+1)+(w+1)],s[h][m]=0,o[d]=f}}else s[d]=getNAF(n[d],i[d]),s[h]=getNAF(n[h],i[h]),a=Math.max(s[d].length,a),a=Math.max(s[h].length,a)}for(var b=this.jpoint(null,null,null),y=this._wnafT4,u=a;u>=0;u--){for(var A=0;u>=0;){for(var _=!0,m=0;r>m;m++)y[m]=0|s[m][u],0!==y[m]&&(_=!1);if(!_)break;A++,u--}if(u>=0&&A++,b=b.dblp(A),0>u)break;for(var m=0;r>m;m++){var p,B=y[m];0!==B&&(B>0?p=o[m][B-1>>1]:0>B&&(p=o[m][-B-1>>1].neg()),b="affine"===p.type?b.mixedAdd(p):b.add(p))}}for(var u=0;r>u;u++)o[u]=null;return b.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.validate=function(){return this.curve.validate(this)},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._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles; -for(var n=[this],r=this,i=0;e>i;i+=t){for(var o=0;t>o;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<i;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;t>n;n++)e=e.dbl();return e}},{"../../elliptic":56,assert:28,"bn.js":69}],58:[function(require,module,exports){function EdwardsCurve(t){this.twisted=1!=t.a,this.mOneA=this.twisted&&-1==t.a,this.extended=this.mOneA,Base.call(this,"mont",t),this.a=new bn(t.a,16).mod(this.red.m).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==t.c}function Point(t,e,r,i,d){Base.BasePoint.call(this,t,"projective"),null===e&&null===r&&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(e,16),this.y=new bn(r,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 assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;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.point=function(t,e,r,i){return new Point(this,t,e,r,i)},EdwardsCurve.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},EdwardsCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},EdwardsCurve.prototype.pointFromX=function(t,e){e=new bn(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),d=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(d.redInvm()).redSqrt(),u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s,curve.one)},EdwardsCurve.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),d=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(d)},inherits(Point,Base.BasePoint),Point.fromJSON=function(t,e){return new Point(t,e[0],e[1],e[2])},Point.prototype.inspect=function(){return this.isInfinity()?"":""},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(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),d=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),u=s.redSub(r),n=i.redSub(e),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=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),r=this.y.redSqr();if(this.curve.twisted){var i=this.curve._mulA(e),d=i.redAdd(r);if(this.zOne)var s=t.redSub(e).redSub(r).redMul(d.redSub(this.curve.two)),u=d.redMul(i.redSub(r)),n=d.redSqr().redSub(d).redSub(d);else var h=this.z.redSqr(),o=d.redSub(h).redISub(h),s=t.redSub(e).redISub(r).redMul(o),u=d.redMul(i.redSub(r)),n=d.redMul(o)}else var i=e.redAdd(r),h=this.curve._mulC(redMul(this.z)).redSqr(),o=i.redSub(h).redSub(h),s=this.curve._mulC(t.redISub(i)).redMul(o),u=this.curve._mulC(i).redMul(e.redISub(r)),n=i.redMul(o);return this.curve.point(s,u,n)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=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=r.redSub(e),u=d.redSub(i),n=d.redAdd(i),h=r.redAdd(e),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 e=this.z.redMul(t.z),r=e.redSqr(),i=this.x.redMul(t.x),d=this.y.redMul(t.y),s=this.curve.d.redMul(i).redMul(d),u=r.redSub(s),n=r.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(d),o=e.redMul(u).redMul(h);if(this.curve.twisted)var l=e.redMul(n).redMul(d.redSub(this.curve._mulA(i))),c=u.redMul(n);else var l=e.redMul(n).redMul(d.redSub(i)),c=this.curve._mulC(u).redMul(n);return this.curve.point(o,l,c)},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.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2)},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.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],59:[function(require,module,exports){var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards")},{"./base":57,"./edwards":58,"./mont":60,"./short":61}],60:[function(require,module,exports){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,e,r){Base.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new bn(e,16),this.z=new bn(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.point=function(t,e){return new Point(this,t,e)},MontCurve.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},MontCurve.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),n=i.redSqrt();return 0===n.redSqr().cmp(i)},inherits(Point,Base.BasePoint),Point.prototype.precompute=function(){},Point.fromJSON=function(t,e){return new Point(t,e[0],e[1]||t.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),n=e.redSub(i),o=e.redMul(i),d=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(o,d)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z),d=o.redMul(r),s=n.redMul(i),u=e.z.redMul(d.redAdd(s).redSqr()),h=e.x.redMul(d.redISub(s).redSqr());return this.curve.point(u,h)},Point.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=this,o=[];0!==e.cmpn(0);e.ishrn(1))o.push(e.andln(1));for(var d=o.length-1;d>=0;d--)0===o[d]?(r=r.diffAdd(i,n),i=i.dbl()):(i=r.diffAdd(i,n),r=r.dbl());return i},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},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":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],61:[function(require,module,exports){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 assert=require("assert"),curve=require("../curve"),elliptic=require("../../elliptic"),bn=require("bn.js"),inherits=require("inherits"),Base=curve.base,getNAF=elliptic.utils.getNAF;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=d[0].cmp(d[1])<0?d[0]:d[1],e=e.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(1).toRed(e),new bn(3).toRed(e).redNeg().redSqrt().redMul(t)),n=d.redAdd(i).fromRed(),u=d.redSub(i).fromRed();return[n,u]},ShortCurve.prototype._getEndoBasis=function(r){for(var e,t,d,i,n,u,s,o=this.n.shrn(Math.floor(this.n.bitLength()/2)),h=r,p=this.n.clone(),l=new bn(1),a=new bn(0),b=new bn(0),f=new bn(1),c=0;0!==h.cmpn(0);){var S=p.div(h),v=p.sub(S.mul(h)),I=b.sub(S.mul(l)),y=f.sub(S.mul(a));if(!d&&v.cmp(o)<0)e=s.neg(),t=l,d=v.neg(),i=I;else if(d&&2===++c)break;s=v,p=h,h=v,b=l,l=I,f=a,a=y}n=v.neg(),u=I;var A=d.sqr().add(i.sqr()),m=n.sqr().add(u.sqr());return m.cmp(A)>=0&&(n=e,u=t),d.sign&&(d=d.neg(),i=i.neg()),n.sign&&(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),p=r.sub(u).sub(s),l=o.add(h).neg();return{k1:p,k2:l}},ShortCurve.prototype.point=function(r,e,t){return new Point(this,r,e,t)},ShortCurve.prototype.pointFromX=function(r,e){e=new bn(e,16),e.red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),d=t.redSqrt(),i=d.fromRed().isOdd();return(r&&!i||!r&&i)&&(d=d.redNeg()),this.point(e,d)},ShortCurve.prototype.jpoint=function(r,e,t){return new JPoint(this,r,e,t)},ShortCurve.prototype.pointFromJSON=function(r,e){return Point.fromJSON(this,r,e)},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){for(var t=this._endoWnafT1,d=this._endoWnafT2,i=0;ih;h++)t[h]=null,d[h]=null;return o},inherits(Point,Base.BasePoint),Point.prototype._getBeta=function(){function r(r){return d.point(r.x.redMul(d.endo.beta),r.y)}if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var d=this.curve;e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},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()?"":""},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.precomputed&&this.precomputed.doubles?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.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){function e(r){return r.neg()}if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var d=this.precomputed;t.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(e)},doubles:d.doubles&&{step:d.doubles.step,step:d.doubles.points.map(e)}}}return t},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r},inherits(JPoint,Base.BasePoint),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(),p=h.redMul(s),l=d.redMul(h),a=o.redSqr().redIAdd(p).redISub(l).redISub(l),b=o.redMul(l.redISub(a)).redISub(n.redMul(p)),f=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(a,b,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),p=t.redMul(o),l=s.redSqr().redIAdd(h).redISub(p).redISub(p),a=s.redMul(p.redISub(l)).redISub(i.redMul(h)),b=this.z.redMul(u);return this.curve.jpoint(l,a,b)},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;r>t;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;r>t;t++){var p=n.redSqr(),l=h.redSqr(),a=l.redSqr(),b=p.redAdd(p).redIAdd(p).redIAdd(d.redMul(o)),f=n.redMul(l),c=b.redSqr().redISub(f.redAdd(f)),S=f.redISub(c),v=b.redMul(S);v=v.redIAdd(v).redISub(a);var I=h.redMul(s);r>t+1&&(o=o.redMul(a)),n=c,s=I,h=v}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(){if(this.zOne){var r=this.x.redSqr(),e=this.y.redSqr(),t=e.redSqr(),d=this.x.redAdd(e).redSqr().redISub(r).redISub(t);d=d.redIAdd(d);var i=r.redAdd(r).redIAdd(r),n=i.redSqr().redISub(d).redISub(d),u=t.redIAdd(t);u=u.redIAdd(u),u=u.redIAdd(u);var s=n,o=i.redMul(d.redISub(n)).redISub(u),h=this.y.redAdd(this.y)}else{var p=this.x.redSqr(),l=this.y.redSqr(),a=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(p).redISub(a);b=b.redIAdd(b);var f=p.redAdd(p).redIAdd(p),c=f.redSqr(),S=a.redIAdd(a);S=S.redIAdd(S),S=S.redIAdd(S);var s=c.redISub(b).redISub(b),o=f.redMul(b.redISub(s)).redISub(S),h=this.y.redMul(this.z);h=h.redIAdd(h)}return this.curve.jpoint(s,o,h)},JPoint.prototype._threeDbl=function(){if(this.zOne){var r=this.x.redSqr(),e=this.y.redSqr(),t=e.redSqr(),d=this.x.redAdd(e).redSqr().redISub(r).redISub(t);d=d.redIAdd(d);var i=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),n=i.redSqr().redISub(d).redISub(d),u=n,s=t.redIAdd(t);s=s.redIAdd(s),s=s.redIAdd(s);var o=i.redMul(d.redISub(n)).redISub(s),h=this.y.redAdd(this.y)}else{var p=this.z.redSqr(),l=this.y.redSqr(),a=this.x.redMul(l),b=this.x.redSub(p).redMul(this.x.redAdd(p));b=b.redAdd(b).redIAdd(b);var f=a.redIAdd(a);f=f.redIAdd(f);var c=f.redAdd(f),u=b.redSqr().redISub(c),h=this.y.redAdd(this.z).redSqr().redISub(l).redISub(p),S=l.redSqr();S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var o=b.redMul(f.redISub(u)).redISub(S)}return this.curve.jpoint(u,o,h)},JPoint.prototype._dbl=function(){var r=this.curve.a,e=(this.curve.tinv,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);o=o.redIAdd(o);var h=o.redMul(u),p=s.redSqr().redISub(h.redAdd(h)),l=h.redISub(p),a=u.redSqr();a=a.redIAdd(a),a=a.redIAdd(a),a=a.redIAdd(a);var b=s.redMul(l).redISub(a),f=t.redAdd(t).redMul(d);return this.curve.jpoint(p,b,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);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(n);var s=u.redSqr(),o=d.redIAdd(d);o=o.redIAdd(o),o=o.redIAdd(o),o=o.redIAdd(o);var h=i.redIAdd(u).redSqr().redISub(n).redISub(s).redISub(o),p=e.redMul(h);p=p.redIAdd(p),p=p.redIAdd(p);var l=this.x.redMul(s).redISub(p);l=l.redIAdd(l),l=l.redIAdd(l);var a=this.y.redMul(h.redMul(o.redISub(h)).redISub(u.redMul(s)));a=a.redIAdd(a),a=a.redIAdd(a),a=a.redIAdd(a);var b=this.z.redAdd(u).redSqr().redISub(t).redISub(s);return this.curve.jpoint(l,a,b)},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.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":56,"../curve":59,assert:28,"bn.js":69,inherits:76}],62:[function(require,module,exports){function PresetCurve(f){this.curve="short"===f.type?new elliptic.curve.short(f):"edwards"===f.type?new elliptic.curve.edwards(f):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 d=new PresetCurve(e);return Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,value:d}),d}})}var curves=exports,assert=require("assert"),hash=require("hash.js"),bn=require("bn.js"),elliptic=require("../elliptic");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("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",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"]}),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",{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"]]}}]}) -},{"../elliptic":56,assert:28,"bn.js":69,"hash.js":70}],63:[function(require,module,exports){function EC(t){return this instanceof EC?("string"==typeof t&&(t=elliptic.curves[t]),t instanceof elliptic.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new EC(t)}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils,KeyPair=require("./key"),Signature=require("./signature");module.exports=EC,EC.prototype.keyPair=function(t,e){return new KeyPair(this,t,e)},EC.prototype.genKeyPair=function(t){t||(t={});for(var e=new elliptic.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||elliptic.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new bn(2));;){var r=new bn(e.generate(n));if(!(r.cmp(i)>0))return r.iaddn(1),this.keyPair(r)}},EC.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.shrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},EC.prototype.sign=function(t,e,n){e=this.keyPair(e,"hex"),t=this._truncateToN(new bn(t,16)),n||(n={});for(var i=this.n.byteLength(),r=e.getPrivate().toArray(),h=r.length;21>h;h++)r.unshift(0);for(var s=t.toArray(),h=s.length;i>h;h++)s.unshift(0);for(var u=new elliptic.hmacDRBG({hash:this.hash,entropy:r,nonce:s}),a=this.n.sub(new bn(1));;){var c=new bn(u.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),!(c.cmpn(1)<=0||c.cmp(a)>=0)){var o=this.g.mul(c);if(!o.isInfinity()){var p=o.getX().mod(this.n);if(0!==p.cmpn(0)){var v=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t)).mod(this.n);if(0!==v.cmpn(0))return n.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v)),new Signature(p,v)}}}}},EC.prototype.verify=function(t,e,n){t=this._truncateToN(new bn(t,16)),n=this.keyPair(n,"hex"),e=new Signature(e,"hex");var i=e.r,r=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var h=r.invm(this.n),s=h.mul(t).mod(this.n),u=h.mul(i).mod(this.n),a=this.g.mulAdd(s,n.getPublic(),u);return a.isInfinity()?!1:0===a.getX().mod(this.n).cmp(i)}},{"../../elliptic":56,"./key":64,"./signature":65,assert:28,"bn.js":69}],64:[function(require,module,exports){function KeyPair(t,i,e){return i instanceof KeyPair?i:e instanceof KeyPair?e:(i||(i=e,e=null),null!==i&&"object"==typeof i&&(i.x?(e=i,i=null):(i.priv||i.pub)&&(e=i.pub,i=i.priv)),this.ec=t,this.priv=null,this.pub=null,void(this._importPublicHex(i,e)||("hex"===e&&(e=null),i&&this._importPrivate(i),e&&this._importPublic(e))))}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils;module.exports=KeyPair,KeyPair.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,i){if(this.pub||(this.pub=this.ec.g.mul(this.priv)),"string"==typeof t&&(i=t,t=null),!i)return this.pub;for(var e=this.ec.curve.p.byteLength(),r=this.pub.getX().toArray(),n=r.length;e>n;n++)r.unshift(0);if(t)var u=[this.pub.getY().isEven()?2:3].concat(r);else{for(var s=this.pub.getY().toArray(),n=s.length;e>n;n++)s.unshift(0);var u=[4].concat(r,s)}return utils.encode(u,i)},KeyPair.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16):this.priv},KeyPair.prototype._importPrivate=function(t){this.priv=new bn(t,16),this.priv=this.priv.mod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(t){this.pub=this.ec.curve.point(t.x,t.y)},KeyPair.prototype._importPublicHex=function(t,i){t=utils.toArray(t,i);var e=this.ec.curve.p.byteLength();if(4===t[0]&&t.length-1===2*e)this.pub=this.ec.curve.point(t.slice(1,1+e),t.slice(1+e,1+2*e));else{if(2!==t[0]&&3!==t[0]||t.length-1!==e)return!1;this.pub=this.ec.curve.pointFromX(3===t[0],t.slice(1,1+e))}return!0},KeyPair.prototype.derive=function(t){return t.mul(this.priv).getX()},KeyPair.prototype.sign=function(t){return this.ec.sign(t,this)},KeyPair.prototype.verify=function(t,i){return this.ec.verify(t,i,this)},KeyPair.prototype.inspect=function(){return""}},{"../../elliptic":56,assert:28,"bn.js":69}],65:[function(require,module,exports){function Signature(t,r){return t instanceof Signature?t:void(this._importDER(t,r)||(assert(t&&r,"Signature without r or s"),this.r=new bn(t,16),this.s=new bn(r,16)))}var assert=require("assert"),bn=require("bn.js"),elliptic=require("../../elliptic"),utils=elliptic.utils;module.exports=Signature,Signature.prototype._importDER=function(t,r){if(t=utils.toArray(t,r),t.length<6||48!==t[0]||2!==t[2])return!1;var e=t[1];if(1+e>t.length)return!1;var n=t[3];if(n>=128)return!1;if(4+n+2>=t.length)return!1;if(2!==t[4+n])return!1;var i=t[5+n];return i>=128?!1:4+n+2+i>t.length?!1:(this.r=new bn(t.slice(4,4+n)),this.s=new bn(t.slice(4+n+2,4+n+2+i)),!0)},Signature.prototype.toDER=function(t){var r=this.r.toArray(),e=this.s.toArray();128&r[0]&&(r=[0].concat(r)),128&e[0]&&(e=[0].concat(e));var n=r.length+e.length+4,i=[48,n,2,r.length];return i=i.concat(r,[2,e.length],e),utils.encode(i,t)}},{"../../elliptic":56,assert:28,"bn.js":69}],66:[function(require,module,exports){function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils.toArray(t.entropy,t.entropyEnc),i=utils.toArray(t.nonce,t.nonceEnc),s=utils.toArray(t.pers,t.persEnc);assert(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,s)}var assert=require("assert"),hash=require("hash.js"),elliptic=require("../elliptic"),utils=elliptic.utils;module.exports=HmacDRBG,HmacDRBG.prototype._init=function(t,e,i){var s=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this.reseed=1},HmacDRBG.prototype.generate=function(t,e,i,s){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(s=i,i=e,e=null),i&&(i=utils.toArray(i,s),this._update(i));for(var h=[];h.length>8,i=255&a;s?n.push(s,i):n.push(i)}else for(var t=0;t=0;){var s;if(a.isOdd()){var i=a.andln(t-1);s=i>(t>>1)-1?(t>>1)-i:i,a.isubn(s)}else s=0;n.push(s);for(var o=0!==a.cmpn(0)&&0===a.andln(t-1)?e+1:1,u=1;o>u;u++)n.push(0);a.ishrn(o)}return n}function getJSF(r,e){var n=[[],[]];r=r.clone(),e=e.clone();for(var t=0,a=0;r.cmpn(-t)>0||e.cmpn(-a)>0;){var s=r.andln(3)+t&3,i=e.andln(3)+a&3;3===s&&(s=-1),3===i&&(i=-1);var o;if(0===(1&s))o=0;else{var u=r.andln(7)+t&7;o=3!==u&&5!==u||2!==i?s:-s}n[0].push(o);var l;if(0===(1&i))l=0;else{var u=e.andln(7)+a&7;l=3!==u&&5!==u||2!==s?i:-i}n[1].push(l),2*t===o+1&&(t=1-t),2*a===l+1&&(a=1-a),r.ishrn(1),e.ishrn(1)}return n}var assert=require("assert"),bn=require("bn.js"),utils=exports;utils.toArray=toArray,utils.toHex=toHex,utils.encode=function(r,e){return"hex"===e?toHex(r):r},utils.zero2=zero2,utils.getNAF=getNAF,utils.getJSF=getJSF},{assert:28,"bn.js":69}],69:[function(require,module,exports){function assert(t,r){if(!t)throw new Error(r||"Assertion failed")}function assertEqual(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)}function inherits(t,r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}function BN(t,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,void(null!==t&&this._init(t||0,r||10)))}function zero6(t){return 5===t.length?"0"+t:4===t.length?"00"+t:3===t.length?"000"+t:2===t.length?"0000"+t:1===t.length?"00000"+t:t}function zero14(t){return 13===t.length?"0"+t:12===t.length?"00"+t:11===t.length?"000"+t:10===t.length?"0000"+t:9===t.length?"00000"+t:8===t.length?"000000"+t:7===t.length?"0000000"+t:6===t.length?"00000000"+t:5===t.length?"000000000"+t:4===t.length?"0000000000"+t:3===t.length?"00000000000"+t:2===t.length?"000000000000"+t:1===t.length?"0000000000000"+t:t}function MPrime(t,r){this.name=t,this.p=new BN(r,16),this.n=this.p.bitLength(),this.k=new BN(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var r=BN._prime(t);this.m=r.p,this.prime=r}else this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new BN(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.invm(this.m),this.minv=this.rinv.mul(this.r).sub(new BN(1)).div(this.m).neg().mod(this.r)}module.exports=BN,BN.BN=BN,BN.wordSize=26,BN.prototype._init=function(t,r){if("number"==typeof t)return 0>t&&(this.sign=!0,t=-t),this.words=[67108863&t],void(this.length=1);if("object"==typeof t){assert("number"==typeof t.length),this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var e=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[n]|=e<>>26-s&67108863,s+=24,s>=26&&(s-=26,n++)}return this.strip()}"hex"===r&&(r=16),assert(16>=r),t=t.toString().replace(/\s+/g,"");var h=0;"-"===t[0]&&h++,16===r?this._parseHex(t,h):this._parseBase(t,r,h),"-"===t[0]&&(this.sign=!0),this.strip()},BN.prototype._parseHex=function(t,r){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var i=0;i=r;i-=6){var e=parseInt(t.slice(i,i+6),16);this.words[n]|=e<>>26-s&4194303,s+=24,s>=26&&(s-=26,n++)}if(i+6!==r){var e=parseInt(t.slice(r,i+6),16);this.words[n]|=e<>>26-s&4194303}this.strip()},BN.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var s=0,n=1,e=0,h=null,o=i;o=d?0|d:d>="a"?d.charCodeAt(0)-97+10:d.charCodeAt(0)-65+10,s*=r,s+=f,n*=r,e++,n>1048575&&(assert(67108863>=n),h||(h=new BN(n)),this.mul(h).copy(this),this.iadd(new BN(s)),s=0,n=1,e=0)}0!==e&&(this.mul(new BN(n)).copy(this),this.iadd(new BN(s)))},BN.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},BN.prototype.inspect=function(){return(this.red?""};var div10=new BN(null);div10.words=[8011776,1490116],div10.length=2,BN.prototype.toString=function(t){if(t=t||10,16===t||"hex"===t){for(var r="",i=0,s=0,n=0;n>>24-i&16777215,r=0!==s||n!==this.length-1?zero6(h)+r:h+r,i+=2,i>=26&&(i-=26,n--)}return 0!==s&&(r=s.toString(16)+r),this.sign&&(r="-"+r),r}if(10===t){var r="",o=this.clone();for(o.sign=!1;0!==o.cmpn(0);){var f=o.modn(1e6);o=o.idivn(1e6),r=0!==o.cmpn(0)?zero6(f+"")+r:f+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}assert(!1,"Only 16 and 10 base are supported")},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toArray=function(){this.strip();var t=new Array(this.byteLength());t[0]=0;for(var r=this.clone(),i=0;0!==r.cmpn(0);i++){var s=r.andln(255);r.ishrn(8),t[t.length-i-1]=s}return t},BN.prototype._countBits=function(t){return t>=33554432?26:t>=16777216?25:t>=8388608?24:t>=4194304?23:t>=2097152?22:t>=1048576?21:t>=524288?20:t>=262144?19:t>=131072?18:t>=65536?17:t>=32768?16:t>=16384?15:t>=8192?14:t>=4096?13:t>=2048?12:t>=1024?11:t>=512?10:t>=256?9:t>=128?8:t>=64?7:t>=32?6:t>=16?5:t>=8?4:t>=4?3:t>=2?2:t>=1?1:0},BN.prototype.bitLength=function(){var t=0,r=this.words[this.length-1],t=this._countBits(r);return 26*(this.length-1)+t},BN.prototype.byteLength=function(){this.words[this.length-1];return Math.ceil(this.bitLength()/8)},BN.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},BN.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var r=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var r=this.isub(t);return t.sign=!0,r._normSign()}var i,s;this.length>t.length?(i=this,s=t):(i=t,s=this);for(var n=0,e=0;e>>26}for(;0!==n&&e>>26}if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function(t){if(t.sign){t.sign=!1;var r=this.iadd(t);return t.sign=!0,r._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var i=this.cmp(t);if(0===i)return this.sign=!1,this.length=1,this.words[0]=0,this;if(i>0)var s=this,n=t;else var s=t,n=this;for(var e=0,h=0;hr?(r+=67108864,e=1):e=0,this.words[h]=r}for(;0!==e&&hr?(r+=67108864,e=1):e=0,this.words[h]=r}if(0===e&&h>>26,e=67108863&i,h=Math.min(s,t.length-1),o=Math.max(0,s-this.length+1);h>=o;o++){var f=s-o,d=this.words[f],u=t.words[o],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}r.words[s]=e,i=n}return 0!==i?r.words[s]=i:r.length--,r.strip()},BN.prototype.mul=function(t){var r=new BN(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},BN.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var r=this.length,i=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var s=this.length-2;s>=0;s--){for(var n=0,e=0,h=Math.min(s,i-1),o=Math.max(0,s-r+1);h>=o;o++){var f=s-o,d=this.words[f],u=t.words[o],l=d*u,p=67108863&l;n+=l/67108864|0,p+=e,e=67108863&p,n+=p>>>26}this.words[s]=e,this.words[s+1]+=n,n=0}for(var n=0,f=1;f>>26}return this.strip()},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.mul(this)},BN.prototype.ishln=function(t){assert("number"==typeof t&&t>=0);{var r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;this.clone()}if(0!==r){for(var n=0,e=0;e>>26-r}n&&(this.words[e]=n,this.length++)}if(0!==i){for(var e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(var e=0;i>e;e++)this.words[e]=0;this.length+=i}return this.strip()},BN.prototype.ishrn=function(t,r,i){assert("number"==typeof t&&t>=0),r=r?(r-r%26)/26:0;var s=t%26,n=Math.min((t-s)/26,this.length),e=67108863^67108863>>>s<o;o++)h.words[o]=this.words[o];h.length=n}if(0===n);else if(this.length>n){this.length-=n;for(var o=0;o=0&&(0!==f||o>=r);o--){var d=this.words[o];this.words[o]=f<<26-s|d>>>s,f=d&e}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),i?{hi:this,lo:h}:this},BN.prototype.shln=function(t){return this.clone().ishln(t)},BN.prototype.shrn=function(t){return this.clone().ishrn(t)},BN.prototype.imaskn=function(t){assert("number"==typeof t&&t>=0);var r=t%26,i=(t-r)/26;if(assert(!this.sign,"imaskn works only with positive numbers"),0!==r&&i++,this.length=Math.min(i,this.length),0!==r){var s=67108863^67108863>>>r<t)return this.isubn(t);this.words[0]+=t;for(var r=0;r=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},BN.prototype.isubn=function(t){if(assert("number"==typeof t),assert(this.cmpn(t)>=0,"Sign change is not supported in isubn"),0>t)return this.iaddn(-t);this.words[0]-=t;for(var r=0;rn.length;){var h=67108864*s.words[s.length-1]+s.words[s.length-2],o=h/n.words[n.length-1],f=o/67108864|0,d=67108863&o;o=new BN(null),o.words=[d,f],o.length=2;var i=26*(s.length-n.length-1);if(e){var u=o.shln(i);s.sign?e.isub(u):e.iadd(u)}o=o.mul(n).ishln(i),s.sign?s.iadd(o):s.isub(o)}for(;s.ucmp(n)>=0;){var h=s.words[s.length-1],o=new BN(h/n.words[n.length-1]|0),i=26*(s.length-n.length);if(e){var u=o.shln(i);s.sign?e.isub(u):e.iadd(u)}o=o.mul(n).ishln(i),s.sign?s.iadd(o):s.isub(o)}return s.sign&&(e&&e.isubn(1),s.iadd(n)),{div:e?e:null,mod:s}},BN.prototype.divmod=function(t,r){if(assert(0!==t.cmpn(0)),this.sign&&!t.sign){var i,s,n=this.neg().divmod(t,r);return"mod"!==r&&(i=n.div.neg()),"div"!==r&&(s=0===n.mod.cmpn(0)?n.mod:t.sub(n.mod)),{div:i,mod:s}}if(!this.sign&&t.sign){var i,n=this.divmod(t.neg(),r);return"mod"!==r&&(i=n.div.neg()),{div:i,mod:n.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),r):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===r?{div:this.divn(t.words[0]),mod:null}:"mod"===r?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,r)},BN.prototype.div=function(t){return this.divmod(t,"div").div},BN.prototype.mod=function(t){return this.divmod(t,"mod").mod},BN.prototype.divRound=function(t){var r=this.divmod(t);if(0===r.mod.cmpn(0))return r.div;var i=r.div.sign?r.mod.isub(t):r.mod,s=t.shrn(1),n=t.andln(1),e=i.cmp(s);return 0>e||1===n&&0===e?r.div:r.div.sign?r.div.isubn(1):r.div.iaddn(1)},BN.prototype.modn=function(t){assert(67108863>=t);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+this.words[s])%t;return i},BN.prototype.idivn=function(t){assert(67108863>=t);for(var r=0,i=this.length-1;i>=0;i--){var s=this.words[i]+67108864*r;this.words[i]=s/t|0,r=s%t}return this.strip()},BN.prototype.divn=function(t){return this.clone().idivn(t)},BN.prototype._egcd=function(t,r){assert(!r.sign),assert(0!==r.cmpn(0));var i=this,s=r.clone();i=i.sign?i.mod(r):i.clone();for(var n=new BN(0);i.cmpn(1)>0&&s.cmpn(1)>0;){for(;i.isEven();)i.ishrn(1),t.isEven()?t.ishrn(1):t.iadd(r).ishrn(1);for(;s.isEven();)s.ishrn(1),n.isEven()?n.ishrn(1):n.iadd(r).ishrn(1);i.cmp(s)>=0?(i.isub(s),t.isub(n)):(s.isub(i),n.isub(t))}return 0===i.cmpn(1)?t:n},BN.prototype.invm=function(t){return this._egcd(new BN(1),t).mod(t)},BN.prototype.isEven=function(){return 0===(1&this.words[0])},BN.prototype.isOdd=function(){return 1===(1&this.words[0])},BN.prototype.andln=function(t){return this.words[0]&t},BN.prototype.bincn=function(t){assert("number"==typeof t);var r=t%26,i=(t-r)/26,s=1<n;n++)this.words[n]=0;return this.words[i]|=s,this.length=i+1,this}for(var e=s,n=i;0!==e&&n>>26,h&=67108863,this.words[n]=h}return 0!==e&&(this.words[n]=e,this.length++),this},BN.prototype.cmpn=function(t){var r=0>t;if(r&&(t=-t),this.sign&&!r)return-1;if(!this.sign&&r)return 1;t&=67108863,this.strip();var i;if(this.length>1)i=1;else{var s=this.words[0];i=s===t?0:t>s?-1:1}return this.sign&&(i=-i),i},BN.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var r=this.ucmp(t);return this.sign?-r:r},BN.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length=0;i--){var s=this.words[i],n=t.words[i];if(s!==n){n>s?r=-1:s>n&&(r=1);break}}return r},BN.red=function(t){return new Red(t)},BN.prototype.toRed=function(t){return assert(!this.red,"Already a number in reduction context"),assert(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(t){return this.red=t,this},BN.prototype.forceRed=function(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function(t){var r,i=t;do{var s=i.ishrn(this.n,0,this.tmp);i=this.imulK(s.hi),i=i.iadd(s.lo),r=i.bitLength()}while(r>this.n);var n=r0?i.isub(this.p):i.strip(),i},MPrime.prototype.imulK=function(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=t.length-3;r>=0;r--){var i=t.words[r],s=64*i,n=977*i;s+=n/67108864|0;var e=s/67108864|0;s&=67108863,n&=67108863,t.words[r+2]+=e,t.words[r+1]+=s,t.words[r]=n}var i=t.words[t.length-2];return i>=67108864&&(t.words[t.length-1]+=i>>>26,t.words[t.length-2]=67108863&i),0===t.words[t.length-1]&&t.length--,0===t.words[t.length-1]&&t.length--,t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function(t){for(var r=0,i=0;i>>=26,t.words[i]=n,r=s}return 0!==r&&(t.words[t.length++]=r),t},BN._prime=function t(r){if(primes[r])return primes[r];var t;if("k256"===r)t=new K256;else if("p224"===r)t=new P224;else if("p192"===r)t=new P192;else{if("p25519"!==r)throw new Error("Unknown prime "+r);t=new P25519}return primes[r]=t,t},Red.prototype._verify1=function(t){assert(!t.sign,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function(t,r){assert(!t.sign&&!r.sign,"red works only with positives"),assert(t.red&&t.red===r.red,"red works only with red numbers")},Red.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},Red.prototype.neg=function(t){var r=t.clone();return r.sign=!r.sign,r.iadd(this.m)._forceRed(this)},Red.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Red.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Red.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Red.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Red.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.shln(r))},Red.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Red.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Red.prototype.isqr=function(t){return this.imul(t,t)},Red.prototype.sqr=function(t){return this.mul(t,t)},Red.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var r=this.m.andln(3);if(assert(r%2===1),3===r){var i=this.m.add(new BN(1)).ishrn(2),s=this.pow(t,i);return s}for(var n=this.m.subn(1),e=0;0!==n.cmpn(0)&&0===n.andln(1);)e++,n.ishrn(1);assert(0!==n.cmpn(0));var h=new BN(1).toRed(this),o=h.redNeg(),f=this.m.subn(1).ishrn(1),d=this.m.bitLength();for(d=new BN(2*d*d).toRed(this);0!==this.pow(d,f).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,n),s=this.pow(t,n.addn(1).ishrn(1)),l=this.pow(t,n),p=e;0!==l.cmp(h);){for(var a=l,g=0;0!==a.cmp(h);g++)a=a.redSqr();assert(p>g);var m=this.pow(u,new BN(1).ishln(p-g-1));s=s.redMul(m),u=m.redSqr(),l=l.redMul(u),p=g}return s},Red.prototype.invm=function(t){var r=t._egcd(new BN(1),this.m);return r.sign?(r.sign=!1,this.imod(r).redNeg()):this.imod(r)},Red.prototype.pow=function(t,r){for(var i=[],s=r.clone();0!==s.cmpn(0);)i.push(s.andln(1)),s.ishrn(1);for(var n=t,e=0;e=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},Mont.prototype.mul=function(t,r){if(0===t.cmpn(0)||0===r.cmpn(0))return new BN(0)._forceRed(this);var i=t.mul(r),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).ishrn(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)},Mont.prototype.invm=function(t){var r=this.imod(t.invm(this.m).mul(this.r2));return r._forceRed(this)}},{}],70:[function(require,module,exports){var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.ripemd160=hash.ripemd.ripemd160},{"./hash/common":71,"./hash/hmac":72,"./hash/ripemd":73,"./hash/sha":74,"./hash/utils":75}],71:[function(require,module,exports){function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.endian="big"}var hash=require("../hash"),utils=hash.utils,assert=utils.assert;exports.BlockHash=BlockHash,BlockHash.prototype.update=function(t,i){if(t=utils.toArray(t,i),this.pending=this.pending?this.pending.concat(t):t,this.pendingTotal+=t.length,this.pending.length>=this.blockSize/8){t=this.pending;var n=t.length%(this.blockSize/8);this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=utils.join32(t.slice(0,t.length-n),this.endian);for(var s=0;se;e++)s[e]=0;return t<<=3,"big"===this.endian?(s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=t>>>24&255,s[e++]=t>>>16&255,s[e++]=t>>>8&255,s[e++]=255&t):(s[e++]=255&t,s[e++]=t>>>8&255,s[e++]=t>>>16&255,s[e++]=t>>>24&255,s[e++]=0,s[e++]=0,s[e++]=0,s[e++]=0),s}},{"../hash":70}],72:[function(require,module,exports){function Hmac(t,s,e){return this instanceof Hmac?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,void this._init(utils.toArray(s,e))):new Hmac(t,s,e)}var hmac=exports,hash=require("../hash"),utils=hash.utils,assert=utils.assert;module.exports=Hmac,Hmac.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),assert(t.length<=this.blockSize);for(var s=t.length;s=t?s^h^i:31>=t?s&h|~s&i:47>=t?(s|~h)^i:63>=t?s&i|h&~i:s^(h|~i)}function K(t){return 15>=t?0:31>=t?1518500249:47>=t?1859775393:63>=t?2400959708:2840853838}function Kh(t){return 15>=t?1352829926:31>=t?1548603684:47>=t?1836072691:63>=t?2053994217:0}var hash=require("../hash"),utils=hash.utils,rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=hash.common.BlockHash;utils.inherits(RIPEMD160,BlockHash),exports.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.prototype._update=function(t){for(var h=this.h[0],i=this.h[1],u=this.h[2],l=this.h[3],o=this.h[4],e=h,n=i,m=u,a=l,c=o,_=0;80>_;_++){var D=sum32(rotl32(sum32_4(h,f(_,i,u,l),t[r[_]],K(_)),s[_]),o);h=o,o=l,l=rotl32(u,10),u=i,i=D,D=sum32(rotl32(sum32_4(e,f(79-_,n,m,a),t[rh[_]],Kh(_)),sh[_]),c),e=c,c=a,a=rotl32(m,10),m=n,n=D}D=sum32_3(this.h[1],u,a),this.h[1]=sum32_3(this.h[2],l,c),this.h[2]=sum32_3(this.h[3],o,e),this.h[3]=sum32_3(this.h[4],h,n),this.h[4]=sum32_3(this.h[0],i,m),this.h[0]=D},RIPEMD160.prototype._digest=function(t){return"hex"===t?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":70}],74:[function(require,module,exports){function SHA256(){return this instanceof SHA256?(BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],void(this.k=sha256_K)):new SHA256}function SHA224(){return this instanceof SHA224?(SHA256.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new SHA224}function ch32(t,s,h){return t&s^~t&h}function maj32(t,s,h){return t&s^t&h^s&h}function s0_256(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}function s1_256(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}function g0_256(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}function g1_256(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}var hash=require("../hash"),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.prototype._update=function(t){for(var s=new Array(64),h=0;16>h;h++)s[h]=t[h];for(;h>8,i=255&o;u?e.push(u,i):e.push(i)}else for(var n=0;n>>24|o>>>8&65280|o<<8&16711680|(255&o)<<24,0>o&&(o+=4294967296)),e+=zero8(o.toString(16))}return e}function zero2(t){return 1===t.length?"0"+t:t}function zero8(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function join32(t,r){assert(t.length%4===0);for(var e=new Array(t.length/4),n=0,o=0;nu&&(u+=4294967296),e[n]=u}return e}function split32(t,r){for(var e=new Array(4*t.length),n=0,o=0;n>>24,e[o+1]=u>>>16&255,e[o+2]=u>>>8&255,e[o+3]=255&u):(e[o+3]=u>>>24,e[o+2]=u>>>16&255,e[o+1]=u>>>8&255,e[o]=255&u)}return e}function rotr32(t,r){return t>>>r|t<<32-r}function rotl32(t,r){return t<>>32-r}function sum32(t,r){var e=t+r&4294967295;return 0>e&&(e+=4294967296),e}function sum32_3(t,r,e){var n=t+r+e&4294967295;return 0>n&&(n+=4294967296),n}function sum32_4(t,r,e,n){var o=t+r+e+n&4294967295;return 0>o&&(o+=4294967296),o}function sum32_5(t,r,e,n,o){var u=t+r+e+n+o&4294967295;return 0>u&&(u+=4294967296),u}function assert(t,r){if(!t)throw new Error(r||"Assertion failed")}var utils=exports;utils.toArray=toArray,utils.toHex=toHex,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits="function"==typeof Object.create?function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,r){t.super_=r;var e=function(){};e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t}},{}],76:[function(require,module,exports){module.exports=require(39)},{}],77:[function(require,module,exports){module.exports={name:"elliptic",version:"0.15.7",description:"EC cryptography",main:"lib/elliptic.js",scripts:{test:"mocha --reporter=spec test/*-test.js"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:{name:"Fedor Indutny",email:"fedor@indutny.com"},license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{browserify:"^3.44.2",mocha:"^1.18.2"},dependencies:{"bn.js":"^0.11.6","hash.js":"^0.2.0",inherits:"^2.0.1","uglify-js":"^2.4.13"},_id:"elliptic@0.15.7",_shasum:"33a3cfb88eeeeb04f0bbd06040f2cfc2fba93d2a",_from:"elliptic@=0.15.7",_npmVersion:"1.4.9",_npmUser:{name:"indutny",email:"fedor@indutny.com"},maintainers:[{name:"indutny",email:"fedor@indutny.com"}],dist:{shasum:"33a3cfb88eeeeb04f0bbd06040f2cfc2fba93d2a",tarball:"http://registry.npmjs.org/elliptic/-/elliptic-0.15.7.tgz"},directories:{},_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-0.15.7.tgz",readme:"ERROR: No README data found!"}},{}],78:[function(require,module,exports){var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.ripemd160=hash.ripemd.ripemd160},{"./hash/common":79,"./hash/hmac":80,"./hash/ripemd":81,"./hash/sha":82,"./hash/utils":83}],79:[function(require,module,exports){arguments[4][71][0].apply(exports,arguments)},{"../hash":78}],80:[function(require,module,exports){arguments[4][72][0].apply(exports,arguments)},{"../hash":78}],81:[function(require,module,exports){arguments[4][73][0].apply(exports,arguments)},{"../hash":78}],82:[function(require,module,exports){function SHA256(){return this instanceof SHA256?(BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],void(this.k=sha256_K)):new SHA256}function SHA224(){return this instanceof SHA224?(SHA256.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new SHA224}function SHA1(){return this instanceof SHA1?(BlockHash.call(this),void(this.h=[1732584193,4023233417,2562383102,271733878,3285377520])):new SHA1}function ch32(t,h,s){return t&h^~t&s}function maj32(t,h,s){return t&h^t&s^h&s}function p32(t,h,s){return t^h^s}function s0_256(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}function s1_256(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}function g0_256(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}function g1_256(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}function ft_1(t,h,s,i){return 0===t?ch32(h,s,i):1===t||3===t?p32(h,s,i):2===t?maj32(h,s,i):void 0}var hash=require("../hash"),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],sha1_K=[1518500249,1859775393,2400959708,3395469782];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.prototype._update=function(t){for(var h=new Array(64),s=0;16>s;s++)h[s]=t[s];for(;ss;s++)h[s]=t[s];for(;s>8,o=255&i;u?n.push(u,o):n.push(o)}else for(var e=0;e>>24|i>>>8&65280|i<<8&16711680|(255&i)<<24,0>i&&(i+=4294967296)),n+=zero8(i.toString(16))}return n}function zero2(r){return 1===r.length?"0"+r:r}function zero8(r){return 7===r.length?"0"+r:6===r.length?"00"+r:5===r.length?"000"+r:4===r.length?"0000"+r:3===r.length?"00000"+r:2===r.length?"000000"+r:1===r.length?"0000000"+r:r}function join32(r,t){assert(r.length%4===0);for(var n=new Array(r.length/4),e=0,i=0;eu&&(u+=4294967296),n[e]=u}return n}function split32(r,t){for(var n=new Array(4*r.length),e=0,i=0;e>>24,n[i+1]=u>>>16&255,n[i+2]=u>>>8&255,n[i+3]=255&u):(n[i+3]=u>>>24,n[i+2]=u>>>16&255,n[i+1]=u>>>8&255,n[i]=255&u)}return n}function rotr32(r,t){return r>>>t|r<<32-t}function rotl32(r,t){return r<>>32-t}function sum32(r,t){var n=r+t&4294967295;return 0>n&&(n+=4294967296),n}function sum32_3(r,t,n){var e=r+t+n&4294967295;return 0>e&&(e+=4294967296),e}function sum32_4(r,t,n,e){var i=r+t+n+e&4294967295;return 0>i&&(i+=4294967296),i}function sum32_5(r,t,n,e,i){var u=r+t+n+e+i&4294967295;return 0>u&&(u+=4294967296),u}function assert(r,t){if(!r)throw new Error(t||"Assertion failed")}var utils=exports,inherits=require("inherits");utils.toArray=toArray,utils.toHex=toHex,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits=inherits},{inherits:84}],84:[function(require,module,exports){module.exports=require(39)},{}],85:[function(require,module,exports){(function(n){function t(n,t){this.data=n,t||"string"!=typeof n?("undefined"==typeof this.encodings[t]&&(t="binary"),this.converters=this.encodings[t].converters,this._encoding=this.encodings[t]._encoding):(t="base58",this.converters=this.encodings[t].converters,this._encoding=this.encodings[t]._encoding)}var i=require("../lib/Base58").base58Check;t.prototype.encoding=function(n){return n&&n!=this._encoding&&(this.data=this.as(n),this.converters=this.encodings[n].converters,this._encoding=this.encodings[n]._encoding),this._encoding},t.prototype.withEncoding=function(n){return new t(this.as(n),n)},t.prototype.as=function(n){if(!e[n])throw new Error("invalid encoding: "+n);return this.converters[n].call(this)},t.prototype._validate=function(){this.withEncoding("binary")},t.prototype.isValid=function(){try{return this.validate(),!0}catch(n){return!1}},t.prototype.validate=function(){this._validate()},t.prototype.toString=function(){return this.as("base58")},t.prototype.doAsBinary=function(n){var t=this.encoding();this.encoding("binary"),n.apply(this),this.encoding(t)};var e={binary:{converters:{binary:function(){var t=new n(this.data.length);return this.data.copy(t),t},base58:function(){return i.encode(this.data)},hex:function(){return this.data.toString("hex")}},_validate:function(){}},base58:{converters:{binary:function(){return i.decode(this.data)},hex:function(){return this.withEncoding("binary").as("hex")}}},hex:{converters:{binary:function(){return new n(this.data,"hex")},base58:function(){return this.withEncoding("binary").as("base58")}}}},r=function(){return this.data};for(var o in e)e.hasOwnProperty(o)&&(e[o].converters[o]||(e[o].converters[o]=r),e[o]._encoding=o);t.applyEncodingsTo=function(n){var t={};for(var i in e){var r=e[i],o=Object.create(n.prototype);for(var s in r)o[s]=r[s];t[i]=o}n.prototype.encodings=t},t.applyEncodingsTo(t),module.exports=t}).call(this,require("buffer").Buffer)},{"../lib/Base58":3,buffer:29}],86:[function(require,module,exports){(function(i){function t(e,n){t.super_.call(this,e,n),"number"==typeof e&&(this.data=new i(n.length+1),this.encoding("binary"),this.version(e),this.payload(n))}var e=(require("../lib/Base58").base58Check,require("util")),n=require("./EncodedData");e.inherits(t,n),n.applyEncodingsTo(t),t.prototype.version=function(i){return i||0===i?(this.doAsBinary(function(){this.data.writeUInt8(i,0)}),i):this.as("binary").readUInt8(0)},t.prototype.payload=function(i){return i?(this.doAsBinary(function(){i.copy(this.data,1)}),i):this.as("binary").slice(1)},module.exports=t}).call(this,require("buffer").Buffer)},{"../lib/Base58":3,"./EncodedData":85,buffer:29,util:51}],87:[function(require,module,exports){module.exports=require("./util")},{"./util":"ACyo5H"}],88:[function(require,module,exports){exports.curtime=function(){return Math.round(Date.now()/1e3)}},{}],"./util/util":[function(require,module,exports){module.exports=require("ACyo5H")},{}],ACyo5H:[function(require,module,exports){(function(e,r){function t(e){for(e=e.substr(0,8);e.length<8;)e+="0";return e}function n(e){return i(e[1]).mul("100000000").add(t(e[2]))}function o(e){return i(t(e[1]))}function f(e){return i(e[1]).mul("100000000")}var u=require("crypto"),i=require("bignum"),s=require("binary"),a=require("bufferput"),c=require("buffertools"),l=require("../lib/sjcl");if(e.browser)var h=require("hash.js");{var p=exports.sha256=function(e){return new r(u.createHash("sha256").update(e).digest("binary"),"binary")},v=(exports.sha512=function(t){if(e.browser){var n=t.toString("hex"),o=l.codec.hex.toBits(n),f=l.hash.sha512.hash(o),i=l.codec.hex.fromBits(f),s=new r(i,"hex");return s}return new r(u.createHash("sha512").update(t).digest("binary"),"binary")},exports.sha512hmac=function(t,n){if(e.browser){var o=l.codec.hex.toBits(n.toString("hex")),f=l.codec.hex.toBits(t.toString("hex")),i=new l.misc.hmac(o,l.hash.sha512),s=i.encrypt(f),a=l.codec.hex.fromBits(s),c=new r(a,"hex");return c}var i=u.createHmac("sha512",n),h=i.update(t).digest();return h},exports.ripe160=function(t){if(!r.isBuffer(t))throw new Error("arg should be a buffer");return e.browser?new r(h.ripemd160().update(t).digest()):new r(u.createHash("rmd160").update(t).digest("binary"),"binary")}),w=(exports.sha1=function(e){return new r(u.createHash("sha1").update(e).digest("binary"),"binary")},exports.twoSha256=function(e){return p(p(e))},exports.sha256ripe160=function(e){return v(p(e))},exports.formatHash=function(e){var t=new r(10);return e.copy(t,0,22,32),c.reverse(t).toString("hex")},exports.formatHashFull=function(e){var t=new r(e.length);e.copy(t);var n=c.toHex(c.reverse(t));return n}),d=(exports.formatHashAlt=function(e){var r=w(e);return r=r.replace(/^0*/,""),r.substr(0,10)},exports.formatBuffer=function(e,t){null===t&&(t=10),(t>e.length||0===t)&&(t=e.length);var n=new r(t);e.copy(n,0,0,t);var o=c.toHex(n);return n.length=0&&(t[n]+=1,t[n]>=256&&(t[n]-=256),0===t[n]);n--);return t},exports.intToBuffer2C=function(e){var r=bytesNeededToStore(e),t=new a,n=e.toString(16),o="-"===n[0];n=n.replace("-","");for(var f=0;r>f;f++){var u=n.substring(n.length-2*(f+1),n.length-2*f);1===u.length&&(u="0"+u);var i=parseInt(u,16);t.word8(i)}var s=t.buffer();return o&&(s=c.reverse(s),s=negativeBuffer(s),s=c.reverse(s)),s};var g=function(e){var t;return 128&e[0]?(t=new r(e.length+1),e.copy(t,1),t[0]=0):t=e,t};exports.intToBufferSM=function(e){"number"==typeof e&&(e=i(e));var t,n,o=e.cmp(0);return o>0?(t=e.toBuffer(),n=g(t),n=c.reverse(n)):0==o?n=new r([]):(t=e.neg().toBuffer(),n=g(t),n[0]|=128,n=c.reverse(n)),n},exports.bufferSMToInt=function(e){if(!e.length)return i(0);if(e.length>4)throw new Error("Bigint cast overflow (> 4 bytes)");var t=new r(e.length);e.copy(t),t=c.reverse(t);var n=128&t[0];return n?(t[0]&=127,i.fromBuffer(t).neg()):i.fromBuffer(t)};var x=(exports.formatValue=function(e){for(var r=d(e).toString(),t=r.length>8?r.substr(0,r.length-8):"0",n=r.length>8?r.substr(r.length-8):r;n.length<8;)n="0"+n;for(n=n.replace(/0*$/,"");n.length<2;)n+="0";return t+"."+n},/^\s*(\d+)\.(\d+)/),b=/^\s*\.(\d+)/,B=/^\s*(\d+)/;exports.parseValue=function(e){"string"!=typeof e&&(e=e.toString());var r=e.match(x);return r?n(r):(r=e.match(b))?o(r):(r=e.match(B),r?f(r):void 0)};{var m=(exports.createSynchrotron=function(e){var r={};return function(t){var n=Array.prototype.slice.call(arguments),o=function(){n[0]=function(){r[t]&&(r[t].length?r[t].shift()():delete r[t])},e.apply(null,n)};r[t]?r[t].push(o):(r[t]=[],o())}},exports.decodeDiffBits=function(e,t){e=+e;for(var n=i(16777215&e),o=8*((e>>>24)-3);o-->0;)n=n.mul(2);if(t)return n;var f=n.toBuffer(),u=new r(32);return c.fill(u,0),f.copy(u,32-f.length),u}),y=(exports.encodeDiffBits=function(e){if(r.isBuffer(e))e=i.fromBuffer(e);else if("function"!=typeof e.toBuffer)throw new Error("Incorrect variable type for difficulty");var t=e.toBuffer("mpint"),n=t.length-4,o=n<<24;return n>=1&&(o|=t[4]<<16),n>=2&&(o|=t[5]<<8),n>=3&&(o|=t[6]),o},exports.calcDifficulty=function(e){r.isBuffer(e)||(e=m(e));var t=i.fromBuffer(e,{order:"forward"}),n=i.fromBuffer(S,{order:"forward"});return n.div(t).toNumber()},exports.reverseBytes32=function(e){if(e.length%4)throw new Error("Util.reverseBytes32(): Data length must be multiple of 4");for(var r=new a,t=s.parse(e);!t.eof();){var n=t.word32le("word").vars.word;r.word32be(n)}return r.buffer()},exports.getVarIntSize=function(e){return 253>e?1:65536>e?3:4294967296>e?5:9},exports.varIntBuf=function(e){var t=void 0;return 253>e?(t=new r(1),t.writeUInt8(e,0)):65536>e?(t=new r(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):4294967296>e?(t=new r(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=new r(9),t.writeUInt8(255,0),t.writeInt32LE(-1&e,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t});exports.varStrBuf=function(e){return r.concat([y(e.length),e])}}exports.NULL_HASH=c.fill(new r(32),0),exports.EMPTY_BUFFER=new r(0),exports.ZERO_VALUE=c.fill(new r(8),0);var I=new r("ffffffffffffffff","hex");exports.INT64_MAX=I,exports.COIN=1e8,exports.BIT=100;var S=exports.MAX_TARGET=new r("00000000FFFF0000000000000000000000000000000000000000000000000000","hex")}).call(this,require("/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),require("buffer").Buffer)},{"../lib/sjcl":17,"/var/www/bitpay/bitauth/node_modules/bitcore/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":40,bignum:9,binary:19,buffer:29,bufferput:"aXRuS6",buffertools:"fugeBw",crypto:33,"hash.js":78}]},{},[]);!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.bitauth=e()}}(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;o0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer"); -return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return""};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;iremaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||valuebuf.length)throw new TypeError("index out of range")}Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||valuebuf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;if(end=target.length)throw new TypeError("targetStart out of bounds");if(start<0||start>=source.length)throw new TypeError("sourceStart out of bounds");if(end<0||end>source.length)throw new TypeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start=this.length)throw new TypeError("start out of bounds");if(end<0||end>this.length)throw new TypeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}]},{},[1])(1)}); \ No newline at end of file