├── .editorconfig
├── .gitattributes
├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── dist
├── ethjs-account.js
├── ethjs-account.js.map
└── ethjs-account.min.js
├── docs
├── README.md
├── developer-guide.md
└── user-guide.md
├── internals
└── webpack
│ └── webpack.config.js
├── nano.save
├── package.json
└── src
├── getChecksumAddress.js
├── index.js
└── tests
└── test.index.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = false
6 | indent_style = space
7 | indent_size = 2
8 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
2 |
3 | # Handle line endings automatically for files detected as text
4 | # and leave all files detected as binary untouched.
5 | * text=auto
6 |
7 | #
8 | # The above will handle all files NOT found below
9 | #
10 |
11 | #
12 | ## These files are text and should be normalized (Convert crlf => lf)
13 | #
14 |
15 | # source code
16 | *.php text
17 | *.css text
18 | *.sass text
19 | *.scss text
20 | *.less text
21 | *.styl text
22 | *.js text eol=lf
23 | *.coffee text
24 | *.json text
25 | *.htm text
26 | *.html text
27 | *.xml text
28 | *.svg text
29 | *.txt text
30 | *.ini text
31 | *.inc text
32 | *.pl text
33 | *.rb text
34 | *.py text
35 | *.scm text
36 | *.sql text
37 | *.sh text
38 | *.bat text
39 |
40 | # templates
41 | *.ejs text
42 | *.hbt text
43 | *.jade text
44 | *.haml text
45 | *.hbs text
46 | *.dot text
47 | *.tmpl text
48 | *.phtml text
49 |
50 | # server config
51 | .htaccess text
52 |
53 | # git config
54 | .gitattributes text
55 | .gitignore text
56 | .gitconfig text
57 |
58 | # code analysis config
59 | .jshintrc text
60 | .jscsrc text
61 | .jshintignore text
62 | .csslintrc text
63 |
64 | # misc config
65 | *.yaml text
66 | *.yml text
67 | .editorconfig text
68 |
69 | # build config
70 | *.npmignore text
71 | *.bowerrc text
72 |
73 | # Heroku
74 | Procfile text
75 | .slugignore text
76 |
77 | # Documentation
78 | *.md text
79 | LICENSE text
80 | AUTHORS text
81 |
82 |
83 | #
84 | ## These files are binary and should be left untouched
85 | #
86 |
87 | # (binary is a macro for -text -diff)
88 | *.png binary
89 | *.jpg binary
90 | *.jpeg binary
91 | *.gif binary
92 | *.ico binary
93 | *.mov binary
94 | *.mp4 binary
95 | *.mp3 binary
96 | *.flv binary
97 | *.fla binary
98 | *.swf binary
99 | *.gz binary
100 | *.zip binary
101 | *.7z binary
102 | *.ttf binary
103 | *.eot binary
104 | *.woff binary
105 | *.pyc binary
106 | *.pdf binary
107 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to ethjs-sha3
2 |
3 | Love ethjs-sha3 and want to help? Thanks so much, there's something to do for everybody!
4 |
5 | Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
6 |
7 | Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
8 |
9 | ## Using the issue tracker
10 |
11 | The [issue tracker](https://github.com/ethjs/ethjs-sha3/issues) is
12 | the preferred channel for [bug reports](#bugs), [features requests](#features)
13 | and [submitting pull requests](#pull-requests).
14 |
15 |
16 | ## Bug reports
17 |
18 | A bug is a _demonstrable problem_ that is caused by the code in the repository.
19 | Good bug reports are extremely helpful - thank you!
20 |
21 | Guidelines for bug reports:
22 |
23 | 1. **Use the GitHub issue search** — check if the issue has already been reported.
24 |
25 | 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository.
26 |
27 | 3. **Isolate the problem** —
28 |
29 | A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS
30 | experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
31 |
32 | Example:
33 |
34 | > Short and descriptive example bug report title
35 | >
36 | > A summary of the issue and the browser/OS environment in which it occurs. If
37 | > suitable, include the steps required to reproduce the bug.
38 | >
39 | > 1. This is the first step
40 | > 2. This is the second step
41 | > 3. Further steps, etc.
42 | >
43 | > `` - a link to the reduced test case
44 | >
45 | > Any other information you want to share that is relevant to the issue being
46 | > reported. This might include the lines of code that you have identified as
47 | > causing the bug, and potential solutions (and your opinions on their
48 | > merits).
49 |
50 |
51 |
52 | ## Feature requests
53 |
54 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
55 |
56 |
57 |
58 | ## Pull requests
59 |
60 | Good pull requests - patches, improvements, new features - are a fantastic
61 | help. They should remain focused in scope and avoid containing unrelated
62 | commits.
63 |
64 | **Please ask first** before embarking on any significant pull request (e.g.
65 | implementing features, refactoring code, porting to a different language),
66 | otherwise you risk spending a lot of time working on something that the
67 | project's developers might not want to merge into the project.
68 |
69 | Please adhere to the coding conventions used throughout a project (indentation,
70 | accurate comments, etc.) and any other requirements (such as test coverage).
71 |
72 | Adhering to the following process is the best way to get your work
73 | included in the project:
74 |
75 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes:
76 |
77 | ```bash
78 | # Clone your fork of the repo into the current directory
79 | git clone https://github.com//default.git
80 | # Navigate to the newly cloned directory
81 | cd default
82 | # Assign the original repo to a remote called "upstream"
83 | git remote add upstream https://github.com/ethjs/ethjs-sha3.git
84 | ```
85 |
86 | 2. If you cloned a while ago, get the latest changes from upstream:
87 |
88 | ```bash
89 | git checkout master
90 | git pull upstream master
91 | ```
92 |
93 | 3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
94 |
95 | ```bash
96 | git checkout -b
97 | ```
98 |
99 | 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public.
100 |
101 | 5. Locally merge (or rebase) the upstream development branch into your topic branch:
102 |
103 | ```bash
104 | git pull [--rebase] upstream master
105 | ```
106 |
107 | 6. Push your topic branch up to your fork:
108 |
109 | ```bash
110 | git push origin
111 | ```
112 |
113 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
114 | with a clear title and description.
115 |
116 | **DESIGN NOTE**: default follows the UNIX programming philosophy. Please consider this before contributing, keep your commits/modules concise and to the point.
117 |
118 | Read more here:
119 | http://www.catb.org/esr/writings/taoup/html/ch01s06.html
120 |
121 | **IMPORTANT**: By submitting a patch, you agree to allow the project
122 | owners to license your work under the terms of the [MIT License](LICENSE.txt).
123 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # ethjs-sha3
2 |
3 | Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/ethjs/ethjs-sha3/blob/master/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved.
4 |
5 | **Before opening a new issue, you may find an answer in already closed issues**:
6 | https://github.com/ethjs/ethjs-sha3/issues?q=is%3Aissue+is%3Aclosed
7 |
8 | ## Issue Type
9 |
10 | - [ ] Bug (https://github.com/ethjs/ethjs-sha3/blob/master/.github/CONTRIBUTING.md#bug-reports)
11 | - [ ] Feature (https://github.com/ethjs/ethjs-sha3/blob/master/.github/CONTRIBUTING.md#feature-requests)
12 |
13 | ## Description
14 |
15 | (Add images if possible)
16 |
17 | ## Steps to reproduce
18 |
19 | (Add link to a demo on https://jsfiddle.net or similar if possible)
20 |
21 | # Versions
22 |
23 | - Node/NPM:
24 | - Browser:
25 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## ethjs-sha3
2 |
3 | Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/ethjs/ethjs-sha3/blob/master/.github/CONTRIBUTING.md)
4 | to make the process easy and effective for everyone involved.
5 |
6 | **Please open an issue** before embarking on any significant pull request, especially those that
7 | add a new library or change existing tests, otherwise you risk spending a lot of time working
8 | on something that might not end up being merged into the project.
9 |
10 | Before opening a pull request, please ensure:
11 |
12 | - [ ] You have followed our [**contributing guidelines**](https://github.com/ethjs/ethjs-sha3/blob/master/.github/CONTRIBUTING.md)
13 | - [ ] Pull request has tests (we are going for 100% coverage!)
14 | - [ ] Code is well-commented, linted and follows project conventions
15 | - [ ] Documentation is updated (if necessary)
16 | - [ ] Internal code generators and templates are updated (if necessary)
17 | - [ ] Description explains the issue/use-case resolved and auto-closes related issues
18 |
19 | Be kind to code reviewers, please try to keep pull requests as small and focused as possible :)
20 |
21 | **IMPORTANT**: By submitting a patch, you agree to allow the project
22 | owners to license your work under the terms of the [MIT License](https://github.com/ethjs/ethjs-sha3/blob/master/LICENSE.md).
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Don't check auto-generated stuff into git
2 | node_modules
3 | coverage
4 | lib
5 |
6 | # Cruft
7 | .DS_Store
8 | npm-debug.log
9 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: true
2 | language: node_js
3 | node_js:
4 | - "6"
5 | compiler:
6 | - gcc
7 | - clang
8 | install:
9 | env:
10 | - CXX=g++-4.8
11 | addons:
12 | apt:
13 | sources:
14 | - ubuntu-toolchain-r-test
15 | packages:
16 | - gcc-4.8
17 | - g++-4.8
18 | - clang
19 | after_success: npm run coveralls
20 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 0.1.0 -- first release
2 |
3 | 1. Basic testing
4 | 2. Basic docs
5 | 3. License
6 | 4. Linting
7 | 5. Basic exports
8 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, and in the interest of
4 | fostering an open and welcoming community, we pledge to respect all people who
5 | contribute through reporting issues, posting feature requests, updating
6 | documentation, submitting pull requests or patches, and other activities.
7 |
8 | We are committed to making participation in this project a harassment-free
9 | experience for everyone, regardless of level of experience, gender, gender
10 | identity and expression, sexual orientation, disability, personal appearance,
11 | body size, race, ethnicity, age, religion, or nationality.
12 |
13 | Examples of unacceptable behavior by participants include:
14 |
15 | * The use of sexualized language or imagery
16 | * Personal attacks
17 | * Trolling or insulting/derogatory comments
18 | * Public or private harassment
19 | * Publishing other's private information, such as physical or electronic
20 | addresses, without explicit permission
21 | * Other unethical or unprofessional conduct
22 |
23 | Project maintainers have the right and responsibility to remove, edit, or
24 | reject comments, commits, code, wiki edits, issues, and other contributions
25 | that are not aligned to this Code of Conduct, or to ban temporarily or
26 | permanently any contributor for other behaviors that they deem inappropriate,
27 | threatening, offensive, or harmful.
28 |
29 | By adopting this Code of Conduct, project maintainers commit themselves to
30 | fairly and consistently applying these principles to every aspect of managing
31 | this project. Project maintainers who do not follow or enforce the Code of
32 | Conduct may be permanently removed from the project team.
33 |
34 | This Code of Conduct applies both within project spaces and in public spaces
35 | when an individual is representing the project or its community.
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
38 | reported by contacting the project maintainer at nick.dodson@consensys.net. All
39 | complaints will be reviewed and investigated and will result in a response that
40 | is deemed necessary and appropriate to the circumstances. Maintainers are
41 | obligated to maintain confidentiality with regard to the reporter of an
42 | incident.
43 |
44 |
45 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
46 | version 1.3.0, available at
47 | [http://contributor-covenant.org/version/1/3/0/][version]
48 |
49 | [homepage]: http://contributor-covenant.org
50 | [version]: http://contributor-covenant.org/version/1/3/0/
51 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Nick Dodson
4 | Copyright (c) 2014 Richard Moore
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## ethjs-account
2 |
3 |
37 |
38 |
39 |
40 | A simple Ethereum account utility module.
41 |
42 | Warning: if using with React Native, please use a pre-build distribution (i.e. npm run buld -> /dist/..). We will be switching to the Sepcc256k1 module which should resolve this issue.
43 |
44 | ## Install
45 |
46 | ```
47 | npm install --save ethjs-account
48 | ```
49 |
50 | ## Usage
51 |
52 | ```js
53 | const generate = require('ethjs-account').generate;
54 |
55 | console.log(generate('892h@fsdf11ks8sk^2h8s8shfs.jk39hsoi@hohskd'));
56 |
57 | /* result
58 | {
59 | address: '0x...',
60 | privateKey: '0x...',
61 | publicKey: '0x....',
62 | }
63 | */
64 | ```
65 |
66 | Note, the address exported is the mix case checksum.
67 |
68 | ## About
69 |
70 | This module is meant to aid in the management and generation of Ethereum account keys. It is still pending review. Entropy generation is handled by a combination of sha3 hashing, crypto random bytes and provided entropy salt. It is up the developer to ensure good entropy is generated for the accounts.
71 |
72 | This module contains methods to convert private keys into Buffer public keys, and Buffer public keys into Ethereum addresses. The sha3 method is exposed as it is needed for key generation.
73 |
74 | See the `user-guide` for more details on good entropy generation, and other module information.
75 |
76 | ## Method API
77 |
78 | ```
79 | generate
80 | getAddress
81 | getChecksumAddress
82 | sha3
83 | privateToPublic
84 | publicToAddress
85 | privateToAccount
86 | ```
87 |
88 | ## Contributing
89 |
90 | Please help better the ecosystem by submitting issues and pull requests to `ethjs-account`. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard and the unix philosophy.
91 |
92 | ## Guides
93 |
94 | You'll find more detailed information on using `ethjs-account` and tailoring it to your needs in our guides:
95 |
96 | - [User guide](docs/user-guide.md) - Usage, configuration, FAQ and complementary tools.
97 | - [Developer guide](docs/developer-guide.md) - Contributing to `ethjs-account` and writing your own code and coverage.
98 |
99 | ## Help out
100 |
101 | There is always a lot of work to do, and will have many rules to maintain. So please help out in any way that you can:
102 |
103 | - Create, enhance, and debug ethjs rules (see our guide to ["Working on rules"](./github/CONTRIBUTING.md)).
104 | - Improve documentation.
105 | - Chime in on any open issue or pull request.
106 | - Open new issues about your ideas for making `ethjs-account` better, and pull requests to show us how your idea works.
107 | - Add new tests to *absolutely anything*.
108 | - Create or contribute to ecosystem tools.
109 | - Spread the word!
110 |
111 | Please consult our [Code of Conduct](CODE_OF_CONDUCT.md) docs before helping out.
112 |
113 | We communicate via [issues](https://github.com/ethjs/ethjs-account/issues) and [pull requests](https://github.com/ethjs/ethjs-account/pulls).
114 |
115 | ## Important documents
116 |
117 | - [Changelog](CHANGELOG.md)
118 | - [Code of Conduct](CODE_OF_CONDUCT.md)
119 | - [License](https://raw.githubusercontent.com/ethjs/ethjs-account/master/LICENSE)
120 |
121 | ## Licence
122 |
123 | This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson/2014 Richard Moore. For more information see LICENSE.md.
124 |
125 | ```
126 | The MIT License (MIT)
127 |
128 | Copyright (c) 2016 Nick Dodson
129 | Copyright (c) 2014 Richard Moore
130 |
131 | Permission is hereby granted, free of charge, to any person obtaining a copy
132 | of this software and associated documentation files (the "Software"), to deal
133 | in the Software without restriction, including without limitation the rights
134 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
135 | copies of the Software, and to permit persons to whom the Software is
136 | furnished to do so, subject to the following conditions:
137 | The above copyright notice and this permission notice shall be included in
138 | all copies or substantial portions of the Software.
139 |
140 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
141 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
142 | ```
143 |
144 | ## Original Port Checksum/getAddress Author
145 |
146 | Richard Moore
147 |
--------------------------------------------------------------------------------
/dist/ethjs-account.min.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("ethAccount",[],e):"object"==typeof exports?exports.ethAccount=e():t.ethAccount=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var f=r[i]={i:i,l:!1,exports:{}};return t[i].call(f.exports,f,f.exports,e),f.l=!0,f.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,e,r){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=41)}([function(t,e,r){"use strict";var i=e;i.version=r(33).version,i.utils=r(24),i.rand=r(10),i.hmacDRBG=r(22),i.curve=r(4),i.curves=r(15),i.ec=r(16),i.eddsa=r(19)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw Error(e||"Assertion failed")}function f(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){return n.isBN(t)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))))}function a(t,e,r){for(var i=0,f=Math.min(t.length,r),n=e;f>n;n++){var a=t.charCodeAt(n)-48;i<<=4,i|=49>a||a>54?17>a||a>22?15&a:a-17+10:a-49+10}return i}function d(t,e,r,i){for(var f=0,n=Math.min(t.length,r),a=e;n>a;a++){var d=t.charCodeAt(a)-48;f*=i,f+=49>d?17>d?d:d-17+10:d-49+10}return f}function o(t){for(var e=Array(t.bitLength()),r=0;e.length>r;r++){var i=r/26|0,f=r%26;e[r]=(t.words[i]&1<>>f}return e}function s(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var f=0|t.words[0],n=0|e.words[0],a=f*n,d=67108863&a,o=a/67108864|0;r.words[0]=d;for(var s=1;i>s;s++){for(var h=o>>>26,c=67108863&o,u=Math.min(s,e.length-1),b=Math.max(0,s-t.length+1);u>=b;b++){var l=s-b|0;f=0|t.words[l],n=0|e.words[b],a=f*n+c,h+=a/67108864|0,c=67108863&a}r.words[s]=0|c,o=0|h}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}function h(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,f=0,n=0;r.length-1>n;n++){var a=f;f=0;for(var d=67108863&i,o=Math.min(n,e.length-1),s=Math.max(0,n-t.length+1);o>=s;s++){var h=n-s,c=0|t.words[h],u=0|e.words[s],b=c*u,l=67108863&b;a=a+(b/67108864|0)|0,l=l+d|0,d=67108863&l,a=a+(l>>>26)|0,f+=a>>>26,a&=67108863}r.words[n]=d,i=a,a=f}return 0!==i?r.words[n]=i:r.length--,r.strip()}function c(t,e,r){var i=new u;return i.mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function b(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function m(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function y(t){g.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var w;try{w=r(3).Buffer}catch(M){}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&36>=e),t=(""+t).replace(/\s+/g,"");var f=0;"-"===t[0]&&f++,16===e?this._parseHex(t,f):this._parseBase(t,e,f),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},n.prototype._initNumber=function(t,e,r){0>t&&(this.negative=1,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},n.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),0>=t.length)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var f=0;this.length>f;f++)this.words[f]=0;var n,a,d=0;if("be"===r)for(f=t.length-1,n=0;f>=0;f-=3)a=t[f]|t[f-1]<<8|t[f-2]<<16,this.words[n]|=a<>>26-d&67108863,d+=24,26>d||(d-=26,n++);else if("le"===r)for(f=0,n=0;t.length>f;f+=3)a=t[f]|t[f+1]<<8|t[f+2]<<16,this.words[n]|=a<>>26-d&67108863,d+=24,26>d||(d-=26,n++);return this.strip()},n.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var r=0;this.length>r;r++)this.words[r]=0;var i,f,n=0;for(r=t.length-6,i=0;r>=e;r-=6)f=a(t,r,r+6),this.words[i]|=f<>>26-n&4194303,n+=24,26>n||(n-=26,i++);r+6!==e&&(f=a(t,e,r+6),this.words[i]|=f<>>26-n&4194303),this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,f=1;67108863>=f;f*=e)i++;i--,f=f/e|0;for(var n=t.length-r,a=n%i,o=Math.min(n,n-a)+r,s=0,h=r;o>h;h+=i)s=d(t,h,h+i,e),this.imuln(f),67108864>this.words[0]+s?this.words[0]+=s:this._iaddn(s);if(0!==a){var c=1;for(s=d(t,h,t.length,e),h=0;a>h;h++)c*=e;this.imuln(c),67108864>this.words[0]+s?this.words[0]+=s:this._iaddn(s)}},n.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;this.length>e;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;t>this.length;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var f=0,n=0,a=0;this.length>a;a++){var d=this.words[a],o=(16777215&(d<>>24-f&16777215,r=0!==n||a!==this.length-1?A[6-o.length]+o+r:o+r,f+=2,26>f||(f-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&36>=t){var s=S[t],h=_[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var u=c.modn(h).toString(t);c=c.idivn(h),r=c.isZero()?u+r:A[s-u.length]+u+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,e){return i(void 0!==w),this.toArrayLike(w,t,e)},n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,r){var f=this.byteLength(),n=r||Math.max(1,f);i(n>=f,"byte array longer than desired length"),i(n>0,"Requested array length <= 0"),this.strip();var a,d,o="le"===e,s=new t(n),h=this.clone();if(o){for(d=0;!h.isZero();d++)a=h.andln(255),h.iushrn(8),s[d]=a;for(;n>d;d++)s[d]=0}else{for(d=0;n-f>d;d++)s[d]=0;for(d=0;!h.isZero();d++)a=h.andln(255),h.iushrn(8),s[n-d-1]=a}return s},n.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096>e||(r+=13,e>>>=13),64>e||(r+=7,e>>>=7),8>e||(r+=4,e>>>=4),2>e||(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;this.length>e;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;t.length>this.length;)this.words[this.length++]=0;for(var e=0;t.length>e;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},n.prototype.ior=function(t){return i(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;e.length>r;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},n.prototype.iand=function(t){return i(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;r.length>i;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;e.length>i;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},n.prototype.ixor=function(t){return i(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var f=0;e>f;f++)this.words[f]=67108863&~this.words[f];return r>0&&(this.words[f]=~this.words[f]&67108863>>26-r),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,f=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var f=0,n=0;i.length>n;n++)e=(0|r.words[n])+(0|i.words[n])+f,this.words[n]=67108863&e,f=e>>>26;for(;0!==f&&r.length>n;n++)e=(0|r.words[n])+f,this.words[n]=67108863&e,f=e>>>26;if(this.length=r.length,0!==f)this.words[this.length]=f,this.length++;else if(r!==this)for(;r.length>n;n++)this.words[n]=r.words[n];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var i,f;r>0?(i=this,f=t):(i=t,f=this);for(var n=0,a=0;f.length>a;a++)e=(0|i.words[a])-(0|f.words[a])+n,n=e>>26,this.words[a]=67108863&e;for(;0!==n&&i.length>a;a++)e=(0|i.words[a])+n,n=e>>26,this.words[a]=67108863&e;if(0===n&&i.length>a&&i!==this)for(;i.length>a;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var x=function(t,e,r){var i,f,n,a=t.words,d=e.words,o=r.words,s=0,h=0|a[0],c=8191&h,u=h>>>13,b=0|a[1],l=8191&b,p=b>>>13,m=0|a[2],v=8191&m,g=m>>>13,y=0|a[3],w=8191&y,M=y>>>13,A=0|a[4],S=8191&A,_=A>>>13,x=0|a[5],I=8191&x,R=x>>>13,E=0|a[6],P=8191&E,z=E>>>13,B=0|a[7],k=8191&B,q=B>>>13,T=0|a[8],j=8191&T,N=T>>>13,L=0|a[9],O=8191&L,C=L>>>13,U=0|d[0],Y=8191&U,D=U>>>13,F=0|d[1],J=8191&F,Z=F>>>13,X=0|d[2],V=8191&X,H=X>>>13,K=0|d[3],W=8191&K,G=K>>>13,$=0|d[4],Q=8191&$,tt=$>>>13,et=0|d[5],rt=8191&et,it=et>>>13,ft=0|d[6],nt=8191&ft,at=ft>>>13,dt=0|d[7],ot=8191&dt,st=dt>>>13,ht=0|d[8],ct=8191&ht,ut=ht>>>13,bt=0|d[9],lt=8191&bt,pt=bt>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(c,Y),f=Math.imul(c,D),f=f+Math.imul(u,Y)|0,n=Math.imul(u,D);var mt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(l,Y),f=Math.imul(l,D),f=f+Math.imul(p,Y)|0,n=Math.imul(p,D),i=i+Math.imul(c,J)|0,f=f+Math.imul(c,Z)|0,f=f+Math.imul(u,J)|0,n=n+Math.imul(u,Z)|0;var vt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,Y),f=Math.imul(v,D),f=f+Math.imul(g,Y)|0,n=Math.imul(g,D),i=i+Math.imul(l,J)|0,f=f+Math.imul(l,Z)|0,f=f+Math.imul(p,J)|0,n=n+Math.imul(p,Z)|0,i=i+Math.imul(c,V)|0,f=f+Math.imul(c,H)|0,f=f+Math.imul(u,V)|0,n=n+Math.imul(u,H)|0;var gt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(w,Y),f=Math.imul(w,D),f=f+Math.imul(M,Y)|0,n=Math.imul(M,D),i=i+Math.imul(v,J)|0,f=f+Math.imul(v,Z)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(g,Z)|0,i=i+Math.imul(l,V)|0,f=f+Math.imul(l,H)|0,f=f+Math.imul(p,V)|0,n=n+Math.imul(p,H)|0,i=i+Math.imul(c,W)|0,f=f+Math.imul(c,G)|0,f=f+Math.imul(u,W)|0,n=n+Math.imul(u,G)|0;var yt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(S,Y),f=Math.imul(S,D),f=f+Math.imul(_,Y)|0,n=Math.imul(_,D),i=i+Math.imul(w,J)|0,f=f+Math.imul(w,Z)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(M,Z)|0,i=i+Math.imul(v,V)|0,f=f+Math.imul(v,H)|0,f=f+Math.imul(g,V)|0,n=n+Math.imul(g,H)|0,i=i+Math.imul(l,W)|0,f=f+Math.imul(l,G)|0,f=f+Math.imul(p,W)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(c,Q)|0,f=f+Math.imul(c,tt)|0,f=f+Math.imul(u,Q)|0,n=n+Math.imul(u,tt)|0;var wt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,Y),f=Math.imul(I,D),f=f+Math.imul(R,Y)|0,n=Math.imul(R,D),i=i+Math.imul(S,J)|0,f=f+Math.imul(S,Z)|0,f=f+Math.imul(_,J)|0,n=n+Math.imul(_,Z)|0,i=i+Math.imul(w,V)|0,f=f+Math.imul(w,H)|0,f=f+Math.imul(M,V)|0,n=n+Math.imul(M,H)|0,i=i+Math.imul(v,W)|0,f=f+Math.imul(v,G)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(g,G)|0,i=i+Math.imul(l,Q)|0,f=f+Math.imul(l,tt)|0,f=f+Math.imul(p,Q)|0,n=n+Math.imul(p,tt)|0,i=i+Math.imul(c,rt)|0,f=f+Math.imul(c,it)|0,f=f+Math.imul(u,rt)|0,n=n+Math.imul(u,it)|0;var Mt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(P,Y),f=Math.imul(P,D),f=f+Math.imul(z,Y)|0,n=Math.imul(z,D),i=i+Math.imul(I,J)|0,f=f+Math.imul(I,Z)|0,f=f+Math.imul(R,J)|0,n=n+Math.imul(R,Z)|0,i=i+Math.imul(S,V)|0,f=f+Math.imul(S,H)|0,f=f+Math.imul(_,V)|0,n=n+Math.imul(_,H)|0,i=i+Math.imul(w,W)|0,f=f+Math.imul(w,G)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(M,G)|0,i=i+Math.imul(v,Q)|0,f=f+Math.imul(v,tt)|0,f=f+Math.imul(g,Q)|0,n=n+Math.imul(g,tt)|0,i=i+Math.imul(l,rt)|0,f=f+Math.imul(l,it)|0,f=f+Math.imul(p,rt)|0,n=n+Math.imul(p,it)|0,i=i+Math.imul(c,nt)|0,f=f+Math.imul(c,at)|0,f=f+Math.imul(u,nt)|0,n=n+Math.imul(u,at)|0;var At=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(k,Y),f=Math.imul(k,D),f=f+Math.imul(q,Y)|0,n=Math.imul(q,D),i=i+Math.imul(P,J)|0,f=f+Math.imul(P,Z)|0,f=f+Math.imul(z,J)|0,n=n+Math.imul(z,Z)|0,i=i+Math.imul(I,V)|0,f=f+Math.imul(I,H)|0,f=f+Math.imul(R,V)|0,n=n+Math.imul(R,H)|0,i=i+Math.imul(S,W)|0,f=f+Math.imul(S,G)|0,f=f+Math.imul(_,W)|0,n=n+Math.imul(_,G)|0,i=i+Math.imul(w,Q)|0,f=f+Math.imul(w,tt)|0,f=f+Math.imul(M,Q)|0,n=n+Math.imul(M,tt)|0,i=i+Math.imul(v,rt)|0,f=f+Math.imul(v,it)|0,f=f+Math.imul(g,rt)|0,n=n+Math.imul(g,it)|0,i=i+Math.imul(l,nt)|0,f=f+Math.imul(l,at)|0,f=f+Math.imul(p,nt)|0,n=n+Math.imul(p,at)|0,i=i+Math.imul(c,ot)|0,f=f+Math.imul(c,st)|0,f=f+Math.imul(u,ot)|0,n=n+Math.imul(u,st)|0;var St=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(j,Y),f=Math.imul(j,D),f=f+Math.imul(N,Y)|0,n=Math.imul(N,D),i=i+Math.imul(k,J)|0,f=f+Math.imul(k,Z)|0,f=f+Math.imul(q,J)|0,n=n+Math.imul(q,Z)|0,i=i+Math.imul(P,V)|0,f=f+Math.imul(P,H)|0,f=f+Math.imul(z,V)|0,n=n+Math.imul(z,H)|0,i=i+Math.imul(I,W)|0,f=f+Math.imul(I,G)|0,f=f+Math.imul(R,W)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(S,Q)|0,f=f+Math.imul(S,tt)|0,f=f+Math.imul(_,Q)|0,n=n+Math.imul(_,tt)|0,i=i+Math.imul(w,rt)|0,f=f+Math.imul(w,it)|0,f=f+Math.imul(M,rt)|0,n=n+Math.imul(M,it)|0,i=i+Math.imul(v,nt)|0,f=f+Math.imul(v,at)|0,f=f+Math.imul(g,nt)|0,n=n+Math.imul(g,at)|0,i=i+Math.imul(l,ot)|0,f=f+Math.imul(l,st)|0,f=f+Math.imul(p,ot)|0,n=n+Math.imul(p,st)|0,i=i+Math.imul(c,ct)|0,f=f+Math.imul(c,ut)|0,f=f+Math.imul(u,ct)|0,n=n+Math.imul(u,ut)|0;var _t=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(O,Y),f=Math.imul(O,D),f=f+Math.imul(C,Y)|0,n=Math.imul(C,D),i=i+Math.imul(j,J)|0,f=f+Math.imul(j,Z)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(N,Z)|0,i=i+Math.imul(k,V)|0,f=f+Math.imul(k,H)|0,f=f+Math.imul(q,V)|0,n=n+Math.imul(q,H)|0,i=i+Math.imul(P,W)|0,f=f+Math.imul(P,G)|0,f=f+Math.imul(z,W)|0,n=n+Math.imul(z,G)|0,i=i+Math.imul(I,Q)|0,f=f+Math.imul(I,tt)|0,f=f+Math.imul(R,Q)|0,n=n+Math.imul(R,tt)|0,i=i+Math.imul(S,rt)|0,f=f+Math.imul(S,it)|0,f=f+Math.imul(_,rt)|0,n=n+Math.imul(_,it)|0,i=i+Math.imul(w,nt)|0,f=f+Math.imul(w,at)|0,f=f+Math.imul(M,nt)|0,n=n+Math.imul(M,at)|0,i=i+Math.imul(v,ot)|0,f=f+Math.imul(v,st)|0,f=f+Math.imul(g,ot)|0,n=n+Math.imul(g,st)|0,i=i+Math.imul(l,ct)|0,f=f+Math.imul(l,ut)|0,f=f+Math.imul(p,ct)|0,n=n+Math.imul(p,ut)|0,i=i+Math.imul(c,lt)|0,f=f+Math.imul(c,pt)|0,f=f+Math.imul(u,lt)|0,n=n+Math.imul(u,pt)|0;var xt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(O,J),f=Math.imul(O,Z),f=f+Math.imul(C,J)|0,n=Math.imul(C,Z),i=i+Math.imul(j,V)|0,f=f+Math.imul(j,H)|0,f=f+Math.imul(N,V)|0,n=n+Math.imul(N,H)|0,i=i+Math.imul(k,W)|0,f=f+Math.imul(k,G)|0,f=f+Math.imul(q,W)|0,n=n+Math.imul(q,G)|0,i=i+Math.imul(P,Q)|0,f=f+Math.imul(P,tt)|0,f=f+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,i=i+Math.imul(I,rt)|0,f=f+Math.imul(I,it)|0,f=f+Math.imul(R,rt)|0,n=n+Math.imul(R,it)|0,i=i+Math.imul(S,nt)|0,f=f+Math.imul(S,at)|0,f=f+Math.imul(_,nt)|0,n=n+Math.imul(_,at)|0,i=i+Math.imul(w,ot)|0,f=f+Math.imul(w,st)|0,f=f+Math.imul(M,ot)|0,n=n+Math.imul(M,st)|0,i=i+Math.imul(v,ct)|0,f=f+Math.imul(v,ut)|0,f=f+Math.imul(g,ct)|0,n=n+Math.imul(g,ut)|0,i=i+Math.imul(l,lt)|0,f=f+Math.imul(l,pt)|0,f=f+Math.imul(p,lt)|0,n=n+Math.imul(p,pt)|0;var It=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(O,V),f=Math.imul(O,H),f=f+Math.imul(C,V)|0,n=Math.imul(C,H),i=i+Math.imul(j,W)|0,f=f+Math.imul(j,G)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(N,G)|0,i=i+Math.imul(k,Q)|0,f=f+Math.imul(k,tt)|0,f=f+Math.imul(q,Q)|0,n=n+Math.imul(q,tt)|0,i=i+Math.imul(P,rt)|0,f=f+Math.imul(P,it)|0,f=f+Math.imul(z,rt)|0,n=n+Math.imul(z,it)|0,i=i+Math.imul(I,nt)|0,f=f+Math.imul(I,at)|0,f=f+Math.imul(R,nt)|0,n=n+Math.imul(R,at)|0,i=i+Math.imul(S,ot)|0,f=f+Math.imul(S,st)|0,f=f+Math.imul(_,ot)|0,n=n+Math.imul(_,st)|0,i=i+Math.imul(w,ct)|0,f=f+Math.imul(w,ut)|0,f=f+Math.imul(M,ct)|0,n=n+Math.imul(M,ut)|0,i=i+Math.imul(v,lt)|0,f=f+Math.imul(v,pt)|0,f=f+Math.imul(g,lt)|0,n=n+Math.imul(g,pt)|0;var Rt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(O,W),f=Math.imul(O,G),f=f+Math.imul(C,W)|0,n=Math.imul(C,G),i=i+Math.imul(j,Q)|0,f=f+Math.imul(j,tt)|0,f=f+Math.imul(N,Q)|0,n=n+Math.imul(N,tt)|0,i=i+Math.imul(k,rt)|0,f=f+Math.imul(k,it)|0,f=f+Math.imul(q,rt)|0,n=n+Math.imul(q,it)|0,i=i+Math.imul(P,nt)|0,f=f+Math.imul(P,at)|0,f=f+Math.imul(z,nt)|0,n=n+Math.imul(z,at)|0,i=i+Math.imul(I,ot)|0,f=f+Math.imul(I,st)|0,f=f+Math.imul(R,ot)|0,n=n+Math.imul(R,st)|0,i=i+Math.imul(S,ct)|0,f=f+Math.imul(S,ut)|0,f=f+Math.imul(_,ct)|0,n=n+Math.imul(_,ut)|0,i=i+Math.imul(w,lt)|0,f=f+Math.imul(w,pt)|0,f=f+Math.imul(M,lt)|0,n=n+Math.imul(M,pt)|0;var Et=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(O,Q),f=Math.imul(O,tt),f=f+Math.imul(C,Q)|0,n=Math.imul(C,tt),i=i+Math.imul(j,rt)|0,f=f+Math.imul(j,it)|0,f=f+Math.imul(N,rt)|0,n=n+Math.imul(N,it)|0,i=i+Math.imul(k,nt)|0,f=f+Math.imul(k,at)|0,f=f+Math.imul(q,nt)|0,n=n+Math.imul(q,at)|0,i=i+Math.imul(P,ot)|0,f=f+Math.imul(P,st)|0,f=f+Math.imul(z,ot)|0,n=n+Math.imul(z,st)|0,i=i+Math.imul(I,ct)|0,f=f+Math.imul(I,ut)|0,f=f+Math.imul(R,ct)|0,n=n+Math.imul(R,ut)|0,i=i+Math.imul(S,lt)|0,f=f+Math.imul(S,pt)|0,f=f+Math.imul(_,lt)|0,n=n+Math.imul(_,pt)|0;var Pt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(O,rt),f=Math.imul(O,it),f=f+Math.imul(C,rt)|0,n=Math.imul(C,it),i=i+Math.imul(j,nt)|0,f=f+Math.imul(j,at)|0,f=f+Math.imul(N,nt)|0,n=n+Math.imul(N,at)|0,i=i+Math.imul(k,ot)|0,f=f+Math.imul(k,st)|0,f=f+Math.imul(q,ot)|0,n=n+Math.imul(q,st)|0,i=i+Math.imul(P,ct)|0,f=f+Math.imul(P,ut)|0,f=f+Math.imul(z,ct)|0,n=n+Math.imul(z,ut)|0,i=i+Math.imul(I,lt)|0,f=f+Math.imul(I,pt)|0,f=f+Math.imul(R,lt)|0,n=n+Math.imul(R,pt)|0;var zt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(zt>>>26)|0,zt&=67108863,i=Math.imul(O,nt),f=Math.imul(O,at),f=f+Math.imul(C,nt)|0,n=Math.imul(C,at),i=i+Math.imul(j,ot)|0,f=f+Math.imul(j,st)|0,f=f+Math.imul(N,ot)|0,n=n+Math.imul(N,st)|0,i=i+Math.imul(k,ct)|0,f=f+Math.imul(k,ut)|0,f=f+Math.imul(q,ct)|0,n=n+Math.imul(q,ut)|0,i=i+Math.imul(P,lt)|0,f=f+Math.imul(P,pt)|0,f=f+Math.imul(z,lt)|0,n=n+Math.imul(z,pt)|0;var Bt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(O,ot),f=Math.imul(O,st),f=f+Math.imul(C,ot)|0,n=Math.imul(C,st),i=i+Math.imul(j,ct)|0,f=f+Math.imul(j,ut)|0,f=f+Math.imul(N,ct)|0,n=n+Math.imul(N,ut)|0,i=i+Math.imul(k,lt)|0,f=f+Math.imul(k,pt)|0,f=f+Math.imul(q,lt)|0,n=n+Math.imul(q,pt)|0;var kt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(O,ct),f=Math.imul(O,ut),f=f+Math.imul(C,ct)|0,n=Math.imul(C,ut),i=i+Math.imul(j,lt)|0,f=f+Math.imul(j,pt)|0,f=f+Math.imul(N,lt)|0,n=n+Math.imul(N,pt)|0;var qt=(s+i|0)+((8191&f)<<13)|0;s=(n+(f>>>13)|0)+(qt>>>26)|0,qt&=67108863,i=Math.imul(O,lt),f=Math.imul(O,pt),f=f+Math.imul(C,lt)|0,n=Math.imul(C,pt);var Tt=(s+i|0)+((8191&f)<<13)|0;return s=(n+(f>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,o[0]=mt,o[1]=vt,o[2]=gt,o[3]=yt,o[4]=wt,o[5]=Mt,o[6]=At,o[7]=St,o[8]=_t,o[9]=xt,o[10]=It,o[11]=Rt,o[12]=Et,o[13]=Pt,o[14]=zt,o[15]=Bt,o[16]=kt,o[17]=qt,o[18]=Tt,0!==s&&(o[19]=s,r.length++),r};Math.imul||(x=s),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?x(this,t,e):63>i?s(this,t,e):1024>i?h(this,t,e):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=Array(t),r=n.prototype._countBits(t)-1,i=0;t>i;i++)e[i]=this.revBin(i,r,t);return e},u.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,f=0;e>f;f++)i|=(1&t)<>=1;return i},u.prototype.permute=function(t,e,r,i,f,n){for(var a=0;n>a;a++)i[a]=e[t[a]],f[a]=r[t[a]]},u.prototype.transform=function(t,e,r,i,f,n){this.permute(n,t,e,r,i,f);for(var a=1;f>a;a<<=1)for(var d=a<<1,o=Math.cos(2*Math.PI/d),s=Math.sin(2*Math.PI/d),h=0;f>h;h+=d)for(var c=o,u=s,b=0;a>b;b++){var l=r[h+b],p=i[h+b],m=r[h+b+a],v=i[h+b+a],g=c*m-u*v;v=c*v+u*m,m=g,r[h+b]=l+m,i[h+b]=p+v,r[h+b+a]=l-m,i[h+b+a]=p-v,b!==d&&(g=o*c-s*u,u=o*u+s*c,c=g)}},u.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,f=0;for(r=r/2|0;r;r>>>=1)f++;return 1<1)for(var i=0;r/2>i;i++){var f=t[i];t[i]=t[r-i-1],t[r-i-1]=f,f=e[i],e[i]=-e[r-i-1],e[r-i-1]=-f}},u.prototype.normalize13b=function(t,e){for(var r=0,i=0;e/2>i;i++){var f=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&f,r=67108864>f?0:f/67108864|0}return t},u.prototype.convert13b=function(t,e,r,f){for(var n=0,a=0;e>a;a++)n+=0|t[a],r[2*a]=8191&n,n>>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*e;f>a;++a)r[a]=0;i(0===n),i(0===(n&-8192))},u.prototype.stub=function(t){for(var e=Array(t),r=0;t>r;r++)e[r]=0;return e},u.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),f=this.makeRBT(i),n=this.stub(i),a=Array(i),d=Array(i),o=Array(i),s=Array(i),h=Array(i),c=Array(i),u=r.words;u.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,s,i),this.transform(a,n,d,o,i,f),this.transform(s,n,h,c,i,f);for(var b=0;i>b;b++){var l=d[b]*h[b]-o[b]*c[b];o[b]=d[b]*c[b]+o[b]*h[b],d[b]=l}return this.conjugate(d,o,i),this.transform(d,o,u,n,i,f),this.conjugate(u,n,i),this.normalize13b(u,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=Array(this.length+t.length),c(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){i("number"==typeof t),i(67108864>t);for(var e=0,r=0;this.length>r;r++){var f=(0|this.words[r])*t,n=(67108863&f)+(67108863&e);e>>=26,e+=f/67108864|0,e+=n>>>26,this.words[r]=67108863&n}return 0!==e&&(this.words[r]=e,this.length++),this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=o(t);if(0===e.length)return new n(1);for(var r=this,i=0;e.length>i&&0===e[i];i++,r=r.sqr());if(++ii;i++,f=f.sqr())0!==e[i]&&(r=r.mul(f));return r},n.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,f=(t-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;this.length>e;e++){var d=this.words[e]&n,o=(0|this.words[e])-d<>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==f){for(e=this.length-1;e>=0;e--)this.words[e+f]=this.words[e];for(e=0;f>e;e++)this.words[e]=0;this.length+=f}return this.strip()},n.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,r){i("number"==typeof t&&t>=0);var f;f=e?(e-e%26)/26:0;var n=t%26,a=Math.min((t-n)/26,this.length),d=67108863^67108863>>>n<s;s++)o.words[s]=this.words[s];o.length=a}if(0===a);else if(this.length>a)for(this.length-=a,s=0;this.length>s;s++)this.words[s]=this.words[s+a];else this.words[0]=0,this.length=1;var h=0;for(s=this.length-1;!(0>s||0===h&&f>s);s--){var c=0|this.words[s];this.words[s]=h<<26-n|c>>>n,h=c&d}return o&&0!==h&&(o.words[o.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,f=1<=this.length)return!1;var n=this.words[r];return!!(n&f)},n.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),r>=this.length)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var f=67108863^67108863>>>e<t),0>t?this.isubn(-t):0!==this.negative?1===this.length&&t>(0|this.words[0])?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;this.length>e&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(i("number"==typeof t),i(67108864>t),0>t)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&0>this.words[0])this.words[0]=-this.words[0],this.negative=1;else for(var e=0;this.length>e&&0>this.words[e];e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,r){var f,n=t.length+r;this._expand(n);var a,d=0;for(f=0;t.length>f;f++){a=(0|this.words[f+r])+d;var o=(0|t.words[f])*e;a-=67108863&o,d=(a>>26)-(o/67108864|0),this.words[f+r]=67108863&a}for(;this.length-r>f;f++)a=(0|this.words[f+r])+d,d=a>>26,this.words[f+r]=67108863&a;if(0===d)return this.strip();for(i(d===-1),d=0,f=0;this.length>f;f++)a=-(0|this.words[f])+d,d=a>>26,this.words[f]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),f=t,a=0|f.words[f.length-1],d=this._countBits(a);r=26-d,0!==r&&(f=f.ushln(r),i.iushln(r),a=0|f.words[f.length-1]);var o,s=i.length-f.length;if("mod"!==e){o=new n(null),o.length=s+1,o.words=Array(o.length);for(var h=0;o.length>h;h++)o.words[h]=0}var c=i.clone()._ishlnsubmul(f,1,s);0===c.negative&&(i=c,o&&(o.words[s]=1));for(var u=s-1;u>=0;u--){var b=67108864*(0|i.words[f.length+u])+(0|i.words[f.length+u-1]);for(b=Math.min(b/a|0,67108863),i._ishlnsubmul(f,b,u);0!==i.negative;)b--,i.negative=0,i._ishlnsubmul(f,1,u),i.isZero()||(i.negative^=1);o&&(o.words[u]=b)}return o&&o.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(t,e,r){if(i(!t.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,a,d;return 0!==this.negative&&0===t.negative?(d=this.neg().divmod(t,e),"mod"!==e&&(f=d.div.neg()),"div"!==e&&(a=d.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:f,mod:a}):0===this.negative&&0!==t.negative?(d=this.divmod(t.neg(),e),"mod"!==e&&(f=d.div.neg()),{div:f,mod:d.mod}):0!==(this.negative&t.negative)?(d=this.neg().divmod(t.neg(),e),"div"!==e&&(a=d.mod.neg(),
2 | r&&0!==a.negative&&a.isub(t)),{div:d.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),f=t.andln(1),n=r.cmp(i);return 0>n||1===f&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(t){i(67108863>=t);for(var e=(1<<26)%t,r=0,f=this.length-1;f>=0;f--)r=(e*r+(0|this.words[f]))%t;return r},n.prototype.idivn=function(t){i(67108863>=t);for(var e=0,r=this.length-1;r>=0;r--){var f=(0|this.words[r])+67108864*e;this.words[r]=f/t|0,e=f%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var f=new n(1),a=new n(0),d=new n(0),o=new n(1),s=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++s;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var u=0,b=1;0===(e.words[0]&b)&&26>u;++u,b<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(f.isOdd()||a.isOdd())&&(f.iadd(h),a.isub(c)),f.iushrn(1),a.iushrn(1);for(var l=0,p=1;0===(r.words[0]&p)&&26>l;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(d.isOdd()||o.isOdd())&&(d.iadd(h),o.isub(c)),d.iushrn(1),o.iushrn(1);e.cmp(r)<0?(r.isub(e),d.isub(f),o.isub(a)):(e.isub(r),f.isub(d),a.isub(o))}return{a:d,b:o,gcd:r.iushln(s)}},n.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var f=new n(1),a=new n(0),d=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var o=0,s=1;0===(e.words[0]&s)&&26>o;++o,s<<=1);if(o>0)for(e.iushrn(o);o-- >0;)f.isOdd()&&f.iadd(d),f.iushrn(1);for(var h=0,c=1;0===(r.words[0]&c)&&26>h;++h,c<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(d),a.iushrn(1);e.cmp(r)<0?(r.isub(e),a.isub(f)):(e.isub(r),f.isub(a))}var u;return u=0===e.cmpn(1)?f:a,u.cmpn(0)<0&&u.iadd(t),u},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var f=e.cmp(r);if(0>f){var n=e;e=r,r=n}else if(0===f||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0===(1&this.words[0])},n.prototype.isOdd=function(){return 1===(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,f=1<=this.length)return this._expand(r+1),this.words[r]|=f,this;for(var n=f,a=r;0!==n&&this.length>a;a++){var d=0|this.words[a];d+=n,n=d>>>26,d&=67108863,this.words[a]=d}return 0!==n&&(this.words[a]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e=0>t;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),i(67108863>=t,"Number is too big");var f=0|this.words[0];r=f===t?0:t>f?-1:1}return 0!==this.negative?0|-r:r},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(t.length>this.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],f=0|t.words[r];if(i!==f){f>i?e=-1:i>f&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return this.cmpn(t)===-1},n.prototype.lt=function(t){return this.cmp(t)===-1},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new g(t)},n.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var I={k256:null,p224:null,p192:null,p25519:null};b.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength();while(e>this.n);var i=this.n>e?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},f(l,b),l.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),f=0;i>f;f++)e.words[f]=t.words[f];if(e.length=i,9>=t.length)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=n&r,f=10;t.length>f;f++){var a=0|t.words[f];t.words[f-10]=(a&r)<<4|n>>>22,n=a}n>>>=22,t.words[f-10]=n,t.length-=0===n&&t.length>10?10:9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;t.length>r;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},f(p,b),f(m,b),f(v,b),v.prototype.imulK=function(t){for(var e=0,r=0;t.length>r;r++){var i=19*(0|t.words[r])+e,f=67108863&i;i>>>=26,t.words[r]=f,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function R(t){if(I[t])return I[t];var R;if("k256"===t)R=new l;else if("p224"===t)R=new p;else if("p192"===t)R=new m;else{if("p25519"!==t)throw Error("Unknown prime "+t);R=new v}return I[t]=R,R},g.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},g.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)<0||r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)<0||r.isub(this.m),r},g.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new n(1)).iushrn(2);return this.pow(t,r)}for(var f=this.m.subn(1),a=0;!f.isZero()&&0===f.andln(1);)a++,f.iushrn(1);i(!f.isZero());var d=new n(1).toRed(this),o=d.redNeg(),s=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,s).cmp(o);)h.redIAdd(o);for(var c=this.pow(h,f),u=this.pow(t,f.addn(1).iushrn(1)),b=this.pow(t,f),l=a;0!==b.cmp(d);){for(var p=b,m=0;0!==p.cmp(d);m++)p=p.redSqr();i(l>m);var v=this.pow(c,new n(1).iushln(l-m-1));u=u.redMul(v),c=v.redSqr(),b=b.redMul(c),l=m}return u},g.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},g.prototype.pow=function(t,e){if(e.isZero())return new n(1);if(0===e.cmpn(1))return t.clone();var r=4,i=Array(1<f;f++)i[f]=this.mul(i[f-1],t);var a=i[0],d=0,o=0,s=e.bitLength()%26;for(0===s&&(s=26),f=e.length-1;f>=0;f--){for(var h=e.words[f],c=s-1;c>=0;c--){var u=h>>c&1;a!==i[0]&&(a=this.sqr(a)),0!==u||0!==d?(d<<=1,d|=u,o++,(o===r||0===f&&0===c)&&(a=this.mul(a,i[d]),o=0,d=0)):o=0}s=26}return a},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new y(t)},f(y,g),y.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},y.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},y.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(i).iushrn(this.shift),n=f;return f.cmp(this.m)<0?f.cmpn(0)<0&&(n=f.iadd(this.m)):n=f.isub(this.m),n._forceRed(this)},y.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=r.isub(i).iushrn(this.shift),a=f;return f.cmp(this.m)<0?f.cmpn(0)<0&&(a=f.iadd(this.m)):a=f.isub(this.m),a._forceRed(this)},y.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}(void 0===t||t,this)}).call(e,r(39)(t))},function(t,e,r){var i=e;i.utils=r(29),i.common=r(25),i.sha=r(28),i.ripemd=r(27),i.hmac=r(26),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e,r){"use strict";(function(t,i){function f(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function n(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,r){if(n()t)throw new RangeError('"size" argument must not be negative')}function s(t,e,r,i){return o(e),e>0&&void 0!==r?"string"==typeof i?a(t,e).fill(r,i):a(t,e).fill(r):a(t,e)}function h(e,r){if(o(r),e=a(e,0>r?0:0|p(r)),!t.TYPED_ARRAY_SUPPORT)for(var i=0;r>i;++i)e[i]=0;return e}function c(e,r,i){if("string"==typeof i&&""!==i||(i="utf8"),!t.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var f=0|v(r,i);e=a(e,f);var n=e.write(r,i);return n!==f&&(e=e.slice(0,n)),e}function u(t,e){var r=0>e.length?0:0|p(e.length);t=a(t,r);for(var i=0;r>i;i+=1)t[i]=255&e[i];return t}function b(e,r,i,f){if(0>i||i>r.byteLength)throw new RangeError("'offset' is out of bounds");if(i+(f||0)>r.byteLength)throw new RangeError("'length' is out of bounds");return r=void 0===i&&void 0===f?new Uint8Array(r):void 0===f?new Uint8Array(r,i):new Uint8Array(r,i,f),t.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=t.prototype):e=u(e,r),e}function l(e,r){if(t.isBuffer(r)){var i=0|p(r.length);return e=a(e,i),0===e.length?e:(r.copy(e,0,0,i),e)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?a(e,0):u(e,r);if("Buffer"===r.type&&Q(r.data))return u(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function m(e){return+e!=e&&(e=0),t.alloc(+e)}function v(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var f=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return H(e).length;default:if(f)return Z(e).length;r=(""+r).toLowerCase(),f=!0}}function g(t,e,r){var i=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,e>>>=0,e>=r)return"";for(t||(t="utf8");;)switch(t){case"hex":return q(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function w(e,r,i,f,n){if(0===e.length)return-1;if("string"==typeof i?(f=i,i=0):i>2147483647?i=2147483647:-2147483648>i&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),0>i&&(i=e.length+i),e.length>i){if(0>i){if(!n)return-1;i=0}}else{if(n)return-1;i=e.length-1}if("string"==typeof r&&(r=t.from(r,f)),t.isBuffer(r))return 0===r.length?-1:M(e,r,i,f,n);if("number"==typeof r)return r=255&r,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,r,i):Uint8Array.prototype.lastIndexOf.call(e,r,i):M(e,[r],i,f,n);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,i,f){function n(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,d=t.length,o=e.length;if(void 0!==i&&(i=(i+"").toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(2>t.length||2>e.length)return-1;a=2,d/=2,o/=2,r/=2}var s;if(f){var h=-1;for(s=r;d>s;s++)if(n(t,s)===n(e,h===-1?0:s-h)){if(h===-1&&(h=s),s-h+1===o)return h*a}else h!==-1&&(s-=s-h),h=-1}else for(r+o>d&&(r=d-o),s=r;s>=0;s--){for(var c=!0,u=0;o>u;u++)if(n(t,s+u)!==n(e,u)){c=!1;break}if(c)return s}return-1}function A(t,e,r,i){r=+r||0;var f=t.length-r;i?(i=+i,i>f&&(i=f)):i=f;var n=e.length;if(n%2!==0)throw new TypeError("Invalid hex string");i>n/2&&(i=n/2);for(var a=0;i>a;++a){var d=parseInt(e.substr(2*a,2),16);if(isNaN(d))return a;t[r+a]=d}return a}function S(t,e,r,i){return K(Z(e,t.length-r),t,r,i)}function _(t,e,r,i){return K(X(e),t,r,i)}function x(t,e,r,i){return _(t,e,r,i)}function I(t,e,r,i){return K(H(e),t,r,i)}function R(t,e,r,i){return K(V(e,t.length-r),t,r,i)}function E(t,e,r){return G.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var i=[],f=e;r>f;){var n=t[f],a=null,d=n>239?4:n>223?3:n>191?2:1;if(r>=f+d){var o,s,h,c;switch(d){case 1:128>n&&(a=n);break;case 2:o=t[f+1],128===(192&o)&&(c=(31&n)<<6|63&o,c>127&&(a=c));break;case 3:o=t[f+1],s=t[f+2],128===(192&o)&&128===(192&s)&&(c=(15&n)<<12|(63&o)<<6|63&s,c>2047&&(55296>c||c>57343)&&(a=c));break;case 4:o=t[f+1],s=t[f+2],h=t[f+3],128===(192&o)&&128===(192&s)&&128===(192&h)&&(c=(15&n)<<18|(63&o)<<12|(63&s)<<6|63&h,c>65535&&1114112>c&&(a=c))}}null===a?(a=65533,d=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),f+=d}return z(i)}function z(t){var e=t.length;if(tt>=e)return String.fromCharCode.apply(String,t);for(var r="",i=0;e>i;)r+=String.fromCharCode.apply(String,t.slice(i,i+=tt));return r}function B(t,e,r){var i="";r=Math.min(t.length,r);for(var f=e;r>f;++f)i+=String.fromCharCode(127&t[f]);return i}function k(t,e,r){var i="";r=Math.min(t.length,r);for(var f=e;r>f;++f)i+=String.fromCharCode(t[f]);return i}function q(t,e,r){var i=t.length;e&&e>=0||(e=0),(!r||0>r||r>i)&&(r=i);for(var f="",n=e;r>n;++n)f+=J(t[n]);return f}function T(t,e,r){for(var i=t.slice(e,r),f="",n=0;i.length>n;n+=2)f+=String.fromCharCode(i[n]+256*i[n+1]);return f}function j(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,r,i,f,n,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||a>r)throw new RangeError('"value" argument is out of bounds');if(i+f>e.length)throw new RangeError("Index out of range")}function L(t,e,r,i){0>e&&(e=65535+e+1);for(var f=0,n=Math.min(t.length-r,2);n>f;++f)t[r+f]=(e&255<<8*(i?f:1-f))>>>8*(i?f:1-f)}function O(t,e,r,i){0>e&&(e=4294967295+e+1);for(var f=0,n=Math.min(t.length-r,4);n>f;++f)t[r+f]=e>>>8*(i?f:3-f)&255}function C(t,e,r,i,f,n){if(r+i>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function U(t,e,r,i,f){return f||C(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,r,i,23,4),r+4}function Y(t,e,r,i,f){return f||C(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,r,i,52,8),r+8}function D(t){if(t=F(t).replace(et,""),2>t.length)return"";for(;t.length%4!==0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function J(t){return 16>t?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,i=t.length,f=null,n=[],a=0;i>a;++a){if(r=t.charCodeAt(a),r>55295&&57344>r){if(!f){if(r>56319){(e-=3)>-1&&n.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&n.push(239,191,189);continue}f=r;continue}if(56320>r){(e-=3)>-1&&n.push(239,191,189),f=r;continue}r=(f-55296<<10|r-56320)+65536}else f&&(e-=3)>-1&&n.push(239,191,189);if(f=null,128>r){if((e-=1)<0)break;n.push(r)}else if(2048>r){if((e-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(r>=1114112)throw Error("Invalid code point");if((e-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function X(t){for(var e=[],r=0;t.length>r;++r)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,i,f,n=[],a=0;t.length>a&&(e-=2)>=0;++a)r=t.charCodeAt(a),i=r>>8,f=r%256,n.push(f),n.push(i);return n}function H(t){return G.toByteArray(D(t))}function K(t,e,r,i){for(var f=0;i>f&&(f+rn;++n)if(e[n]!==r[n]){i=e[n],f=r[n];break}return f>i?-1:i>f?1:0},t.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,r){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);var i;if(void 0===r)for(r=0,i=0;e.length>i;++i)r+=e[i].length;var f=t.allocUnsafe(r),n=0;for(i=0;e.length>i;++i){var a=e[i];if(!t.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(f,n),n+=a.length}return f},t.byteLength=v,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;t>e;e+=2)y(this,e,e+1);return this},t.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;t>e;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},t.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;t>e;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):g.apply(this,arguments)},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,i,f,n){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===i&&(i=e?e.length:0),void 0===f&&(f=0),void 0===n&&(n=this.length),0>r||i>e.length||0>f||n>this.length)throw new RangeError("out of range index");if(f>=n&&r>=i)return 0;if(f>=n)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,f>>>=0,n>>>=0,this===e)return 0;for(var a=n-f,d=i-r,o=Math.min(a,d),s=this.slice(f,n),h=e.slice(r,i),c=0;o>c;++c)if(s[c]!==h[c]){a=s[c],d=h[c];break}return d>a?-1:a>d?1:0},t.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},t.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},t.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},t.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===i&&(i="utf8")):(i=r,r=void 0)}var f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var i=this.length;e=~~e,r=void 0===r?i:~~r,0>e?(e+=i,0>e&&(e=0)):e>i&&(e=i),0>r?(r+=i,0>r&&(r=0)):r>i&&(r=i),e>r&&(r=e);var f;if(t.TYPED_ARRAY_SUPPORT)f=this.subarray(e,r),f.__proto__=t.prototype;else{var n=r-e;f=new t(n,(void 0));for(var a=0;n>a;++a)f[a]=this[a+e]}return f},t.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var i=this[t],f=1,n=0;++n0&&(f*=256);)i+=this[t+--e]*f;return i},t.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var i=this[t],f=1,n=0;++ni||(i-=Math.pow(2,8*e)),i},t.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var i=e,f=1,n=this[t+--i];i>0&&(f*=256);)n+=this[t+--i]*f;return f*=128,f>n||(n-=Math.pow(2,8*e)),n},t.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),$.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),$.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),$.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),$.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=0|e,r=0|r,!i){var f=Math.pow(2,8*r)-1;N(this,t,e,r,f,0)}var n=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+n]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):O(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):O(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=0|e,!i){var f=Math.pow(2,8*r-1);N(this,t,e,r,f-1,-f)}var n=0,a=1,d=0;for(this[e]=255&t;++nt&&0===d&&0!==this[e+n-1]&&(d=1),this[e+n]=(t/a>>0)-d&255;return e+r},t.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=0|e,!i){var f=Math.pow(2,8*r-1);N(this,t,e,r,f-1,-f)}var n=r-1,a=1,d=0;for(this[e+n]=255&t;--n>=0&&(a*=256);)0>t&&0===d&&0!==this[e+n+1]&&(d=1),this[e+n]=(t/a>>0)-d&255;return e+r},t.prototype.writeInt8=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):L(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):L(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):O(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,i){return e=+e,r=0|r,i||N(this,e,r,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):O(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return Y(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return Y(this,t,e,!1,r)},t.prototype.copy=function(e,r,i,f){if(i||(i=0),f||0===f||(f=this.length),e.length>r||(r=e.length),r||(r=0),f>0&&i>f&&(f=i),f===i)return 0;if(0===e.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>i||i>=this.length)throw new RangeError("sourceStart out of bounds");if(0>f)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),f-i>e.length-r&&(f=e.length-r+i);var n,a=f-i;if(this===e&&r>i&&f>r)for(n=a-1;n>=0;--n)e[n+r]=this[n+i];else if(1e3>a||!t.TYPED_ARRAY_SUPPORT)for(n=0;a>n;++n)e[n+r]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),r);return a},t.prototype.fill=function(e,r,i,f){if("string"==typeof e){if("string"==typeof r?(f=r,r=0,i=this.length):"string"==typeof i&&(f=i,i=this.length),1===e.length){var n=e.charCodeAt(0);256>n&&(e=n)}if(void 0!==f&&"string"!=typeof f)throw new TypeError("encoding must be a string");if("string"==typeof f&&!t.isEncoding(f))throw new TypeError("Unknown encoding: "+f)}else"number"==typeof e&&(e=255&e);if(0>r||r>this.length||i>this.length)throw new RangeError("Out of range index");if(r>=i)return this;r>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;i>a;++a)this[a]=e;else{var d=t.isBuffer(e)?e:Z(""+new t(e,f)),o=d.length;for(a=0;i-r>a;++a)this[a+r]=d[a%o]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,r(3).Buffer,r(38))},function(t,e,r){"use strict";var i=e;i.base=r(11),i["short"]=r(14),i.mont=r(13),i.edwards=r(12)},function(t,e){t.exports="function"==typeof Object.create?function(t,e){
3 | 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 r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";(function(e){function i(t){var e,r,i,f,c,u,b,l,p,m,v,g,y,w,M,A,S,_,x,I,R,E,P,z,B,k,q,T,j,N,L,O,C,U,Y,D,F,J,Z,X,V,H,K,W,G,$,Q,tt,et,rt,it,ft,nt,at,dt,ot,st,ht,ct,ut,bt,lt,pt,mt,vt,gt=!1,yt=0,wt=0,Mt=t.length,At=34,St=4*At;for(i=0;50>i;++i)h[i]=0;e=0;do{for(s[0]=e,i=1;At+1>i;++i)s[i]=0;for(i=wt;Mt>yt&&St>i;++yt)s[i>>2]|=t[yt]<>2]|=n[3&i],++yt),e=s[At],yt>Mt&&St>i&&(s[At-1]|=2147483648,gt=!0),i=0;At>i;++i)h[i]^=s[i];for(r=0;48>r;r+=2)u=h[0]^h[10]^h[20]^h[30]^h[40],b=h[1]^h[11]^h[21]^h[31]^h[41],l=h[2]^h[12]^h[22]^h[32]^h[42],p=h[3]^h[13]^h[23]^h[33]^h[43],m=h[4]^h[14]^h[24]^h[34]^h[44],v=h[5]^h[15]^h[25]^h[35]^h[45],g=h[6]^h[16]^h[26]^h[36]^h[46],y=h[7]^h[17]^h[27]^h[37]^h[47],w=h[8]^h[18]^h[28]^h[38]^h[48],M=h[9]^h[19]^h[29]^h[39]^h[49],f=w^(l<<1|p>>>31),c=M^(p<<1|l>>>31),h[0]^=f,h[1]^=c,h[10]^=f,h[11]^=c,h[20]^=f,h[21]^=c,h[30]^=f,h[31]^=c,h[40]^=f,h[41]^=c,f=u^(m<<1|v>>>31),c=b^(v<<1|m>>>31),h[2]^=f,h[3]^=c,h[12]^=f,h[13]^=c,h[22]^=f,h[23]^=c,h[32]^=f,h[33]^=c,h[42]^=f,h[43]^=c,f=l^(g<<1|y>>>31),c=p^(y<<1|g>>>31),h[4]^=f,h[5]^=c,h[14]^=f,h[15]^=c,h[24]^=f,h[25]^=c,h[34]^=f,h[35]^=c,h[44]^=f,h[45]^=c,f=m^(w<<1|M>>>31),c=v^(M<<1|w>>>31),h[6]^=f,h[7]^=c,h[16]^=f,h[17]^=c,h[26]^=f,h[27]^=c,h[36]^=f,h[37]^=c,h[46]^=f,h[47]^=c,f=g^(u<<1|b>>>31),c=y^(b<<1|u>>>31),h[8]^=f,h[9]^=c,h[18]^=f,h[19]^=c,h[28]^=f,h[29]^=c,h[38]^=f,h[39]^=c,h[48]^=f,h[49]^=c,A=h[0],S=h[1],tt=h[11]<<4|h[10]>>>28,et=h[10]<<4|h[11]>>>28,N=h[20]<<3|h[21]>>>29,L=h[21]<<3|h[20]>>>29,lt=h[31]<<9|h[30]>>>23,pt=h[30]<<9|h[31]>>>23,W=h[40]<<18|h[41]>>>14,G=h[41]<<18|h[40]>>>14,D=h[2]<<1|h[3]>>>31,F=h[3]<<1|h[2]>>>31,_=h[13]<<12|h[12]>>>20,x=h[12]<<12|h[13]>>>20,rt=h[22]<<10|h[23]>>>22,it=h[23]<<10|h[22]>>>22,O=h[33]<<13|h[32]>>>19,C=h[32]<<13|h[33]>>>19,mt=h[42]<<2|h[43]>>>30,vt=h[43]<<2|h[42]>>>30,ot=h[5]<<30|h[4]>>>2,st=h[4]<<30|h[5]>>>2,J=h[14]<<6|h[15]>>>26,Z=h[15]<<6|h[14]>>>26,I=h[25]<<11|h[24]>>>21,R=h[24]<<11|h[25]>>>21,ft=h[34]<<15|h[35]>>>17,nt=h[35]<<15|h[34]>>>17,U=h[45]<<29|h[44]>>>3,Y=h[44]<<29|h[45]>>>3,k=h[6]<<28|h[7]>>>4,q=h[7]<<28|h[6]>>>4,ht=h[17]<<23|h[16]>>>9,ct=h[16]<<23|h[17]>>>9,X=h[26]<<25|h[27]>>>7,V=h[27]<<25|h[26]>>>7,E=h[36]<<21|h[37]>>>11,P=h[37]<<21|h[36]>>>11,at=h[47]<<24|h[46]>>>8,dt=h[46]<<24|h[47]>>>8,$=h[8]<<27|h[9]>>>5,Q=h[9]<<27|h[8]>>>5,T=h[18]<<20|h[19]>>>12,j=h[19]<<20|h[18]>>>12,ut=h[29]<<7|h[28]>>>25,bt=h[28]<<7|h[29]>>>25,H=h[38]<<8|h[39]>>>24,K=h[39]<<8|h[38]>>>24,z=h[48]<<14|h[49]>>>18,B=h[49]<<14|h[48]>>>18,h[0]=A^~_&I,h[1]=S^~x&R,h[10]=k^~T&N,h[11]=q^~j&L,h[20]=D^~J&X,h[21]=F^~Z&V,h[30]=$^~tt&rt,h[31]=Q^~et&it,h[40]=ot^~ht&ut,h[41]=st^~ct&bt,h[2]=_^~I&E,h[3]=x^~R&P,h[12]=T^~N&O,h[13]=j^~L&C,h[22]=J^~X&H,h[23]=Z^~V&K,h[32]=tt^~rt&ft,h[33]=et^~it&nt,h[42]=ht^~ut<,h[43]=ct^~bt&pt,h[4]=I^~E&z,h[5]=R^~P&B,h[14]=N^~O&U,h[15]=L^~C&Y,h[24]=X^~H&W,h[25]=V^~K&G,h[34]=rt^~ft&at,h[35]=it^~nt&dt,h[44]=ut^~lt&mt,h[45]=bt^~pt&vt,h[6]=E^~z&A,h[7]=P^~B&S,h[16]=O^~U&k,h[17]=C^~Y&q,h[26]=H^~W&D,h[27]=K^~G&F,h[36]=ft^~at&$,h[37]=nt^~dt&Q,h[46]=lt^~mt&ot,h[47]=pt^~vt&st,h[8]=z^~A&_,h[9]=B^~S&x,h[18]=U^~k&T,h[19]=Y^~q&j,h[28]=W^~D&J,h[29]=G^~F&Z,h[38]=at^~$&tt,h[39]=dt^~Q&et,h[48]=mt^~ot&ht,h[49]=vt^~st&ct,h[0]^=o[r],h[1]^=o[r+1]}while(!gt);var _t="";for(i=0,r=8;r>i;++i)f=h[i],_t+=a[f>>4&15]+a[15&f]+a[f>>12&15]+a[f>>8&15]+a[f>>20&15]+a[f>>16&15]+a[f>>28&15]+a[f>>24&15];return _t}function f(t,r){var f=t;if("string"==typeof f)f=new e(f,"utf8");else if(!e.isBuffer(f))throw Error("[ethjs-sha3] data input must be type 'String' or Buffer 'Object' instance got "+typeof t+", if your trying to hash a BigNumber or BN object, convert it to a string by using 'value.toString(10)'.");return r===!0?new e(i(f),"hex"):"0x"+new e(i(f),"hex").toString("hex")}var n=(r(2),[1,256,65536,16777216]),a="0123456789abcdef".split(""),d=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],s=[],h=[];t.exports=f}).call(e,r(3).Buffer)},function(t,e,r){"use strict";(function(e){function i(t){var e=t,r=null;if("string"!=typeof e)throw Error("[ethjs-account] invalid address value "+JSON.stringify(e)+" not a valid hex string");if("0x"!==e.substring(0,2)&&"XE"!==e.substring(0,2)&&(e="0x"+e),!e.match(/^(0x)?[0-9a-fA-F]{40}$/))throw e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)?Error("[ethjs-account] ICAP and IBAN addresses, not supported yet.."):Error("[ethjs-account] invalid address value "+JSON.stringify(e)+" not a valid hex string");if(r=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e)throw Error("[ethjs-account] invalid address checksum");return r}function f(t){if("string"!=typeof t)throw Error("[ethjs-account] private key must be type String, got "+typeof t);if(!t.match(/^(0x)?[0-9a-fA-F]{64}$/))throw Error("[ethjs-account] private key must be an alphanumeric hex string that is 32 bytes long.");var r=new e(b(t),"hex");return new e(c.keyFromPrivate(r).getPublic(!1,"hex"),"hex").slice(1)}function n(t){if(!e.isBuffer(t))throw Error("[ethjs-account] public key must be a buffer object in order to get public key address");return i(s(t,!0).slice(12).toString("hex"))}function a(t){var e=f(t,!0);return{privateKey:"0x"+b(t),publicKey:"0x"+e.toString("hex"),address:n(e)}}function d(t){if("string"!=typeof t)throw Error("[ethjs-account] while generating account, invalid input type: '"+typeof t+"' should be type 'String'.");if(32>t.length)throw Error("[ethjs-account] while generating account, entropy value not random and long enough, should be at least 32 characters of random information, is only "+t.length);return a(s(""+h(16)+s(""+h(32)+t)+h(32)))}var o=r(0),s=r(6),h=r(36),c=new o.ec("secp256k1"),u=r(8),b=r(37);t.exports={sha3:s,generate:d,getAddress:i,privateToAccount:a,getChecksumAddress:u,publicToAddress:n,privateToPublic:f}}).call(e,r(3).Buffer)},function(t,e,r){"use strict";var i=r(0),f=r(6);new i.ec("secp256k1");t.exports=function(t){var e=t;if("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]{40}$/))throw Error("[ethjs-account] invalid address value "+JSON.stringify(e)+" not a valid hex string");e=e.substring(2).toLowerCase();var r=f(e,!0);e=e.split("");for(var i=0;40>i;i+=2)8>r[i>>1]>>4||(e[i]=e[i].toUpperCase()),8>(15&r[i>>1])||(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}},function(t,e){"use strict";function r(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-r(t)}function f(t){var e,i,f,n,a,d,o=t.length;a=r(t),d=new h(3*o/4-a),f=a>0?o-4:o;var c=0;for(e=0,i=0;f>e;e+=4,i+=3)n=s[t.charCodeAt(e)]<<18|s[t.charCodeAt(e+1)]<<12|s[t.charCodeAt(e+2)]<<6|s[t.charCodeAt(e+3)],d[c++]=n>>16&255,d[c++]=n>>8&255,d[c++]=255&n;return 2===a?(n=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,d[c++]=255&n):1===a&&(n=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,d[c++]=n>>8&255,d[c++]=255&n),d}function n(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var i,f=[],a=e;r>a;a+=3)i=(t[a]<<16)+(t[a+1]<<8)+t[a+2],f.push(n(i));return f.join("")}function d(t){for(var e,r=t.length,i=r%3,f="",n=[],d=16383,s=0,h=r-i;h>s;s+=d)n.push(a(t,s,s+d>h?h:s+d));return 1===i?(e=t[r-1],f+=o[e>>2],f+=o[e<<4&63],f+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],f+=o[e>>10],f+=o[e>>4&63],f+=o[e<<2&63],f+="="),n.push(f),n.join("")}e.byteLength=i,e.toByteArray=f,e.fromByteArray=d;for(var o=[],s=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,b=c.length;b>u;++u)o[u]=c[u],s[c.charCodeAt(u)]=u;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,e,r){function i(t){this.rand=t}var f;if(t.exports=function(t){return f||(f=new i(null)),f.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},"object"==typeof window)i.prototype._rand=window.crypto&&window.crypto.getRandomValues?function(t){var e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}:window.msCrypto&&window.msCrypto.getRandomValues?function(t){var e=new Uint8Array(t);return window.msCrypto.getRandomValues(e),e}:function(){throw Error("Not implemented yet")};else try{var n=r(40);i.prototype._rand=function(t){return n.randomBytes(t)}}catch(a){i.prototype._rand=function(t){for(var e=new Uint8Array(t),r=0;e.length>r;r++)e[r]=this.rand.getByte();return e}}},function(t,e,r){"use strict";function i(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=Array(4),this._wnafT2=Array(4),this._wnafT3=Array(4),this._wnafT4=Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}var n=r(1),a=r(0),d=a.utils,o=d.getNAF,s=d.getJSF,h=d.assert;t.exports=i,i.prototype.point=function(){throw Error("Not implemented")},i.prototype.validate=function(){throw Error("Not implemented")},i.prototype._fixedNafMul=function(t,e){h(t.precomputed);var r=t._getDoubles(),i=o(e,1),f=(1<a;a+=r.step){for(var d=0,e=a+r.step-1;e>=a;e--)d=(d<<1)+i[e];n.push(d)}for(var s=this.jpoint(null,null,null),c=this.jpoint(null,null,null),u=f;u>0;u--){for(var a=0;n.length>a;a++){var d=n[a];d===u?c=c.mixedAdd(r.points[a]):d===-u&&(c=c.mixedAdd(r.points[a].neg()))}s=s.add(c)}return s.toP()},i.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var f=i.points,n=o(e,r),a=this.jpoint(null,null,null),d=n.length-1;d>=0;d--){for(var e=0;d>=0&&0===n[d];d--)e++;if(0>d||e++,a=a.dblp(e),0>d)break;var s=n[d];h(0!==s),a="affine"===t.type?a.mixedAdd(s>0?f[s-1>>1]:f[-s-1>>1].neg()):a.add(s>0?f[s-1>>1]:f[-s-1>>1].neg())}return"affine"===t.type?a.toP():a},i.prototype._wnafMulAdd=function(t,e,r,i,f){for(var n=this._wnafT1,a=this._wnafT2,d=this._wnafT3,h=0,c=0;i>c;c++){var u=e[c],b=u._getNAFPoints(t);n[c]=b.wnd,a[c]=b.points}for(var c=i-1;c>=1;c-=2){var l=c-1,p=c;if(1===n[l]&&1===n[p]){var m=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(m[1]=e[l].add(e[p]),m[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(m[1]=e[l].toJ().mixedAdd(e[p]),m[2]=e[l].add(e[p].neg())):(m[1]=e[l].toJ().mixedAdd(e[p]),m[2]=e[l].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[l],r[p]);h=Math.max(g[0].length,h),d[l]=Array(h),d[p]=Array(h);for(var y=0;h>y;y++){var w=0|g[0][y],M=0|g[1][y];d[l][y]=v[3*(w+1)+(M+1)],d[p][y]=0,a[l]=m}}else d[l]=o(r[l],n[l]),d[p]=o(r[p],n[p]),h=Math.max(d[l].length,h),h=Math.max(d[p].length,h)}for(var A=this.jpoint(null,null,null),S=this._wnafT4,c=h;c>=0;c--){for(var _=0;c>=0;){for(var x=!0,y=0;i>y;y++)S[y]=0|d[y][c],0!==S[y]&&(x=!1);if(!x)break;_++,c--}if(0>c||_++,A=A.dblp(_),0>c)break;for(var y=0;i>y;y++){var u,I=S[y];0!==I&&(I>0?u=a[y][I-1>>1]:0>I&&(u=a[y][-I-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(var c=0;i>c;c++)a[c]=null;return f?A:A.toP()},i.BasePoint=f,f.prototype.eq=function(){throw Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},i.prototype.decodePoint=function(t,e){t=d.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r){6===t[0]?h(t[t.length-1]%2===0):7===t[0]&&h(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return i}if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw Error("Unknown point format")},f.prototype.encodeCompressed=function(t){return this.encode(t,!0)},f.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},f.prototype.encode=function(t,e){return d.encode(this._encode(e),t)},f.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},f.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,f=0;e>f;f+=t){for(var n=0;t>n;n++)i=i.dbl();r.push(i)}return{step:t,points:r}},f.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<f;f++)e[f]=e[f-1].add(i);return{wnd:t,points:e}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(t){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}},function(t,e,r){"use strict";function i(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&(0|t.a)===-1,this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new d(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new d(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new d(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),h(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function f(t,e,r,i,f){s.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 d(e,16),this.y=new d(r,16),this.z=i?new d(i,16):this.curve.one,this.t=f&&new d(f,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 n=r(4),a=r(0),d=r(1),o=r(5),s=n.base,h=a.utils.assert;o(i,s),t.exports=i,i.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},i.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},i.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},i.prototype.pointFromX=function(t,e){t=new d(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),f=this.one.redSub(this.c2.redMul(this.d).redMul(r)),n=i.redMul(f.redInvm()),a=n.redSqrt();if(0!==a.redSqr().redSub(n).cmp(this.zero))throw Error("invalid point");var o=a.fromRed().isOdd();return(e&&!o||!e&&o)&&(a=a.redNeg()),this.point(t,a)},i.prototype.pointFromY=function(t,e){t=new d(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.one),f=r.redMul(this.d).redAdd(this.one),n=i.redMul(f.redInvm());if(0===n.cmp(this.zero)){if(e)throw Error("invalid point");return this.point(this.zero,t)}var a=n.redSqrt();if(0!==a.redSqr().redSub(n).cmp(this.zero))throw Error("invalid point");return a.isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},i.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),f=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(f)},o(f,s.BasePoint),i.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},i.prototype.point=function(t,e,r,i){return new f(this,t,e,r,i)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),f=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),n=i.redAdd(e),a=n.redSub(r),d=i.redSub(e),o=f.redMul(a),s=n.redMul(d),h=f.redMul(d),c=a.redMul(n);return this.curve.point(o,s,c,h)},f.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),n=this.y.redSqr();if(this.curve.twisted){var a=this.curve._mulA(f),d=a.redAdd(n);if(this.zOne)t=i.redSub(f).redSub(n).redMul(d.redSub(this.curve.two)),e=d.redMul(a.redSub(n)),r=d.redSqr().redSub(d).redSub(d);else{var o=this.z.redSqr(),s=d.redSub(o).redISub(o);t=i.redSub(f).redISub(n).redMul(s),e=d.redMul(a.redSub(n)),r=d.redMul(s)}}else{var a=f.redAdd(n),o=this.curve._mulC(this.c.redMul(this.z)).redSqr(),s=a.redSub(o).redSub(o);t=this.curve._mulC(i.redISub(a)).redMul(s),e=this.curve._mulC(a).redMul(f.redISub(n)),r=a.redMul(s)}return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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),f=this.z.redMul(t.z.redAdd(t.z)),n=r.redSub(e),a=f.redSub(i),d=f.redAdd(i),o=r.redAdd(e),s=n.redMul(a),h=d.redMul(o),c=n.redMul(o),u=a.redMul(d);return this.curve.point(s,h,u,c)},f.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),f=i.redSqr(),n=this.x.redMul(t.x),a=this.y.redMul(t.y),d=this.curve.d.redMul(n).redMul(a),o=f.redSub(d),s=f.redAdd(d),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(n).redISub(a),c=i.redMul(o).redMul(h);return this.curve.twisted?(e=i.redMul(s).redMul(a.redSub(this.curve._mulA(n))),r=o.redMul(s)):(e=i.redMul(s).redMul(a.redSub(n)),r=this.curve._mulC(o).redMul(s)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}return!1},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(t,e,r){"use strict";function i(t){o.call(this,"mont",t),this.a=new a(t.a,16).toRed(this.red),this.b=new a(t.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(e,16),this.z=new a(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 n=r(4),a=r(1),d=r(5),o=n.base,s=r(0),h=s.utils;d(i,o),t.exports=i,i.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),f=i.redSqrt();return 0===f.redSqr().cmp(i)},d(f,o.BasePoint),i.prototype.decodePoint=function(t,e){return this.point(h.toArray(t,e),1)},i.prototype.point=function(t,e){return new f(this,t,e)},i.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),f=e.redSub(i),n=e.redMul(i),a=f.redMul(i.redAdd(this.curve.a24.redMul(f)));return this.curve.point(n,a)},f.prototype.add=function(){throw Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),f=t.x.redAdd(t.z),n=t.x.redSub(t.z),a=n.redMul(r),d=f.redMul(i),o=e.z.redMul(a.redAdd(d).redSqr()),s=e.x.redMul(a.redISub(d).redSqr());return this.curve.point(o,s)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),f=this,n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,f),i=i.dbl()):(i=r.diffAdd(i,f),r=r.dbl());return i},f.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";function i(t){h.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.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(t),this._endoWnafT1=Array(4),this._endoWnafT2=Array(4)}function f(t,e,r,i){h.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(r,16),i&&(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 n(t,e,r,i){h.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(i,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 a=r(4),d=r(0),o=r(1),s=r(5),h=a.base,c=d.utils.assert;s(i,h),t.exports=i,i.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(t.lambda)r=new o(t.lambda,16);else{var f=this._getEndoRoots(this.n);0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))?r=f[0]:(r=f[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}var n;return n=t.basis?t.basis.map(function(t){return{a:new o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:n}}},i.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),i=r.redNeg(),f=new o(3).toRed(e).redNeg().redSqrt().redMul(r),n=i.redAdd(f).fromRed(),a=i.redSub(f).fromRed();return[n,a]},i.prototype._getEndoBasis=function(t){for(var e,r,i,f,n,a,d,s,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=t,b=this.n.clone(),l=new o(1),p=new o(0),m=new o(0),v=new o(1),g=0;0!==u.cmpn(0);){var y=b.div(u);s=b.sub(y.mul(u)),h=m.sub(y.mul(l));var w=v.sub(y.mul(p));if(!i&&s.cmp(c)<0)e=d.neg(),r=l,i=s.neg(),f=h;else if(i&&2===++g)break;d=s,b=u,u=s,m=l,l=h,v=p,p=w}n=s.neg(),a=h;var M=i.sqr().add(f.sqr()),A=n.sqr().add(a.sqr());return A.cmp(M)<0||(n=e,a=r),i.negative&&(i=i.neg(),f=f.neg()),n.negative&&(n=n.neg(),a=a.neg()),[{a:i,b:f},{a:n,b:a}]},i.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],f=i.b.mul(t).divRound(this.n),n=r.b.neg().mul(t).divRound(this.n),a=f.mul(r.a),d=n.mul(i.a),o=f.mul(r.b),s=n.mul(i.b),h=t.sub(a).sub(d),c=o.add(s).neg();return{k1:h,k2:c}},i.prototype.pointFromX=function(t,e){t=new o(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var f=i.fromRed().isOdd();return(e&&!f||!e&&f)&&(i=i.redNeg()),this.point(t,i)},i.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(f).cmpn(0)},i.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,f=this._endoWnafT2,n=0;t.length>n;n++){var a=this._endoSplit(e[n]),d=t[n],o=d._getBeta();a.k1.negative&&(a.k1.ineg(),d=d.neg(!0)),a.k2.negative&&(a.k2.ineg(),o=o.neg(!0)),i[2*n]=d,i[2*n+1]=o,f[2*n]=a.k1,f[2*n+1]=a.k2}for(var s=this._wnafMulAdd(1,i,f,2*n,r),h=0;2*n>h;h++)i[h]=null,f[h]=null;return s},s(f,h.BasePoint),i.prototype.point=function(t,e,r){return new f(this,t,e,r)},i.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},f.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]},f.fromJSON=function(t,e,r){function i(e){return t.point(e[0],e[1],r)}"string"==typeof e&&(e=JSON.parse(e));var f=t.point(e[0],e[1],r);if(!e[2])return f;var n=e[2];return f.precomputed={beta:null,doubles:n.doubles&&{step:n.doubles.step,points:[f].concat(n.doubles.points.map(i))},naf:n.naf&&{wnd:n.naf.wnd,points:[f].concat(n.naf.points.map(i))}},f},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),f=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),n=f.redSqr().redISub(this.x.redAdd(this.x)),a=f.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var i=[this,e],f=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,f):this.curve._wnafMulAdd(1,i,f,2)},f.prototype.jmulAdd=function(t,e,r){var i=[this,e],f=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,f,!0):this.curve._wnafMulAdd(1,i,f,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},f.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},s(n,h.BasePoint),i.prototype.jpoint=function(t,e,r){return new n(this,t,e,r)},n.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},n.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},n.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),f=t.x.redMul(r),n=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),d=i.redSub(f),o=n.redSub(a);if(0===d.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=d.redSqr(),h=s.redMul(d),c=i.redMul(s),u=o.redSqr().redIAdd(h).redISub(c).redISub(c),b=o.redMul(c.redISub(u)).redISub(n.redMul(h)),l=this.z.redMul(t.z).redMul(d);return this.curve.jpoint(u,b,l)},n.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),f=this.y,n=t.y.redMul(e).redMul(this.z),a=r.redSub(i),d=f.redSub(n);if(0===a.cmpn(0))return 0!==d.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=a.redSqr(),s=o.redMul(a),h=r.redMul(o),c=d.redSqr().redIAdd(s).redISub(h).redISub(h),u=d.redMul(h.redISub(c)).redISub(f.redMul(s)),b=this.z.redMul(a);return this.curve.jpoint(c,u,b)},n.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;t>r;r++)e=e.dbl();return e}for(var i=this.curve.a,f=this.curve.tinv,n=this.x,a=this.y,d=this.z,o=d.redSqr().redSqr(),s=a.redAdd(a),r=0;t>r;r++){var h=n.redSqr(),c=s.redSqr(),u=c.redSqr(),b=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(o)),l=n.redMul(c),p=b.redSqr().redISub(l.redAdd(l)),m=l.redISub(p),v=b.redMul(m);v=v.redIAdd(v).redISub(u);var g=s.redMul(d);t>r+1&&(o=o.redMul(u)),n=p,d=g,s=v}return this.curve.jpoint(n,s.redMul(f),d)},n.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},n.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),f=this.y.redSqr(),n=f.redSqr(),a=this.x.redAdd(f).redSqr().redISub(i).redISub(n);a=a.redIAdd(a);var d=i.redAdd(i).redIAdd(i),o=d.redSqr().redISub(a).redISub(a),s=n.redIAdd(n);s=s.redIAdd(s),s=s.redIAdd(s),t=o,e=d.redMul(a.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),u=c.redSqr(),b=this.x.redAdd(c).redSqr().redISub(h).redISub(u);b=b.redIAdd(b);var l=h.redAdd(h).redIAdd(h),p=l.redSqr(),m=u.redIAdd(u);m=m.redIAdd(m),m=m.redIAdd(m),t=p.redISub(b).redISub(b),e=l.redMul(b.redISub(t)).redISub(m),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},n.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),f=this.y.redSqr(),n=f.redSqr(),a=this.x.redAdd(f).redSqr().redISub(i).redISub(n);
4 | a=a.redIAdd(a);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),o=d.redSqr().redISub(a).redISub(a);t=o;var s=n.redIAdd(n);s=s.redIAdd(s),s=s.redIAdd(s),e=d.redMul(a.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),u=this.x.redMul(c),b=this.x.redSub(h).redMul(this.x.redAdd(h));b=b.redAdd(b).redIAdd(b);var l=u.redIAdd(u);l=l.redIAdd(l);var p=l.redAdd(l);t=b.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var m=c.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m),e=b.redMul(l.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},n.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,f=i.redSqr().redSqr(),n=e.redSqr(),a=r.redSqr(),d=n.redAdd(n).redIAdd(n).redIAdd(t.redMul(f)),o=e.redAdd(e);o=o.redIAdd(o);var s=o.redMul(a),h=d.redSqr().redISub(s.redAdd(s)),c=s.redISub(h),u=a.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var b=d.redMul(c).redISub(u),l=r.redAdd(r).redMul(i);return this.curve.jpoint(h,b,l)},n.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),f=t.redAdd(t).redIAdd(t),n=f.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(n);var d=a.redSqr(),o=i.redIAdd(i);o=o.redIAdd(o),o=o.redIAdd(o),o=o.redIAdd(o);var s=f.redIAdd(a).redSqr().redISub(n).redISub(d).redISub(o),h=e.redMul(s);h=h.redIAdd(h),h=h.redIAdd(h);var c=this.x.redMul(d).redISub(h);c=c.redIAdd(c),c=c.redIAdd(c);var u=this.y.redMul(s.redMul(o.redISub(s)).redISub(a.redMul(d)));u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var b=this.z.redAdd(a).redSqr().redISub(r).redISub(d);return this.curve.jpoint(c,u,b)},n.prototype.mul=function(t,e){return t=new o(t,e),this.curve._wnafMul(this,t)},n.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),f=r.redMul(t.z);return 0===this.y.redMul(f).redISub(t.y.redMul(i)).cmpn(0)},n.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),f=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(f),0===this.x.cmp(r))return!0}return!1},n.prototype.inspect=function(){return this.isInfinity()?"":""},n.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";function i(t){this.curve="short"===t.type?new d.curve["short"](t):"edwards"===t.type?new d.curve.edwards(t):new d.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new i(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}var n=e,a=r(2),d=r(0),o=d.utils.assert;n.PresetCurve=i,f("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),f("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),f("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=r(23)}catch(h){s=void 0}f("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})},function(t,e,r){"use strict";function i(t){return this instanceof i?("string"==typeof t&&(d(n.curves.hasOwnProperty(t),"Unknown curve "+t),t=n.curves[t]),t instanceof n.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(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 i(t)}var f=r(1),n=r(0),a=n.utils,d=a.assert,o=r(17),s=r(18);t.exports=i,i.prototype.keyPair=function(t){return new o(this,t)},i.prototype.keyFromPrivate=function(t,e){return o.fromPrivate(this,t,e)},i.prototype.keyFromPublic=function(t,e){return o.fromPublic(this,t,e)},i.prototype.genKeyPair=function(t){t||(t={});for(var e=new n.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||n.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new f(2));;){var a=new f(e.generate(r));if(a.cmp(i)<=0)return a.iaddn(1),this.keyFromPrivate(a)}},i.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),e||t.cmp(this.n)<0?t:t.sub(this.n)},i.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new f(t,16));for(var a=this.n.byteLength(),d=e.getPrivate().toArray("be",a),o=t.toArray("be",a),h=new n.hmacDRBG({hash:this.hash,entropy:d,nonce:o,pers:i.pers,persEnc:i.persEnc}),c=this.n.sub(new f(1)),u=0;!0;u++){var b=i.k?i.k(u):new f(h.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),b.cmpn(1)>0&&b.cmp(c)<0){var l=this.g.mul(b);if(!l.isInfinity()){var p=l.getX(),m=p.umod(this.n);if(0!==m.cmpn(0)){var v=b.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(v=v.umod(this.n),0!==v.cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==p.cmp(m)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new s({r:m,s:v,recoveryParam:g})}}}}}},i.prototype.verify=function(t,e,r,i){t=this._truncateToN(new f(t,16)),r=this.keyFromPublic(r,i),e=new s(e,"hex");var n=e.r,a=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var d=a.invm(this.n),o=d.mul(t).umod(this.n),h=d.mul(n).umod(this.n);if(!this.curve._maxwellTrick){var c=this.g.mulAdd(o,r.getPublic(),h);return!c.isInfinity()&&0===c.getX().umod(this.n).cmp(n)}var c=this.g.jmulAdd(o,r.getPublic(),h);return!c.isInfinity()&&c.eqXToP(n)},i.prototype.recoverPubKey=function(t,e,r,i){d((3&r)===r,"The recovery param is more than two bits"),e=new s(e,i);var n=this.n,a=new f(t),o=e.r,h=e.s,c=1&r,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var b=e.r.invm(n),l=n.sub(a).mul(b).umod(n),p=h.mul(b).umod(n);return this.g.mulAdd(l,o,p)},i.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new s(e,i),null!==e.recoveryParam)return e.recoveryParam;for(var f=0;4>f;f++){var n;try{n=this.recoverPubKey(t,e,f)}catch(t){continue}if(n.eq(r))return f}throw Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";function i(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var f=r(1);t.exports=i,i.fromPublic=function(t,e,r){return e instanceof i?e:new i(t,{pub:e,pubEnc:r})},i.fromPrivate=function(t,e,r){return e instanceof i?e:new i(t,{priv:e,privEnc:r})},i.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"}},i.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},i.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(t,e){this.priv=new f(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(t,e){return t.x||t.y?void(this.pub=this.ec.curve.point(t.x,t.y)):void(this.pub=this.ec.curve.decodePoint(t,e))},i.prototype.derive=function(t){return t.mul(this.priv).getX()},i.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},i.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},i.prototype.inspect=function(){return""}},function(t,e,r){"use strict";function i(t,e){return t instanceof i?t:void(this._importDER(t,e)||(c(t.r&&t.s,"Signature without r or s"),this.r=new o(t.r,16),this.s=new o(t.s,16),this.recoveryParam=void 0===t.recoveryParam?null:t.recoveryParam))}function f(){this.place=0}function n(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,f=0,n=0,a=e.place;i>n;n++,a++)f<<=8,f|=t[a];return e.place=a,f}function a(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&r>e;)e++;return 0===e?t:t.slice(e)}function d(t,e){if(128>e)return void t.push(e);var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}var o=r(1),s=r(0),h=s.utils,c=h.assert;t.exports=i,i.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new f;if(48!==t[r.place++])return!1;var i=n(t,r);if(i+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=n(t,r),d=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var s=n(t,r);if(t.length!==s+r.place)return!1;var c=t.slice(r.place,s+r.place);return 0===d[0]&&128&d[1]&&(d=d.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new o(d),this.s=new o(c),this.recoveryParam=null,!0},i.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=a(e),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];d(i,e.length),i=i.concat(e),i.push(2),d(i,r.length);var f=i.concat(r),n=[48];return d(n,f.length),n=n.concat(f),h.encode(n,t)}},function(t,e,r){"use strict";function i(t){if(d("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof i))return new i(t);var t=n.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=f.sha512}var f=r(2),n=r(0),a=n.utils,d=a.assert,o=a.parseBytes,s=r(20),h=r(21);t.exports=i,i.prototype.sign=function(t,e){t=o(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),f=this.g.mul(i),n=this.encodePoint(f),a=this.hashInt(n,r.pubBytes(),t).mul(r.priv()),d=i.add(a).umod(this.curve.n);return this.makeSignature({R:f,S:d,Rencoded:n})},i.prototype.verify=function(t,e,r){t=o(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),f=this.hashInt(e.Rencoded(),i.pubBytes(),t),n=this.g.mul(e.S()),a=e.R().add(i.pub().mul(f));return a.eq(n)},i.prototype.hashInt=function(){for(var t=this.hash(),e=0;arguments.length>e;e++)t.update(arguments[e]);return a.intFromLE(t.digest()).umod(this.curve.n)},i.prototype.keyFromPublic=function(t){return s.fromPublic(this,t)},i.prototype.keyFromSecret=function(t){return s.fromSecret(this,t)},i.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},i.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},i.prototype.decodePoint=function(t){t=a.parseBytes(t);var e=t.length-1,r=t.slice(0,e).concat(t[e]&-129),i=0!==(128&t[e]),f=a.intFromLE(r);return this.curve.pointFromY(f,i)},i.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},i.prototype.decodeInt=function(t){return a.intFromLE(t)},i.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";function i(t,e){this.eddsa=t,this._secret=d(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=d(e.pub)}var f=r(0),n=f.utils,a=n.assert,d=n.parseBytes,o=n.cachedProperty;i.fromPublic=function(t,e){return e instanceof i?e:new i(t,{pub:e})},i.fromSecret=function(t,e){return e instanceof i?e:new i(t,{secret:e})},i.prototype.secret=function(){return this._secret},o(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(i,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),o(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(t){return a(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},i.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},i.prototype.getSecret=function(t){return a(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},i.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=i},function(t,e,r){"use strict";function i(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),d(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof f&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}var f=r(1),n=r(0),a=n.utils,d=a.assert,o=a.cachedProperty,s=a.parseBytes;o(i,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(i,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(i,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(i,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return a.encode(this.toBytes(),"hex").toUpperCase()},t.exports=i},function(t,e,r){"use strict";function i(t){if(!(this instanceof i))return new i(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=a.toArray(t.entropy,t.entropyEnc),r=a.toArray(t.nonce,t.nonceEnc),f=a.toArray(t.pers,t.persEnc);d(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,f)}var f=r(2),n=r(0),a=n.utils,d=a.assert;t.exports=i,i.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var f=0;this.V.length>f;f++)this.K[f]=0,this.V[f]=1;this._update(i),this.reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new f.hmac(this.hash,this.K)},i.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=a.toBuffer(t,e),r=a.toBuffer(r,i),d(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},i.prototype.generate=function(t,e,r,i){if(this.reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=a.toArray(r,i),this._update(r));for(var f=[];t>f.length;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var n=f.slice(0,t);return this._update(r),this.reseed++,a.encode(n,e)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]
5 | }}},function(t,e,r){"use strict";function i(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;t.length>i;i++)r[i]=0|t[i];return r}if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var i=0;t.length>i;i+=2)r.push(parseInt(t[i]+t[i+1],16))}}else for(var i=0;t.length>i;i++){var f=t.charCodeAt(i),n=f>>8,a=255&f;n?r.push(n,a):r.push(a)}return r}function f(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;t.length>r;r++)e+=f(t[r].toString(16));return e}function a(t,e){for(var r=[],i=1<=0;){var n;if(f.isOdd()){var a=f.andln(i-1);n=a>(i>>1)-1?(i>>1)-a:a,f.isubn(n)}else n=0;r.push(n);for(var d=0!==f.cmpn(0)&&0===f.andln(i-1)?e+1:1,o=1;d>o;o++)r.push(0);f.iushrn(d)}return r}function d(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,f=0;t.cmpn(-i)>0||e.cmpn(-f)>0;){var n=t.andln(3)+i&3,a=e.andln(3)+f&3;3===n&&(n=-1),3===a&&(a=-1);var d;if(0===(1&n))d=0;else{var o=t.andln(7)+i&7;d=3!==o&&5!==o||2!==a?n:-n}r[0].push(d);var s;if(0===(1&a))s=0;else{var o=e.andln(7)+f&7;s=3!==o&&5!==o||2!==n?a:-a}r[1].push(s),2*i===d+1&&(i=1-i),2*f===s+1&&(f=1-f),t.iushrn(1),e.iushrn(1)}return r}function o(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}}function s(t){return"string"==typeof t?c.toArray(t,"hex"):t}function h(t){return new u(t,"hex","le")}var c=e,u=r(1);c.assert=function(t,e){if(!t)throw Error(e||"Assertion failed")},c.toArray=i,c.zero2=f,c.toHex=n,c.encode=function(t,e){return"hex"===e?n(t):t},c.getNAF=a,c.getJSF=d,c.cachedProperty=o,c.parseBytes=s,c.intFromLE=h},function(t,e,r){function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var f=r(2),n=f.utils,a=n.assert;e.BlockHash=i,i.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending=this.pending?this.pending.concat(t):t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;t.length>i;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=Array(r+this.padLength);i[0]=128;for(var f=1;r>f;f++)i[f]=0;if(t<<=3,"big"===this.endian){for(var n=8;this.padLength>n;n++)i[f++]=0;i[f++]=0,i[f++]=0,i[f++]=0,i[f++]=0,i[f++]=t>>>24&255,i[f++]=t>>>16&255,i[f++]=t>>>8&255,i[f++]=255&t}else{i[f++]=255&t,i[f++]=t>>>8&255,i[f++]=t>>>16&255,i[f++]=t>>>24&255,i[f++]=0,i[f++]=0,i[f++]=0,i[f++]=0;for(var n=8;this.padLength>n;n++)i[f++]=0}return i}},function(t,e,r){function i(t,e,r){return this instanceof i?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,void this._init(n.toArray(e,r))):new i(t,e,r)}var f=r(2),n=f.utils,a=n.assert;t.exports=i,i.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),a(this.blockSize>=t.length);for(var e=t.length;this.blockSize>e;e++)t.push(0);for(var e=0;t.length>e;e++)t[e]^=54;this.inner=(new this.Hash).update(t);for(var e=0;t.length>e;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){function i(){return this instanceof i?(b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new i}function f(t,e,r,i){return t>15?t>31?t>47?t>63?e^(r|~i):e&i|r&~i:(e|~r)^i:e&r|~e&i:e^r^i}function n(t){return t>15?t>31?t>47?t>63?2840853838:2400959708:1859775393:1518500249:0}function a(t){return t>15?t>31?t>47?t>63?0:2053994217:1836072691:1548603684:1352829926}var d=r(2),o=d.utils,s=o.rotl32,h=o.sum32,c=o.sum32_3,u=o.sum32_4,b=d.common.BlockHash;o.inherits(i,b),e.ripemd160=i,i.blockSize=512,i.outSize=160,i.hmacStrength=192,i.padLength=64,i.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],d=this.h[2],o=this.h[3],b=this.h[4],g=r,y=i,w=d,M=o,A=b,S=0;80>S;S++){var _=h(s(u(r,f(S,i,d,o),t[l[S]+e],n(S)),m[S]),b);r=b,b=o,o=s(d,10),d=i,i=_,_=h(s(u(g,f(79-S,y,w,M),t[p[S]+e],a(S)),v[S]),A),g=A,A=M,M=s(w,10),w=y,y=_}_=c(this.h[1],d,M),this.h[1]=c(this.h[2],o,A),this.h[2]=c(this.h[3],b,g),this.h[3]=c(this.h[4],r,y),this.h[4]=c(this.h[0],i,w),this.h[0]=_},i.prototype._digest=function(t){return"hex"===t?o.toHex32(this.h,"little"):o.split32(this.h,"little")};var l=[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],p=[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],m=[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],v=[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]},function(t,e,r){function i(){return this instanceof i?(V.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=H,void(this.W=Array(64))):new i}function f(){return this instanceof f?(i.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new f}function n(){return this instanceof n?(V.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=K,void(this.W=Array(160))):new n}function a(){return this instanceof a?(n.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new a}function d(){return this instanceof d?(V.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=Array(80))):new d}function o(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function h(t,e,r){return t^e^r}function c(t){return B(t,2)^B(t,13)^B(t,22)}function u(t){return B(t,6)^B(t,11)^B(t,25)}function b(t){return B(t,7)^B(t,18)^t>>>3}function l(t){return B(t,17)^B(t,19)^t>>>10}function p(t,e,r,i){return 0===t?o(e,r,i):1===t||3===t?h(e,r,i):2===t?s(e,r,i):void 0}function m(t,e,r,i,f,n){var a=t&r^~t&f;return 0>a&&(a+=4294967296),a}function v(t,e,r,i,f,n){var a=e&i^~e&n;return 0>a&&(a+=4294967296),a}function g(t,e,r,i,f,n){var a=t&r^t&f^r&f;return 0>a&&(a+=4294967296),a}function y(t,e,r,i,f,n){var a=e&i^e&n^i&n;return 0>a&&(a+=4294967296),a}function w(t,e){var r=N(t,e,28),i=N(e,t,2),f=N(e,t,7),n=r^i^f;return 0>n&&(n+=4294967296),n}function M(t,e){var r=L(t,e,28),i=L(e,t,2),f=L(e,t,7),n=r^i^f;return 0>n&&(n+=4294967296),n}function A(t,e){var r=N(t,e,14),i=N(t,e,18),f=N(e,t,9),n=r^i^f;return 0>n&&(n+=4294967296),n}function S(t,e){var r=L(t,e,14),i=L(t,e,18),f=L(e,t,9),n=r^i^f;return 0>n&&(n+=4294967296),n}function _(t,e){var r=N(t,e,1),i=N(t,e,8),f=O(t,e,7),n=r^i^f;return 0>n&&(n+=4294967296),n}function x(t,e){var r=L(t,e,1),i=L(t,e,8),f=C(t,e,7),n=r^i^f;return 0>n&&(n+=4294967296),n}function I(t,e){var r=N(t,e,19),i=N(e,t,29),f=O(t,e,6),n=r^i^f;return 0>n&&(n+=4294967296),n}function R(t,e){var r=L(t,e,19),i=L(e,t,29),f=C(t,e,6),n=r^i^f;return 0>n&&(n+=4294967296),n}var E=r(2),P=E.utils,z=P.assert,B=P.rotr32,k=P.rotl32,q=P.sum32,T=P.sum32_4,j=P.sum32_5,N=P.rotr64_hi,L=P.rotr64_lo,O=P.shr64_hi,C=P.shr64_lo,U=P.sum64,Y=P.sum64_hi,D=P.sum64_lo,F=P.sum64_4_hi,J=P.sum64_4_lo,Z=P.sum64_5_hi,X=P.sum64_5_lo,V=E.common.BlockHash,H=[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],K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=[1518500249,1859775393,2400959708,3395469782];P.inherits(i,V),e.sha256=i,i.blockSize=512,i.outSize=256,i.hmacStrength=192,i.padLength=64,i.prototype._update=function(t,e){for(var r=this.W,i=0;16>i;i++)r[i]=t[e+i];for(;r.length>i;i++)r[i]=T(l(r[i-2]),r[i-7],b(r[i-15]),r[i-16]);var f=this.h[0],n=this.h[1],a=this.h[2],d=this.h[3],h=this.h[4],p=this.h[5],m=this.h[6],v=this.h[7];z(this.k.length===r.length);for(var i=0;r.length>i;i++){var g=j(v,u(h),o(h,p,m),this.k[i],r[i]),y=q(c(f),s(f,n,a));v=m,m=p,p=h,h=q(d,g),d=a,a=n,n=f,f=q(g,y)}this.h[0]=q(this.h[0],f),this.h[1]=q(this.h[1],n),this.h[2]=q(this.h[2],a),this.h[3]=q(this.h[3],d),this.h[4]=q(this.h[4],h),this.h[5]=q(this.h[5],p),this.h[6]=q(this.h[6],m),this.h[7]=q(this.h[7],v)},i.prototype._digest=function(t){return"hex"===t?P.toHex32(this.h,"big"):P.split32(this.h,"big")},P.inherits(f,i),e.sha224=f,f.blockSize=512,f.outSize=224,f.hmacStrength=192,f.padLength=64,f.prototype._digest=function(t){return"hex"===t?P.toHex32(this.h.slice(0,7),"big"):P.split32(this.h.slice(0,7),"big")},P.inherits(n,V),e.sha512=n,n.blockSize=1024,n.outSize=512,n.hmacStrength=192,n.padLength=128,n.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;32>i;i++)r[i]=t[e+i];for(;r.length>i;i+=2){var f=I(r[i-4],r[i-3]),n=R(r[i-4],r[i-3]),a=r[i-14],d=r[i-13],o=_(r[i-30],r[i-29]),s=x(r[i-30],r[i-29]),h=r[i-32],c=r[i-31];r[i]=F(f,n,a,d,o,s,h,c),r[i+1]=J(f,n,a,d,o,s,h,c)}},n.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],f=this.h[1],n=this.h[2],a=this.h[3],d=this.h[4],o=this.h[5],s=this.h[6],h=this.h[7],c=this.h[8],u=this.h[9],b=this.h[10],l=this.h[11],p=this.h[12],_=this.h[13],x=this.h[14],I=this.h[15];z(this.k.length===r.length);for(var R=0;r.length>R;R+=2){var E=x,P=I,B=A(c,u),k=S(c,u),q=m(c,u,b,l,p,_),T=v(c,u,b,l,p,_),j=this.k[R],N=this.k[R+1],L=r[R],O=r[R+1],C=Z(E,P,B,k,q,T,j,N,L,O),F=X(E,P,B,k,q,T,j,N,L,O),E=w(i,f),P=M(i,f),B=g(i,f,n,a,d,o),k=y(i,f,n,a,d,o),J=Y(E,P,B,k),V=D(E,P,B,k);x=p,I=_,p=b,_=l,b=c,l=u,c=Y(s,h,C,F),u=D(h,h,C,F),s=d,h=o,d=n,o=a,n=i,a=f,i=Y(C,F,J,V),f=D(C,F,J,V)}U(this.h,0,i,f),U(this.h,2,n,a),U(this.h,4,d,o),U(this.h,6,s,h),U(this.h,8,c,u),U(this.h,10,b,l),U(this.h,12,p,_),U(this.h,14,x,I)},n.prototype._digest=function(t){return"hex"===t?P.toHex32(this.h,"big"):P.split32(this.h,"big")},P.inherits(a,n),e.sha384=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(t){return"hex"===t?P.toHex32(this.h.slice(0,12),"big"):P.split32(this.h.slice(0,12),"big")},P.inherits(d,V),e.sha1=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,i=0;16>i;i++)r[i]=t[e+i];for(;r.length>i;i++)r[i]=k(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);for(var f=this.h[0],n=this.h[1],a=this.h[2],d=this.h[3],o=this.h[4],i=0;r.length>i;i++){var s=~~(i/20),h=j(k(f,5),p(s,n,a,d),o,r[i],W[s]);o=d,d=a,a=k(n,30),n=f,f=h}this.h[0]=q(this.h[0],f),this.h[1]=q(this.h[1],n),this.h[2]=q(this.h[2],a),this.h[3]=q(this.h[3],d),this.h[4]=q(this.h[4],o)},d.prototype._digest=function(t){return"hex"===t?P.toHex32(this.h,"big"):P.split32(this.h,"big")}},function(t,e,r){function i(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var i=0;t.length>i;i+=2)r.push(parseInt(t[i]+t[i+1],16))}}else for(var i=0;t.length>i;i++){var f=t.charCodeAt(i),n=f>>8,a=255&f;n?r.push(n,a):r.push(a)}else for(var i=0;t.length>i;i++)r[i]=0|t[i];return r}function f(t){for(var e="",r=0;t.length>r;r++)e+=d(t[r].toString(16));return e}function n(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24;return e>>>0}function a(t,e){for(var r="",i=0;t.length>i;i++){var f=t[i];"little"===e&&(f=n(f)),r+=o(f.toString(16))}return r}function d(t){return 1===t.length?"0"+t:t}function o(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 s(t,e,r,i){var f=r-e;v(f%4===0);for(var n=Array(f/4),a=0,d=e;n.length>a;a++,d+=4){var o;o="big"===i?t[d]<<24|t[d+1]<<16|t[d+2]<<8|t[d+3]:t[d+3]<<24|t[d+2]<<16|t[d+1]<<8|t[d],n[a]=o>>>0}return n}function h(t,e){for(var r=Array(4*t.length),i=0,f=0;t.length>i;i++,f+=4){var n=t[i];"big"===e?(r[f]=n>>>24,r[f+1]=n>>>16&255,r[f+2]=n>>>8&255,r[f+3]=255&n):(r[f+3]=n>>>24,r[f+2]=n>>>16&255,r[f+1]=n>>>8&255,r[f]=255&n)}return r}function c(t,e){return t>>>e|t<<32-e}function u(t,e){return t<>>32-e}function b(t,e){return t+e>>>0}function l(t,e,r){return t+e+r>>>0}function p(t,e,r,i){return t+e+r+i>>>0}function m(t,e,r,i,f){return t+e+r+i+f>>>0}function v(t,e){if(!t)throw Error(e||"Assertion failed")}function g(t,e,r,i){var f=t[e],n=t[e+1],a=i+n>>>0,d=(i>a?1:0)+r+f;t[e]=d>>>0,t[e+1]=a}function y(t,e,r,i){var f=e+i>>>0,n=(e>f?1:0)+t+r;return n>>>0}function w(t,e,r,i){var f=e+i;return f>>>0}function M(t,e,r,i,f,n,a,d){var o=0,s=e;s=s+i>>>0,o+=e>s?1:0,s=s+n>>>0,o+=n>s?1:0,s=s+d>>>0,o+=d>s?1:0;var h=t+r+f+a+o;return h>>>0}function A(t,e,r,i,f,n,a,d){var o=e+i+n+d;return o>>>0}function S(t,e,r,i,f,n,a,d,o,s){var h=0,c=e;c=c+i>>>0,h+=e>c?1:0,c=c+n>>>0,h+=n>c?1:0,c=c+d>>>0,h+=d>c?1:0,c=c+s>>>0,h+=s>c?1:0;var u=t+r+f+a+o+h;return u>>>0}function _(t,e,r,i,f,n,a,d,o,s){var h=e+i+n+d+s;return h>>>0}function x(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}function I(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}function R(t,e,r){return t>>>r}function E(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}var P=e,z=r(5);P.toArray=i,P.toHex=f,P.htonl=n,P.toHex32=a,P.zero2=d,P.zero8=o,P.join32=s,P.split32=h,P.rotr32=c,P.rotl32=u,P.sum32=b,P.sum32_3=l,P.sum32_4=p,P.sum32_5=m,P.assert=v,P.inherits=z,e.sum64=g,e.sum64_hi=y,e.sum64_lo=w,e.sum64_4_hi=M,e.sum64_4_lo=A,e.sum64_5_hi=S,e.sum64_5_lo=_,e.rotr64_hi=x,e.rotr64_lo=I,e.shr64_hi=R,e.shr64_lo=E},function(t,e){e.read=function(t,e,r,i,f){var n,a,d=8*f-i-1,o=(1<>1,h=-7,c=r?f-1:0,u=r?-1:1,b=t[e+c];for(c+=u,n=b&(1<<-h)-1,b>>=-h,h+=d;h>0;n=256*n+t[e+c],c+=u,h-=8);for(a=n&(1<<-h)-1,n>>=-h,h+=i;h>0;a=256*a+t[e+c],c+=u,h-=8);if(0===n)n=1-s;else{if(n===o)return a?NaN:(b?-1:1)*(1/0);a+=Math.pow(2,i),n-=s}return(b?-1:1)*a*Math.pow(2,n-i)},e.write=function(t,e,r,i,f,n){var a,d,o,s=8*n-f-1,h=(1<>1,u=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:n-1,l=i?1:-1,p=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(d=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-a))<1&&(a--,o*=2),e+=1>a+c?u*Math.pow(2,1-c):u/o,2>e*o||(a++,o/=2),h>a+c?1>a+c?(d=e*Math.pow(2,c-1)*Math.pow(2,f),a=0):(d=(e*o-1)*Math.pow(2,f),a+=c):(d=0,a=h));f>=8;t[r+b]=255&d,b+=l,d/=256,f-=8);for(a=a<0;t[r+b]=255&a,b+=l,a/=256,s-=8);t[r+b-l]|=128*p}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){t.exports={_args:[[{raw:"elliptic@6.3.2",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"6.3.2",spec:"6.3.2",type:"version"},"/home/nick/github/ethjs-account"]],_from:"elliptic@6.3.2",_id:"elliptic@6.3.2",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"6.3.0",_npmOperationalInternal:{host:"packages-16-east.internal.npmjs.com",tmp:"tmp/elliptic-6.3.2.tgz_1473938837205_0.3108903462998569"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.3",_phantomChildren:{},_requested:{raw:"elliptic@6.3.2",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"6.3.2",spec:"6.3.2",type:"version"},_requiredBy:["/","/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.3.2.tgz",_shasum:"e4c81e0829cf0a65ab70e998b8232723b5c1bc48",_shrinkwrap:null,_spec:"elliptic@6.3.2",_where:"/home/nick/github/ethjs-account",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"e4c81e0829cf0a65ab70e998b8232723b5c1bc48",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.3.2.tgz"},files:["lib"],gitHead:"cbace4683a4a548dc0306ef36756151a20299cd5",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.3.2"}},function(t,e){t.exports=window.crypto},function(t,e,r){t.exports=r(34)},function(t,e,r){var i=function(t,e){var i=r(35),f="function"==typeof e;if(t>65536){if(!f)throw Error("Requested too many random bytes.");e(Error("Requested too many random bytes."))}if(void 0!==i&&i.randomBytes){if(!f)return"0x"+i.randomBytes(t).toString("hex");i.randomBytes(t,function(t,r){t?e(o):e(null,"0x"+r.toString("hex"))})}else{var n;if(void 0!==i?n=i:"undefined"!=typeof msCrypto&&(n=msCrypto),n&&n.getRandomValues){var a=n.getRandomValues(new Uint8Array(t)),d="0x"+Array.from(a).map(function(t){return t.toString(16)}).join("");if(!f)return d;e(null,d)}else{var o=Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.');if(!f)throw o;e(o)}}};t.exports=i},function(t,e,r){var i=r(31);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(i){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,configurable:!1,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,configurable:!1,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){t.exports=r(7)}])});
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 |
3 | ## Table of Contents
4 |
5 | - [General](general)
6 | - [**Developer Guide**](developer-guide.md)
7 | - [**User Guide**](user-guide.md)
8 |
9 | ## Overview
10 |
11 | ### Structure
12 |
13 | The [`src/`](../../../tree/master/src) directory contains your entire application code, including JavaScript, and tests.
14 |
15 | The rest of the folders and files only exist to make your life easier, and
16 | should not need to be touched.
17 |
18 | For more in-depth structure, see the developer-guide.md.
19 |
20 | *(If they do have to be changed, please [submit an issue](https://github.com/ethjs/ethjs-account/issues)!)*
21 |
22 | ### Testing
23 |
24 | For a thorough explanation of the testing procedure, see the
25 | [testing documentation](./developer-guide/README.md)!
26 |
27 | #### Unit testing
28 |
29 | Unit tests live in `src/tests/` directories right next to the components being tested
30 | and are run with `npm test`.
31 |
--------------------------------------------------------------------------------
/docs/developer-guide.md:
--------------------------------------------------------------------------------
1 | # Developer Guide
2 |
3 | All information regarding contributing to and progressing `ethjs-account` module can be found in this document.
4 |
5 | ## Install
6 |
7 | ```
8 | npm install --save ethjs-account
9 | ```
10 |
11 | ## Install from Source
12 |
13 | ```
14 | git clone http://github.com/ethjs/ethjs-account
15 | npm install
16 | ```
17 |
18 | ## Test
19 |
20 | ```
21 | npm test
22 | ```
23 |
24 | ## Build
25 |
26 | ```
27 | npm run build
28 | ```
29 |
30 | ## Linting
31 |
32 | ```
33 | npm run lint
34 | ```
35 |
36 | ## Travis-ci and Coveralls Testing
37 |
38 | Note, this will generate a `coveralls` report locally.
39 |
40 | ```
41 | npm run test-travis
42 | ```
43 |
44 | You can find the coveralls report and view the percentages and stats, by going to the [index.html](coverage/lcov-report/index.html) file generated after running the `test-travis` script. Open this in Chrome to see the generated report. Travis will run mocha as usual, but collect information about the testing coverage. This report will be sent by TravisCI during the automated build process.
45 |
46 | ## Build Staging
47 |
48 | The build staging for this module is as follows:
49 |
50 | 1. Cleanup
51 | 2. Linting
52 | 3. Testing
53 | 4. Babel processing (output to lib)
54 | 5. Webpack (output to dist)
55 | 6. Webpack production (output to dist)
56 | 7. Retest lib folder for babel processing solidity
57 | 8. Report build stats
58 |
59 | ## Folder Structure
60 |
61 | All module source code is found in the `src` directory. All module helper scripts can be found in the `scripts` folder. These will not need to be touched, and are purely configuration for this repository.
62 |
63 | ```
64 | ./ethjs-account
65 | ./.github
66 | ./dist
67 | ./lib
68 | ./tests
69 | ./internals
70 | ./webpack
71 | ./coverage
72 | ./docs
73 | ./src
74 | ./tests
75 | ```
76 |
77 | Note, the `./lib` dir is generated from the babel build staging. `./coverage` is generated from the `npm run test-travis` script. All internals and helper scripts (i.e. `webpack`) are in `./internals`. All distribution builds are in `./dist` (usually a minified and unminified production build of the package).
78 |
79 | ## NPM Practice
80 |
81 | Across all `ethjs-` repos, we enforce version hardening (i.e. "0.0.3" not "^0.0.3"). We want to reduce potential hazardous install changes from dependancies as much as possible to ensure package preformace, testing, security and design. Please make sure all your commits and PR's are version hardend if you are installing or removing new packages.
82 |
83 | After build staging it is the `lib` folder which actually gets published to NPM. This allows for easy inclusion into other modules which may not use babel transpiling or which may not support es2015+.
84 |
85 | ## Webpack
86 |
87 | `ethjs` uses webpack across all its browser focused repos. Webpack is used to package down project files into distribution builds for the browser. You can see the builds it produces by going to the [dist](dist) folder.
88 |
89 | Read more about webpack here:
90 | https://github.com/webpack/docs
91 |
92 | ## Testing ethereumjs
93 |
94 | This module is tested against ethereumjs-util.
95 |
96 | ## NPM/Node Version Requirements
97 |
98 | `ethjs` requires you have:
99 | - `nodejs` -v 6.5.0+
100 | - `npm` -v 3.0+
101 |
102 | This is a requirement to run, test, lint and build this module.
103 |
104 | ## Changelog
105 |
106 | All relevant changes are notated in the `CHANGELOG.md` file, moniter this file for changes to this repository.
107 |
108 | ## Travis-ci and Coveralls Practice
109 |
110 | Across all `ethjs-` repos, we enforce mandatory travis-ci and coveralls testing. We never `commit to master`. As a general policy, Coveralls.io results must always be above 95% for any `ethjs-` PR or commit. We want to ensure complete coverage across the board.
111 |
112 | ## Contributing
113 |
114 | Please help better the ecosystem by submitting issues and pull requests. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard. Please read more about contributing to `ethjs-account` in the `.github/CONTRIBUTING.md`.
115 |
116 | ## Licence
117 |
118 | This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.
119 |
--------------------------------------------------------------------------------
/docs/user-guide.md:
--------------------------------------------------------------------------------
1 | # User Guide
2 |
3 | All information for developers using `ethjs-account` should consult this document.
4 |
5 | ## Install
6 |
7 | ```
8 | npm install --save ethjs-account
9 | ```
10 |
11 | ## Usage
12 |
13 | ```js
14 | const generate = require('ethjs-account').generate;
15 |
16 | console.log(generate('892h@fs8sk^2h8s8shfs.jk39hsoi@hohskd..'));
17 |
18 | /* result
19 | {
20 | address: '0x...',
21 | privateKey: '0x...',
22 | publicKey: '0x....',
23 | }
24 | */
25 | ```
26 |
27 | ## API Design
28 |
29 | ### generate
30 |
31 | [index.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
32 |
33 | Intakes a string of entropy, and outputs an address private key and public key.
34 |
35 | **Parameters**
36 |
37 | - `entropy` **String** a single string of entropy (`IMPORTANT NOTE`: be sure to make it long, complex and well sourced entropy)
38 |
39 | Result output generated account **Object**.
40 |
41 | ```js
42 | const generate = require('ethjs-account').generate;
43 |
44 | console.log(generate('892h@fs8sk^2h8s8shfs.jk39hsoi@hohskd..'));
45 |
46 | /* result
47 | {
48 | address: '0x...',
49 | privateKey: '0x...',
50 | publicKey: '0x....',
51 | }
52 | */
53 | ```
54 |
55 | ### getAddress
56 |
57 | [index.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
58 |
59 | Intakes a public key buffer object, outputs an Ethereum 20 byte address
60 |
61 | **Parameters**
62 |
63 | - `publicKey` **Object** public key buffer object
64 |
65 | Result output an Ethereum 20 byte address **String**.
66 |
67 | ```js
68 | const getAddress = require('ethjs-account').getAddress;
69 |
70 | console.log(getAddress());
71 |
72 | /* result '0x......' */
73 | ```
74 |
75 | ### getChecksumAddress
76 |
77 | [getChecksumAddress.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
78 |
79 | Intakes an address, outputs a checksum address.
80 |
81 | **Parameters**
82 |
83 | - `address` **String** a single Ethereum address as a 20 byte hex string
84 |
85 | Result output checksum address **String**.
86 |
87 | ```js
88 | const getChecksumAddress = require('ethjs-account').getChecksumAddress;
89 |
90 | console.log(getChecksumAddress('0x.....'));
91 |
92 | /* result 0x..... */
93 | ```
94 |
95 | ### privateToPublic
96 |
97 | [index.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
98 |
99 | Intakes a single private key, outputs a public key Buffer instance.
100 |
101 | **Parameters**
102 |
103 | - `privateKey` **String** a single 32 byte hex string (with hex prefix).
104 |
105 | Result output public key Buffer instance **Object**.
106 |
107 | ```js
108 | const privateToPublic = require('ethjs-account').privateToPublic;
109 |
110 | console.log(privateToPublic(sha3('892h@fs8sk^2h8s8shfs.jk39hsoi@hohskd..')));
111 |
112 | /* result */
113 | ```
114 |
115 | ### publicToAddress
116 |
117 | [index.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
118 |
119 | Intakes a single public key instance, outputs an Ethereum standard 20 byte hex string address.
120 |
121 | **Parameters**
122 |
123 | - `publicKey` **Object** a public key buffer instance object
124 |
125 | Result output Ethereum standard 20 byte checksum address **String**.
126 |
127 | Note, the address exported is the checksum address, `.toLowerCase` when using with modules that do not support the casing mixture.
128 |
129 | ```js
130 | const publicToAddress = require('ethjs-account').publicToAddress;
131 |
132 | console.log(publicToAddress());
133 |
134 | // result '0x......'
135 | ```
136 |
137 | ### privateToAccount
138 |
139 | [index.js:ethjs-account](../../../blob/master/src/index.js "Source code on GitHub")
140 |
141 | Intakes a single private key, outputs an account object containing three hex strings, `publicKey`, `privateKey` and `address`.
142 |
143 | **Parameters**
144 |
145 | - `privateKey` **String** a single 32 byte private key string (hex prefixed).
146 |
147 | Result output account **Object**.
148 |
149 | ```js
150 | const privateToAccount = require('ethjs-account').privateToAccount;
151 |
152 | console.log(privateToAccount(sha3('892h@fs8sk^2h8s8shfs.jk39hsoi@hohskd..')));
153 |
154 | /* result
155 | {
156 | address: '0x...',
157 | privateKey: '0x...',
158 | publicKey: '0x....',
159 | }
160 | */
161 | ```
162 |
163 | Note, the address exported is the checksum address, `.toLowerCase` when using with modules that do not support the casing mixture.
164 |
165 | ## A Note on Entropy and Account Safety
166 |
167 | In order to generate an account that is safe for use, you must generate a lot of entropy. The larger, more complex, more hashed and more sourced the better. Please be sure to use very powerful entropy generation tools and sources.
168 |
169 | See:
170 | https://github.com/keybase/more-entropy
171 | https://github.com/ConsenSys/eth-lightwallet
172 | https://github.com/mdp/gibberish-aes/
173 |
174 | ## Entropy Used
175 |
176 | This module uses [`randombytes`](https://github.com/crypto-browserify/randombytes) for some extra entropy. This module does not work in older browsers and will throw an error. In node, this module uses `crypto.randomBytes`, while in the browser it uses the `window` crypto module. Random bytes is purely for some basic entropy saftey and is in no way a solid replacement for good entropy. It is up to you to provide extensive entropy for your key generation.
177 |
178 | ## Browser Builds
179 |
180 | `ethjs` provides production distributions for all of its modules that are ready for use in the browser right away. Simply include either `dist/ethjs-account.js` or `dist/ethjs-account.min.js` directly into an HTML file to start using this module. Note, an `ethSha3` object is made available globally.
181 |
182 | ```html
183 |
184 |
187 | ```
188 |
189 | Note, even though `ethjs` should have transformed and polyfilled most of the requirements to run this module across most modern browsers. You may want to look at an additional polyfill for extra support.
190 |
191 | Use a polyfill service such as `Polyfill.io` to ensure complete cross-browser support:
192 | https://polyfill.io/
193 |
194 | ## Latest Webpack Figures
195 |
196 | ```
197 | Hash: ab378ace2dcbcdc84923
198 | Version: webpack 2.1.0-beta.15
199 | Time: 1041ms
200 | Asset Size Chunks Chunk Names
201 | ethjs-account.js 313 kB 0 [emitted] main
202 | ethjs-account.js.map 385 kB 0 [emitted] main
203 | [37] multi main 28 bytes {0} [built]
204 | + 37 hidden modules
205 |
206 | Hash: f6b69ff438836239c7a6
207 | Version: webpack 2.1.0-beta.15
208 | Time: 4124ms
209 | Asset Size Chunks Chunk Names
210 | ethjs-account.min.js 164 kB 0 [emitted] main
211 | [37] multi main 28 bytes {0} [built]
212 | + 37 hidden modules
213 | ```
214 |
215 | ## Other Awesome Modules, Tools and Frameworks
216 |
217 | ### Foundation
218 | - [web3.js](https://github.com/ethereum/web3.js) -- the original Ethereum JS swiss army knife **Ethereum Foundation**
219 | - [ethereumjs](https://github.com/ethereumjs) -- critical ethereum javascript infrastructure **Ethereum Foundation**
220 | - [browser-solidity](https://ethereum.github.io/browser-solidity) -- an in browser Solidity IDE **Ethereum Foundation**
221 |
222 | ### Nodes
223 | - [geth](https://github.com/ethereum/go-ethereum) Go-Ethereum
224 | - [parity](https://github.com/ethcore/parity) Rust-Ethereum build in Rust
225 | - [testrpc](https://github.com/ethereumjs/testrpc) Testing Node (ethereumjs-vm)
226 |
227 | ### Testing
228 | - [wafr](https://github.com/silentcicero/wafr) -- a super simple Solidity testing framework
229 | - [truffle](https://github.com/ConsenSys/truffle) -- a solidity/js dApp framework
230 | - [embark](https://github.com/iurimatias/embark-framework) -- a solidity/js dApp framework
231 | - [dapple](https://github.com/nexusdev/dapple) -- a solidity dApp framework
232 | - [chaitherium](https://github.com/SafeMarket/chaithereum) -- a JS web3 unit testing framework
233 | - [contest](https://github.com/DigixGlobal/contest) -- a JS testing framework for contracts
234 |
235 | ### Wallets
236 | - [ethers-wallet](https://github.com/ethers-io/ethers-wallet) -- an amazingly small Ethereum wallet
237 | - [metamask](https://metamask.io/) -- turns your browser into an Ethereum enabled browser =D
238 |
239 | ## Our Relationship with Ethereum & EthereumJS
240 |
241 | We would like to mention that we are not in any way affiliated with the Ethereum Foundation or `ethereumjs`. However, we love the work they do and work with them often to make Ethereum great! Our aim is to support the Ethereum ecosystem with a policy of diversity, modularity, simplicity, transparency, clarity, optimization and extensibility.
242 |
243 | Many of our modules use code from `web3.js` and the `ethereumjs-` repositories. We thank the authors where we can in the relevant repositories. We use their code carefully, and make sure all test coverage is ported over and where possible, expanded on.
244 |
245 | ## A Special Thanks
246 |
247 | A special thanks to Richard Moore for building `ethers-wallet` and other amazing things. Aaron Davis (@kumavis) for his guidence.
248 |
--------------------------------------------------------------------------------
/internals/webpack/webpack.config.js:
--------------------------------------------------------------------------------
1 | var webpack = require('webpack'); // eslint-disable-line
2 |
3 | var env = process.env.NODE_ENV; // eslint-disable-line
4 | var filename = 'ethjs-account'; // eslint-disable-line
5 | var library = 'ethAccount'; // eslint-disable-line
6 | var config = { // eslint-disable-line
7 | entry: [
8 | './lib/index.js',
9 | ],
10 | module: {
11 | loaders: [
12 | {
13 | test: /\.js$/,
14 | loaders: ['babel-loader'],
15 | exclude: /node_modules/,
16 | },
17 | {
18 | test: /\.json$/,
19 | loader: 'json',
20 | },
21 | ],
22 | },
23 | devtool: 'cheap-module-source-map',
24 | output: {
25 | path: 'dist',
26 | filename: filename + '.js', // eslint-disable-line
27 | library: library, // eslint-disable-line
28 | libraryTarget: 'umd',
29 | umdNamedDefine: true,
30 | },
31 | plugins: [
32 | new webpack.BannerPlugin({ banner: ' /* eslint-disable */ ', raw: true, entryOnly: true }),
33 | new webpack.BannerPlugin({ banner: ' /* eslint-disable */ ', raw: true }),
34 | new webpack.optimize.OccurrenceOrderPlugin(),
35 | new webpack.DefinePlugin({
36 | 'process.env.NODE_ENV': JSON.stringify(env),
37 | }),
38 | ],
39 | };
40 |
41 | if (env === 'production') {
42 | config.output.filename = filename + '.min.js'; // eslint-disable-line
43 | config.plugins
44 | .push(new webpack.optimize.UglifyJsPlugin({
45 | compressor: {
46 | pure_getters: true,
47 | unsafe: true,
48 | unsafe_comps: true,
49 | warnings: false,
50 | screw_ie8: false,
51 | },
52 | mangle: {
53 | screw_ie8: false,
54 | },
55 | output: {
56 | screw_ie8: false,
57 | },
58 | }));
59 | config.plugins.push(new webpack.optimize.DedupePlugin());
60 | }
61 |
62 | module.exports = config;
63 |
--------------------------------------------------------------------------------
/nano.save:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ethjs-account",
3 | "version": "0.1.4",
4 | "description": "A simple Ethereum account utility module.",
5 | "main": "lib/index.js",
6 | "files": [
7 | "dist",
8 | "internals",
9 | "lib",
10 | "src"
11 | ],
12 | "scripts": {
13 | "start": "npm test",
14 | "release": "npmpub",
15 | "pretest": "npm run lint",
16 | "prepublish": "npm run build",
17 | "prebuild": "npm run build:clean && npm run test",
18 | "build:clean": "npm run test:clean && rimraf ./dist",
19 | "build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --copy-files",
20 | "build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack --config ./internals/webpack/webpack.config.js --progress",
21 | "build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack --config ./internals/webpack/webpack.config.js --progress",
22 | "build:stats": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack --config ./internals/webpack/webpack.config.js --progress --profile --json > dist/stats.json",
23 | "build": "npm run build:commonjs && npm run test:lib && npm run build:umd && npm run build:umd:min",
24 | "lint": "npm run lint:js",
25 | "lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern **/**.min.js",
26 | "lint:js": "npm run lint:eslint -- . ",
27 | "lint:staged": "lint-staged",
28 | "test:clean": "rimraf ./coverage",
29 | "test": "mocha ./src/tests/**/*.js -R spec --timeout 2000000",
30 | "test:lib": "mocha ./lib/tests/**/*.js -R spec --timeout 2000000",
31 | "test-travis": "node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- src/tests/**/*.js -R spec --timeout 2000000",
32 | "coveralls": "npm run test-travis && cat ./coverage/lcov.info | coveralls"
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "git+ssh://git@github.com/ethjs/ethjs-account.git"
37 | },
38 | "keywords": [
39 | "ethereum",
40 | "rpc",
41 | "formatter",
42 | "format",
43 | "ethereum",
44 | "encoding",
45 | "decoding"
46 | ],
47 | "authors": [
48 | "Nick Dodson "
49 | ],
50 | "contributors": [
51 | {
52 | "name": "Richard Moore",
53 | "email": "me@ricmoo.com",
54 | "url": "https://ethers.io"
55 | }
56 | ],
57 | "engines": {
58 | "npm": ">=3",
59 | "node": ">=6.5.0"
60 | },
61 | "license": "MIT",
62 | "bugs": {
63 | "url": "https://github.com/ethjs/ethjs-account/issues"
64 | },
65 | "homepage": "https://github.com/ethjs/ethjs-account#readme",
66 | "babel": {
67 | "plugins": [
68 | [
69 | "transform-es2015-template-literals",
70 | {
71 | "loose": true
72 | }
73 | ],
74 | "transform-es2015-literals",
75 | "transform-es2015-function-name",
76 | "transform-es2015-arrow-functions",
77 | "transform-es2015-block-scoped-functions",
78 | [
79 | "transform-es2015-classes",
80 | {
81 | "loose": true
82 | }
83 | ],
84 | "transform-es2015-object-super",
85 | "transform-es2015-shorthand-properties",
86 | [
87 | "transform-es2015-computed-properties",
88 | {
89 | "loose": true
90 | }
91 | ],
92 | [
93 | "transform-es2015-for-of",
94 | {
95 | "loose": true
96 | }
97 | ],
98 | "transform-es2015-sticky-regex",
99 | "transform-es2015-unicode-regex",
100 | "check-es2015-constants",
101 | [
102 | "transform-es2015-spread",
103 | {
104 | "loose": true
105 | }
106 | ],
107 | "transform-es2015-parameters",
108 | [
109 | "transform-es2015-destructuring",
110 | {
111 | "loose": true
112 | }
113 | ],
114 | "transform-es2015-block-scoping",
115 | "transform-object-rest-spread",
116 | "transform-es3-member-expression-literals",
117 | "transform-es3-property-literals"
118 | ],
119 | "env": {
120 | "commonjs": {
121 | "plugins": [
122 | [
123 | "transform-es2015-modules-commonjs",
124 | {
125 | "loose": true
126 | }
127 | ]
128 | ]
129 | }
130 | }
131 | },
132 | "dependencies": {
133 | "elliptic": "6.3.2",
134 | "ethjs-sha3": "0.1.2",
135 | "randomhex": "0.1.5",
136 | "strip-hex-prefix": "^1.0.0"
137 | },
138 | "devDependencies": {
139 | "babel-cli": "6.18.0",
140 | "babel-core": "6.18.2",
141 | "babel-eslint": "7.1.0",
142 | "babel-loader": "6.2.8",
143 | "ethereumjs-util": "5.0.1",
144 | "sandboxed-module": "2.0.3",
145 | "babel-plugin-check-es2015-constants": "6.8.0",
146 | "babel-plugin-transform-es2015-arrow-functions": "6.8.0",
147 | "babel-plugin-transform-es2015-block-scoped-functions": "6.8.0",
148 | "babel-plugin-transform-es2015-block-scoping": "6.18.0",
149 | "babel-plugin-transform-es2015-classes": "6.18.0",
150 | "babel-plugin-transform-es2015-computed-properties": "6.8.0",
151 | "babel-plugin-transform-es2015-destructuring": "6.19.0",
152 | "babel-plugin-transform-es2015-for-of": "6.18.0",
153 | "babel-plugin-transform-es2015-function-name": "6.9.0",
154 | "babel-plugin-transform-es2015-literals": "6.8.0",
155 | "babel-plugin-transform-es2015-modules-commonjs": "6.18.0",
156 | "babel-plugin-transform-es2015-object-super": "6.8.0",
157 | "babel-plugin-transform-es2015-parameters": "6.18.0",
158 | "babel-plugin-transform-es2015-shorthand-properties": "6.18.0",
159 | "babel-plugin-transform-es2015-spread": "6.8.0",
160 | "babel-plugin-transform-es2015-sticky-regex": "6.8.0",
161 | "babel-plugin-transform-es2015-template-literals": "6.8.0",
162 | "babel-plugin-transform-es2015-unicode-regex": "6.11.0",
163 | "babel-plugin-transform-es3-member-expression-literals": "6.5.0",
164 | "babel-plugin-transform-es3-property-literals": "6.5.0",
165 | "babel-plugin-transform-object-rest-spread": "6.19.0",
166 | "babel-register": "6.18.0",
167 | "check-es3-syntax-cli": "0.1.3",
168 | "webpack": "2.1.0-beta.15",
169 | "json-loader": "0.5.4",
170 | "rimraf": "2.3.4",
171 | "cross-env": "1.0.7",
172 | "chai": "3.5.0",
173 | "coveralls": "2.11.9",
174 | "js-sha3": "0.5.5",
175 | "istanbul": "0.4.5",
176 | "eslint": "2.10.1",
177 | "eslint-config-airbnb": "9.0.1",
178 | "eslint-import-resolver-webpack": "0.2.4",
179 | "eslint-plugin-import": "1.8.0",
180 | "eslint-plugin-jsx-a11y": "1.2.0",
181 | "eslint-plugin-react": "5.1.1",
182 | "eventsource-polyfill": "0.9.6",
183 | "lint-staged": "1.0.1",
184 | "mocha": "3.1.2",
185 | "pre-commit": "1.1.3",
186 | "web3": "0.17.0-beta"
187 | },
188 | "lint-staged": {
189 | "lint:eslint": "*.js"
190 | },
191 | "eslintConfig": {
192 | "parser": "babel-eslint",
193 | "extends": "airbnb",
194 | "env": {
195 | "node": true,
196 | "mocha": true,
197 | "es6": true
198 | },
199 | "parserOptions": {
200 | "ecmaVersion": 6,
201 | "sourceType": "module"
202 | },
203 | "rules": {
204 | "import/no-unresolved": 2,
205 | "comma-dangle": [
206 | 2,
207 | "always-multiline"
208 | ],
209 | "indent": [
210 | 2,
211 | 2,
212 | {
213 | "SwitchCase": 1
214 | }
215 | ],
216 | "no-console": 1,
217 | "max-len": 0,
218 | "prefer-template": 2,
219 | "no-use-before-define": 0,
220 | "newline-per-chained-call": 0,
221 | "arrow-body-style": [
222 | 2,
223 | "as-needed"
224 | ]
225 | }
226 | },
227 | "pre-commit": "build"
228 | }
229 |
--------------------------------------------------------------------------------
/src/getChecksumAddress.js:
--------------------------------------------------------------------------------
1 | const elliptic = require('elliptic');
2 | const sha3 = require('ethjs-sha3');
3 | const secp256k1 = new (elliptic.ec)('secp256k1'); // eslint-disable-line
4 |
5 | /**
6 | * Get the checksum address of a address value
7 | *
8 | * @method getChecksumAddress
9 | * @param {String} addressInput
10 | * @returns {String} output hex string value
11 | */
12 |
13 | module.exports = function getChecksumAddress(addressInput) {
14 | var address = addressInput; // eslint-disable-line
15 |
16 | if (typeof(address) !== 'string' || !address.match(/^0x[0-9A-Fa-f]{40}$/)) {
17 | throw new Error(`[ethjs-account] invalid address value ${JSON.stringify(address)} not a valid hex string`);
18 | }
19 |
20 | address = address.substring(2).toLowerCase();
21 | const hashed = sha3(address, true);
22 |
23 | address = address.split('');
24 | for (var i = 0; i < 40; i += 2) { // eslint-disable-line
25 | if ((hashed[i >> 1] >> 4) >= 8) {
26 | address[i] = address[i].toUpperCase();
27 | }
28 | if ((hashed[i >> 1] & 0x0f) >= 8) {
29 | address[i + 1] = address[i + 1].toUpperCase();
30 | }
31 | }
32 |
33 | return `0x${address.join('')}`;
34 | };
35 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | Primary Attribution
3 | Richard Moore
4 | https://github.com/ethers-io
5 |
6 | Note, Richard is a god of ether gods. Follow and respect him, and use Ethers.io!
7 | */
8 |
9 | const elliptic = require('elliptic');
10 | const sha3 = require('ethjs-sha3');
11 | const randomhex = require('randomhex');
12 | const secp256k1 = new (elliptic.ec)('secp256k1'); // eslint-disable-line
13 | const getChecksumAddress = require('./getChecksumAddress.js');
14 | const stripHexPrefix = require('strip-hex-prefix');
15 |
16 |
17 | /**
18 | * Get the address from a public key
19 | *
20 | * @method getAddress
21 | * @param {String} addressInput
22 | * @returns {String} output the string is a hex string
23 | */
24 |
25 | function getAddress(addressInput) {
26 | var address = addressInput; // eslint-disable-line
27 | var result = null; // eslint-disable-line
28 |
29 | if (typeof(address) !== 'string') { throw new Error(`[ethjs-account] invalid address value ${JSON.stringify(address)} not a valid hex string`); }
30 |
31 | // Missing the 0x prefix
32 | if (address.substring(0, 2) !== '0x' &&
33 | address.substring(0, 2) !== 'XE') { address = `0x${address}`; }
34 |
35 | if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
36 | result = getChecksumAddress(address);
37 |
38 | // It is a checksummed address with a bad checksum
39 | if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
40 | throw new Error('[ethjs-account] invalid address checksum');
41 | }
42 |
43 | // Maybe ICAP? (we only support direct mode)
44 | } else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
45 | throw new Error('[ethjs-account] ICAP and IBAN addresses, not supported yet..');
46 |
47 | /*
48 | // It is an ICAP address with a bad checksum
49 | if (address.substring(2, 4) !== ibanChecksum(address)) {
50 | throw new Error('invalid address icap checksum');
51 | }
52 |
53 | result = (new BN(address.substring(4), 36)).toString(16);
54 | while (result.length < 40) { result = '0' + result; }
55 | result = getChecksumAddress('0x' + result);
56 | */
57 | } else {
58 | throw new Error(`[ethjs-account] invalid address value ${JSON.stringify(address)} not a valid hex string`);
59 | }
60 |
61 | return result;
62 | }
63 |
64 | /**
65 | * Returns the public key for this private key.
66 | *
67 | * @method privateToPublic
68 | * @param {String} privateKey a valid private key hex
69 | * @returns {Object} publicKey the sepk 160 byte public key for this private key
70 | */
71 |
72 | function privateToPublic(privateKey) {
73 | if (typeof privateKey !== 'string') { throw new Error(`[ethjs-account] private key must be type String, got ${typeof(privateKey)}`); }
74 | if (!privateKey.match(/^(0x)?[0-9a-fA-F]{64}$/)) { throw new Error('[ethjs-account] private key must be an alphanumeric hex string that is 32 bytes long.'); }
75 |
76 | const privateKeyBuffer = new Buffer(stripHexPrefix(privateKey), 'hex');
77 | return (new Buffer(secp256k1.keyFromPrivate(privateKeyBuffer).getPublic(false, 'hex'), 'hex')).slice(1);
78 | }
79 |
80 | /**
81 | * Returns the Ethereum standard address of a public sepk key.
82 | *
83 | * @method publicToAddress
84 | * @param {Object} publicKey a single public key Buffer object
85 | * @returns {String} address the 20 byte Ethereum address
86 | */
87 |
88 | function publicToAddress(publicKey) {
89 | if (!Buffer.isBuffer(publicKey)) { throw new Error('[ethjs-account] public key must be a buffer object in order to get public key address'); }
90 |
91 | return getAddress(sha3(publicKey, true).slice(12).toString('hex'));
92 | }
93 |
94 | /**
95 | * Returns an Ethereum account address, private and public key based on the public key.
96 | *
97 | * @method privateToAccount
98 | * @param {String} privateKey a single string of entropy longer than 32 chars
99 | * @returns {Object} output the Ethereum account address, and keys as hex strings
100 | */
101 |
102 | function privateToAccount(privateKey) {
103 | const publicKey = privateToPublic(privateKey, true);
104 |
105 | return {
106 | privateKey: `0x${stripHexPrefix(privateKey)}`,
107 | publicKey: `0x${publicKey.toString('hex')}`,
108 | address: publicToAddress(publicKey),
109 | };
110 | }
111 |
112 | /**
113 | * Create a single Ethereum account address, private and public key.
114 | *
115 | * @method generate
116 | * @param {String} entropy a single string of entropy longer than 32 chars
117 | * @returns {Object} output the Ethereum account address, and keys
118 | */
119 |
120 | function generate(entropy) {
121 | if (typeof entropy !== 'string') { throw new Error(`[ethjs-account] while generating account, invalid input type: '${typeof(entropy)}' should be type 'String'.`); }
122 | if (entropy.length < 32) { throw new Error(`[ethjs-account] while generating account, entropy value not random and long enough, should be at least 32 characters of random information, is only ${entropy.length}`); }
123 |
124 | return privateToAccount(sha3(`${randomhex(16)}${sha3(`${randomhex(32)}${entropy}`)}${randomhex(32)}`));
125 | }
126 |
127 | // exports
128 | module.exports = {
129 | sha3,
130 | generate,
131 | getAddress,
132 | privateToAccount,
133 | getChecksumAddress,
134 | publicToAddress,
135 | privateToPublic,
136 | };
137 |
--------------------------------------------------------------------------------
/src/tests/test.index.js:
--------------------------------------------------------------------------------
1 | const assert = require('chai').assert;
2 | const sha3 = require('ethjs-sha3');
3 | const generate = require('../index.js').generate;
4 | const getAddress = require('../index.js').getAddress;
5 | const getChecksumAddress = require('../index.js').getChecksumAddress;
6 | const privateToAccount = require('../index.js').privateToAccount;
7 | const privateToPublic = require('../index.js').privateToPublic;
8 | const publicToAddress = require('../index.js').publicToAddress;
9 | const crypto = require('crypto');
10 | const ethUtil = require('ethereumjs-util');
11 | const SandboxedModule = require('sandboxed-module');
12 |
13 | SandboxedModule.registerBuiltInSourceTransformer('istanbul');
14 | const invalidGetAddress = SandboxedModule.require('../index.js', {
15 | requires: {
16 | './getChecksumAddress.js': (addr) => addr + 1,
17 | },
18 | singleOnly: true,
19 | }).getAddress;
20 |
21 | describe('ethjs-account', () => {
22 | describe('privateToAccount', () => {
23 | it('should construct properly', () => {
24 | assert.equal(typeof privateToAccount, 'function');
25 | });
26 |
27 | it('should be the same as ethereumjs-util', () => {
28 | const privateKey = '0xccb36826fbd5192c10bba496af42906a7e3b91f87a0ae803e79113fa88c5432c';
29 | const accountTest = privateToAccount(privateKey);
30 | const publicKey = new Buffer(accountTest.publicKey.slice(2), 'hex');
31 | const address = accountTest.address.toLowerCase();
32 |
33 | assert.deepEqual(publicKey, privateToPublic(privateKey));
34 | assert.equal(address.toLowerCase(), `0x${ethUtil.privateToAddress(new Buffer(privateKey.slice(2), 'hex')).toString('hex')}`);
35 | assert.deepEqual(publicKey, ethUtil.privateToPublic(new Buffer(privateKey.slice(2), 'hex')));
36 | assert.equal(publicToAddress(publicKey).toLowerCase(), `0x${ethUtil.publicToAddress(accountTest.publicKey, true).toString('hex')}`);
37 | });
38 |
39 | it('should throw under invalid conditions', () => {
40 | assert.throws(() => privateToAccount(''), Error);
41 | assert.throws(() => privateToAccount('0x'), Error);
42 | assert.throws(() => privateToAccount({}), Error);
43 | assert.throws(() => privateToAccount(null), Error);
44 | assert.throws(() => privateToAccount(''), Error);
45 | });
46 |
47 | it('should prodice the same keys given a prefixed and non prefixed private key', () => {
48 | const privateKey = '0xccb36826fbd5192c10bba496af42906a7e3b91f87a0ae803e79113fa88c5432c';
49 | const privateKey2 = 'ccb36826fbd5192c10bba496af42906a7e3b91f87a0ae803e79113fa88c5432c';
50 | assert.deepEqual(privateToPublic(privateKey2), privateToPublic(privateKey));
51 | assert.deepEqual(privateToAccount(privateKey2), privateToAccount(privateKey));
52 | });
53 |
54 | it('should function normally', () => {
55 | const testAccount = privateToAccount(sha3('sfddskj'));
56 |
57 | assert.equal(typeof testAccount, 'object');
58 | assert.equal(typeof testAccount.privateKey, 'string');
59 | assert.equal(typeof testAccount.publicKey, 'string');
60 | assert.equal(typeof testAccount.address, 'string');
61 | assert.equal(Object.keys(testAccount).length, 3);
62 | assert.equal(testAccount.privateKey.length, 66);
63 | assert.equal(testAccount.publicKey.length, 130);
64 | assert.equal(testAccount.address.length, 42);
65 | });
66 | });
67 |
68 | describe('privateToPublic', () => {
69 | it('should construct properly', () => {
70 | assert.equal(typeof privateToPublic, 'function');
71 | assert.equal(typeof privateToPublic(sha3('jksfksf')), 'object');
72 | });
73 |
74 | it('should throw under invalid conditions', () => {
75 | assert.throws(() => privateToPublic(''), Error);
76 | assert.throws(() => privateToPublic('0x'), Error);
77 | assert.throws(() => privateToPublic({}), Error);
78 | assert.throws(() => privateToPublic(null), Error);
79 | assert.throws(() => privateToPublic(42323424342), Error);
80 | assert.throws(() => privateToPublic(''), Error);
81 | });
82 | });
83 |
84 | describe('publicToAddress', () => {
85 | it('should construct properly', () => {
86 | assert.equal(typeof publicToAddress, 'function');
87 | assert.equal(typeof publicToAddress(privateToPublic(sha3('jksfksf'))), 'string');
88 | });
89 |
90 | it('should be the same as ethereumjs-util', () => {
91 | const accountTest = privateToAccount(sha3('kjsdfkjfkjsf'));
92 | const publicKey = new Buffer(accountTest.publicKey.slice(2), 'hex');
93 |
94 | assert.equal(publicToAddress(publicKey).toLowerCase(), `0x${ethUtil.publicToAddress(accountTest.publicKey, true).toString('hex')}`);
95 | });
96 |
97 | it('should throw under invalid conditions', () => {
98 | assert.throws(() => publicToAddress(''), Error);
99 | assert.throws(() => publicToAddress('0x'), Error);
100 | assert.throws(() => publicToAddress({}), Error);
101 | assert.throws(() => publicToAddress(null), Error);
102 | assert.throws(() => publicToAddress(42323424342), Error);
103 | assert.throws(() => publicToAddress(''), Error);
104 | });
105 | });
106 |
107 | describe('generate', () => {
108 | it('should construct properly', () => {
109 | assert.equal(typeof generate, 'function');
110 | });
111 |
112 | it('should throw under invalid conditions', () => {
113 | assert.throws(() => generate({}), Error);
114 | assert.throws(() => generate(3443432243), Error);
115 | assert.throws(() => generate(undefined), Error);
116 | assert.throws(() => generate(null), Error);
117 | assert.throws(() => generate(''), Error);
118 | });
119 |
120 | it('should generate an address', () => {
121 | const testAccount = generate('fdsjklfsdjklsfdjkfsdkjlsfdkjsdfkljskljsdfkjfsdkjlsfkjsfdkjsfdkljsfdkljsdfkjlsdfkjsf');
122 |
123 | assert.equal(typeof testAccount, 'object');
124 | assert.equal(typeof testAccount.privateKey, 'string');
125 | assert.equal(typeof testAccount.publicKey, 'string');
126 | assert.equal(typeof testAccount.address, 'string');
127 | assert.equal(Object.keys(testAccount).length, 3);
128 | assert.equal(testAccount.privateKey.length, 66);
129 | assert.equal(testAccount.publicKey.length, 130);
130 | assert.equal(testAccount.address.length, 42);
131 | });
132 |
133 | it('should generate many random addresses', () => {
134 | for(var i = 0; i < 500; i++) { // eslint-disable-line
135 | const testAccount = generate('fdsjklfsdjklsfdjkfsdkjlsfdkjsdfkljskljsdfkjfsdkjlsfkjsfdkjsfdkljsfdkljsdfkjlsdfkjsf');
136 |
137 | assert.equal(typeof testAccount, 'object');
138 | assert.equal(typeof testAccount.privateKey, 'string');
139 | assert.equal(typeof testAccount.publicKey, 'string');
140 | assert.equal(typeof testAccount.address, 'string');
141 | assert.equal(Object.keys(testAccount).length, 3);
142 | assert.equal(testAccount.privateKey.length, 66);
143 | assert.equal(testAccount.publicKey.length, 130);
144 | assert.equal(testAccount.address.length, 42);
145 | }
146 | });
147 | });
148 |
149 | describe('getAddress', () => {
150 | it('should construct properly', () => {
151 | assert.equal(typeof getAddress, 'function');
152 | });
153 | });
154 |
155 | describe('getChecksumAddress', () => {
156 | it('should construct properly', () => {
157 | assert.equal(typeof getChecksumAddress, 'function');
158 | });
159 | });
160 |
161 | function randomBuffer(length) {
162 | const buffer = crypto.randomBytes(length);
163 | return buffer;
164 | }
165 |
166 | function randomHexString(length) {
167 | return `0x${randomBuffer(length).toString('hex')}`;
168 | }
169 |
170 | describe('test checkSum address, and getAddress', () => {
171 | it('ethers getAddress should equal official toChecksumAddress', () => {
172 | function testAddress(address) {
173 | const official = ethUtil.toChecksumAddress(address);
174 | const ethers = getAddress(address);
175 | assert.equal(ethers, official, 'wrong address');
176 | }
177 |
178 | testAddress('0x0000000000000000000000000000000000000000');
179 | testAddress('0xffffffffffffffffffffffffffffffffffffffff');
180 | for (var i = 0; i < 10000; i++) { // eslint-disable-line
181 | testAddress(randomHexString(20));
182 | }
183 | });
184 |
185 | it('should throw as invalid get checksum address (checksum error)', () => {
186 | assert.throw(() => {
187 | invalidGetAddress('0xaB41D5688Facc5EB21aD86098BA230D23Cde0E31');
188 | }, Error);
189 | });
190 |
191 | it('should throw as invalid checksum', () => {
192 | assert.throw(() => {
193 | getAddress('sdfjhs992');
194 | }, Error);
195 | });
196 |
197 | it('should throw as invalid checksum number', () => {
198 | assert.throws(() => {
199 | getAddress(234234234);
200 | }, Error);
201 | });
202 |
203 | it('should throw as invalid checksum number', () => {
204 | assert.throws(() => {
205 | getChecksumAddress(234234234);
206 | }, Error);
207 | });
208 |
209 | it('should throw as invalid checksum number', () => {
210 | assert.throws(() => {
211 | getChecksumAddress('sdfk^jsfdkjs9');
212 | }, Error);
213 | });
214 |
215 | it('should convert non hexed address', () => {
216 | assert.equal(getAddress('0000000000000000000000000000000000000000'), '0x0000000000000000000000000000000000000000');
217 | });
218 |
219 | it('test ICAP', () => {
220 | assert.equal(getAddress('00c5496aee77c1ba1f0854206a26dda82a81d6d8').toLowerCase(), '0x00c5496aee77c1ba1f0854206a26dda82a81d6d8');
221 | });
222 |
223 | it('test not supported IBAN/ICAP', () => {
224 | assert.throws(() => getAddress('XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS'), Error);
225 | });
226 | });
227 | });
228 |
--------------------------------------------------------------------------------