From b5c5be2128b8670b44642bc41466fbe0353f3d47 Mon Sep 17 00:00:00 2001 From: coreyphillips Date: Wed, 10 Jun 2015 22:51:33 -0400 Subject: [PATCH 1/2] Vertcoin Address Generator Update Merged Vertaddress with the current version of bitaddress.org. Added a feature to turn files/images into Vertcoin private keys in the "Wallet Details" section. --- Gruntfile.js | 25 +- README | 71 +- index.html | 19087 ++++++++++++++++++--------------- package.json | 13 +- src/biginteger.js | 10 +- src/bitaddress-ui.html | 191 +- src/bitcoinjs-lib.address.js | 2 +- src/bitcoinjs-lib.eckey.js | 24 +- src/ellipticcurve.js | 29 +- src/main.css | 134 +- src/ninja.brainwallet.js | 4 +- src/ninja.detailwallet.js | 62 +- src/ninja.misc.js | 87 +- src/ninja.onload.js | 7 +- src/ninja.paperwallet.js | 11 +- src/ninja.splitwallet.js | 113 + src/ninja.translator.js | 1215 ++- src/ninja.unittests.js | 121 +- src/secrets.js | 532 + src/securerandom.js | 84 +- 20 files changed, 13032 insertions(+), 8790 deletions(-) create mode 100644 src/ninja.splitwallet.js create mode 100644 src/secrets.js diff --git a/Gruntfile.js b/Gruntfile.js index e05b8ec..bdd0a92 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,5 @@ +var packageObject = require('./package.json'); + module.exports = function (grunt) { // Project configuration. grunt.initConfig({ @@ -5,7 +7,7 @@ module.exports = function (grunt) { combine: { single: { input: "./src/bitaddress-ui.html", - output: "./liteaddress.org.html", + output: "./bitaddress.org.html", tokens: [ { token: "//array.map.js", file: "./src/array.map.js" }, { token: "//biginteger.js", file: "./src/biginteger.js" }, @@ -24,6 +26,7 @@ module.exports = function (grunt) { { token: "//cryptojs.ripemd160.js", file: "./src/cryptojs.ripemd160.js" }, { token: "//crypto-scrypt.js", file: "./src/crypto-scrypt.js" }, { token: "//ellipticcurve.js", file: "./src/ellipticcurve.js" }, + { token: "//secrets.js", file: "./src/secrets.js" }, { token: "//ninja.key.js", file: "./src/ninja.key.js" }, { token: "//ninja.misc.js", file: "./src/ninja.misc.js" }, { token: "//ninja.onload.js", file: "./src/ninja.onload.js" }, @@ -34,16 +37,30 @@ module.exports = function (grunt) { { token: "//ninja.bulkwallet.js", file: "./src/ninja.bulkwallet.js" }, { token: "//ninja.brainwallet.js", file: "./src/ninja.brainwallet.js" }, { token: "//ninja.vanitywallet.js", file: "./src/ninja.vanitywallet.js" }, + { token: "//ninja.splitwallet.js", file: "./src/ninja.splitwallet.js" }, { token: "//ninja.detailwallet.js", file: "./src/ninja.detailwallet.js" }, { token: "//qrcode.js", file: "./src/qrcode.js" }, { token: "//securerandom.js", file: "./src/securerandom.js" }, - { token: "//main.css", file: "./src/main.css" } + { token: "//main.css", file: "./src/main.css" }, + { token: "//version", string: packageObject.version } ] } + }, + + lineending: { // Task + dist: { // Target + options: { // Target options + eol: 'lf' + }, + files: { // Files to process + './bitaddress.org.html': ['./bitaddress.org.html'] + } + } } }); grunt.file.defaultEncoding = 'utf-8'; grunt.loadNpmTasks("grunt-combine"); - grunt.registerTask("default", ["combine:single"]); -}; \ No newline at end of file + grunt.loadNpmTasks('grunt-lineending'); + grunt.registerTask("default", ["combine:single", "lineending"]); +}; diff --git a/README b/README index e20d3c5..74be9c5 100755 --- a/README +++ b/README @@ -1,36 +1,49 @@ -JavaScript Client-Side Vertcoin Wallet Generator +bitaddress.org +JavaScript Client-Side Bitcoin Wallet Generator -GPG key for validation: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFD948CCC1EAB2FB5 +Now Bitcoin addresses and their corresponding private key can be conveniently +generated in a web browser. -A fork of the liteaddress.org project located at: -https://github.com/litecoin-project/liteaddress.org +The bitaddress.org project provides an all-in-one HTML document with embedded +JavaScript/Css/Images. The JavaScript is readable not minified and contains no +XMLHttpRequest's (no AJAX). The benefit of this technique is you can load the +JavaScript locally and trust that the JavaScript did not change after being +loaded. -Provides an all-in-one HTML document with embedded JavaScript/Css/Images. The JavaScript is readable not minified and contains no XMLHttpRequest's (no AJAX). The benefit of this technique is you can load the JavaScript locally and trust that the JavaScript did not change after being loaded. +Here is a link to the BitcoinTalk.org forum topic discussing this project: +https://bitcointalk.org/index.php?topic=43496.0 -END USER NOTES: - 1) To print QRCode in IE8 you must enable the "Print Background Colors and Images" checkbox on the "Page Setup" screen. +Please send DONATIONS for this project to Bitcoin Address: +1NiNja1bUmhSoTXozBRBEtR8LeF9TGbZBN - 2) For Bulk Wallet I recommended using Google Chrome, it's the fastest. +END USER NOTES: + 1) To print QRCode in IE8 you must enable the "Print Background Colors and + Images" checkbox on the "Page Setup" screen. + 2) For Bulk Wallet I recommended using Google Chrome, it's the fastest. 3) Requires IE8+, Firefox, Chrome or sufficient JavaScript support. - 4) Mobile Safari only works with iPhone4 or newer devices. Older devices timeout while executing JavaScript. - - 5) DO NOT use Opera Mini it renders JavaScript output server side, therefore they might record the private key you generated. - + 5) DO NOT use Opera Mini it renders JavaScript output server side, therefore + they might record the private key you generated. 6) Art Wallet does not work properly in IE8 due to CSS limitations. Notice of Copyrights and Licenses: --------------------------------------- -The Vertoin paper wallet project, software and embedded resources are copyright The Vertcoin developers. +The bitaddress.org project, software and embedded resources are +copyright bitaddress.org. -Portions of the all-in-one HTML document contain JavaScript codes that are the copyrights of others. The individual copyrights are included throughout the document along with their licenses. Included JavaScript libraries are separated with HTML script tags. +The bitaddress.org name and logo are not part of the open source +license. -Summary of JavaScript functions with a redistributable license: +Portions of the all-in-one HTML document contain JavaScript codes that +are the copyrights of others. The individual copyrights are included +throughout the document along with their licenses. Included JavaScript +libraries are separated with HTML script tags. +Summary of JavaScript functions with a redistributable license: JavaScript function License ------------------- -------------- Array.prototype.map Public Domain @@ -41,14 +54,24 @@ window.BigInteger BSD License window.QRCode MIT License window.Bitcoin MIT License -This software is available under The MIT License (MIT) -Copyright (c) 2014 The Vertcoin developers -Copyright (c) 2012-2013 liteaddress.org +The bitaddress.org software is available under The MIT License (MIT) Copyright (c) 2011-2013 bitaddress.org -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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 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. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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 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. diff --git a/index.html b/index.html index 18adf6b..c33da97 100755 --- a/index.html +++ b/index.html @@ -1,8474 +1,10613 @@ - - - - - - Vertcoin paper wallet generator - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
Open Source JavaScript Client-Side Vertcoin Wallet Generator
-
- - -
- Generating Vertcoin Address...
- MOVE your mouse around to add some extra randomness...
-
- -
-
-
-
- - -
-
-
-
-
- Vertcoin Address -
-
-
- -
-
SHARE
-
-
-
- Private Key (Wallet Import Format) -
-
-
- -
-
SECRET
-
-
- -
-

A Vertcoin wallet is as simple as a single pairing of a Vertcoin address with it's corresponding Vertcoin private key. Such a wallet has been generated for you in your web browser and is displayed above.

-

To safeguard this wallet you must print or otherwise record the Vertcoin address and private key. It is important to make a backup copy of the private key and store it in a safe location. This site does not have knowledge of your private key. If you are familiar with PGP you can download this all-in-one HTML page and check that you have an authentic version from the author of this site by matching the SHA1 hash of this HTML with the SHA1 hash available in the signed version history document linked on the footer of this site. If you leave/refresh the site or press the "Generate New Address" button then a new private key will be generated and the previously displayed private key will not be retrievable. Your Vertcoin private key should be kept a secret. Whomever you share the private key with has access to spend all the Vertcoins associated with that address. If you print your wallet then store it in a zip lock bag to keep it safe from water. Treat a paper wallet like cash.

-

Add funds to this wallet by instructing others to send Vertcoins to your Vertcoin address.

-

Check your balance by going to the Vertcoin blockchain explorer and entering your Vertcoin address.

-

Spend your Vertcoins by importing your private key to the client wallet. Keep in mind when you import your single key to a Vertcoin p2p client and spend funds your key will be bundled with other private keys in the p2p client wallet. When you perform a transaction your change will be sent to another Vertcoin address within the p2p client wallet. You must then backup the p2p client wallet and keep it safe as your remaining Vertcoins will be stored there. Satoshi advised that one should never delete a wallet.

-
-
- -
-
-
- - - - -
-
- - - -
-
-
-
- -
-
-
- - - - - -
-
-
- Comma Separated Values: Index,Address,Private Key (WIF) - -
-
-
-
- Why should I use a Bulk Wallet to accept Vertcoins on my website? -
-
-
The traditional approach to accepting Vertcoins on your website requires that you install the official Vertcoin client daemon ("Vertcoind"). Many website hosting packages don't support installing the Vertcoin daemon. Also, running the Vertcoin daemon on your web server means your private keys are hosted on the server and could get stolen if your web server is hacked. When using a Bulk Wallet you can upload only the Vertcoin addresses and not the private keys to your web server. Then you don't have to worry about your Vertcoin wallet being stolen if your web server is hacked.
-
-
-
- How do I use a Bulk Wallet to accept Vertcoins on my website? -
-
-
-
    -
  1. Use the Bulk Wallet tab to pre-generate a large number of Vertcoin addresses (10,000+). Copy and paste the generated comma separated values (CSV) list to a secure text file on your computer. Backup the file you just created to a secure location.
  2. -
  3. Import the Vertcoin addresses into a database table on your web server. (Don't put the wallet/private keys on your web server, otherwise you risk hackers stealing your coins. Just the Vertcoin addresses as they will be shown to customers.)
  4. -
  5. Provide an option on your website's shopping cart for your customer to pay in Vertcoin. When the customer chooses to pay in Vertcoin you will then display one of the addresses from your database to the customer as his "payment address" and save it with his shopping cart order.
  6. -
  7. You now need to be notified when the payment arrives. Google "Vertcoin payment notification" and subscribe to at least one Vertcoin payment notification service. There are various services that will notify you via Web Services, API, SMS, Email, etc. Once you receive this notification, which could be programmatically automated, you can process the customer's order. To manually check if a payment has arrived you can use Block Explorer. Replace THEADDRESSGOESHERE with the Vertcoin address you are checking. It could take between 10 minutes to one hour for the transaction to be confirmed.
    http://www.blockexplorer.com/address/THEADDRESSGOESHERE

    Unconfirmed transactions can be viewed at: http://blockchain.info/
    You should see the transaction there within 30 seconds.
  8. -
  9. Vertcoins will safely pile up on the block chain. Use the original wallet file you generated in step 1 to spend them.
  10. -
-
-
-
-
- -
-
-
- Enter Passphrase: - - - -
-
- Confirm Passphrase: - - - Algorithm: SHA256(passphrase) -
-
-
-
-
-
-
- Vertcoin Address: - -
-
-
-
-
- Private Key (Wallet Import Format): - -
-
-
-
- -
- -
-
- Step 1 Public Key: -
-
Copy and paste the above into the Your-Part-Public-Key field in the Vanity Pool Website.
-
-
- Step 1 Private Key: - -
Copy and paste the above Private Key field into a text file. Ideally save to an encrypted drive. You will need this to retrieve the Vertcoin Private Key once the Pool has found your prefix.
-
-
- -
-
- Enter Your Part Private Key (generated in Step 1 above and previously saved): -
[NOTE: this input box can accept a public key or private key] -
-
-
- Enter Pool Part Private Key (from Vanity Pool): -
[NOTE: this input box can accept a public key or private key] -
-
-
- - -
-
-
-
-
- Vanity Vertcoin Address: - -
The above is your new address that should include your required prefix.
-
- -
- Vanity Public Key (HEX): - -
The above is the Public Key in hexadecimal format.
-
- -
- Vanity Private Key (WIF): - -
The above is the Private Key to load into your wallet.
-
-
-
- -
-
- - - -
- - -
-
-
-
- Your Vertcoin Private Key is a unique secret number that only you know. It can be encoded in a number of different formats. Below we show the Vertcoin Address and Public Key that corresponds to your Private Key as well as your Private Key in the most popular encoding formats (WIF, HEX, B64, MINI, BIP38). -

- Vertcoin v0.6+ stores public keys in compressed format. The client now also supports import and export of private keys with importprivkey/dumpprivkey. The format of the exported private key is determined by whether the address was generated in an old or new wallet. -
-
-
- Vertcoin Address -
- -
-
- Vertcoin Address Compressed -
- -
-
-

-
- Public Key (130 characters [0-9A-F]): - -
-
- Public Key (compressed, 66 characters [0-9A-F]): - -
-
-
-
- Private Key WIF
51 characters base58, starts with a
'6'
-
- -
-
- Private Key WIF Compressed
52 characters base58, starts with a
'T'
-
- -
-
-

-
- Private Key Hexadecimal Format (64 characters [0-9A-F]): - -
-
- Private Key Base64 (44 characters): - -
- -
-
-
- - -
- - - - - - - - - - - - - - + + + + + + Vertcoin paper wallet generator + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
Open Source JavaScript Client-Side Vertcoin Wallet Generator
+
+
+ + +
+ Generating Vertcoin Address...
+ MOVE your mouse around to add some extra randomness...
+ OR type some random characters into this textbox
+
+
+ +
+
+
+
+ + +
+
+
+
+
+ Vertcoin Address +
+
+
+ +
+
SHARE
+
+
+
+ Private Key (Wallet Import Format) +
+
+
+ +
+
SECRET
+
+
+ +
+

A Vertcoin wallet is as simple as a single pairing of a Vertcoin address with it's corresponding Vertcoin private key. Such a wallet has been generated for you in your web browser and is displayed above.

+

To safeguard this wallet you must print or otherwise record the Vertcoin address and private key. It is important to make a backup copy of the private key and store it in a safe location. This site does not have knowledge of your private key. If you are familiar with PGP you can download this all-in-one HTML page and check that you have an authentic version from the author of this site by matching the SHA1 hash of this HTML with the SHA1 hash available in the signed version history document linked on the footer of this site. If you leave/refresh the site or press the "Generate New Address" button then a new private key will be generated and the previously displayed private key will not be retrievable. Your Vertcoin private key should be kept a secret. Whomever you share the private key with has access to spend all the Vertcoins associated with that address. If you print your wallet then store it in a zip lock bag to keep it safe from water. Treat a paper wallet like cash.

+

Add funds to this wallet by instructing others to send Vertcoins to your Vertcoin address.

+

Check your balance by going to the Vertcoin blockchain explorer and entering your Vertcoin address.

+

Spend your Vertcoins by importing your private key to the client wallet. Keep in mind when you import your single key to a Vertcoin p2p client and spend funds your key will be bundled with other private keys in the p2p client wallet. When you perform a transaction your change will be sent to another Vertcoin address within the p2p client wallet. You must then backup the p2p client wallet and keep it safe as your remaining Vertcoins will be stored there. Satoshi advised that one should never delete a wallet.

+
+
+ +
+
+
+ + + + +
+
+ + + +
+
+
+
+ +
+
+
+ + + + + +
+
+
+ Comma Separated Values: Index,Address,Private Key (WIF) + +
+
+
+
+ Why should I use a Bulk Wallet to accept bitcoins on my website? +
+
+
The traditional approach to accepting bitcoins on your website requires that you install the official bitcoin client daemon ("bitcoind"). Many website hosting packages don't support installing the bitcoin daemon. Also, running the bitcoin daemon on your web server means your private keys are hosted on the server and could get stolen if your web server is hacked. When using a Bulk Wallet you can upload only the bitcoin addresses and not the private keys to your web server. Then you don't have to worry about your bitcoin wallet being stolen if your web server is hacked.
+
+
+
+ How do I use a Bulk Wallet to accept Vertcoins on my website? +
+
+
+
    +
  1. Use the Bulk Wallet tab to pre-generate a large number of Vertcoin addresses (10,000+). Copy and paste the generated comma separated values (CSV) list to a secure text file on your computer. Backup the file you just created to a secure location.
  2. +
  3. Import the Vertcoin addresses into a database table on your web server. (Don't put the wallet/private keys on your web server, otherwise you risk hackers stealing your coins. Just the Vertcoin addresses as they will be shown to customers.)
  4. +
  5. Provide an option on your website's shopping cart for your customer to pay in Vertcoin. When the customer chooses to pay in Vertcoin you will then display one of the addresses from your database to the customer as his "payment address" and save it with his shopping cart order.
  6. +
  7. You now need to be notified when the payment arrives. Google "Vertcoin payment notification" and subscribe to at least one Vertcoin payment notification service. There are various services that will notify you via Web Services, API, SMS, Email, etc. Once you receive this notification, which could be programmatically automated, you can process the customer's order. To manually check if a payment has arrived you can use Block Explorer. Replace THEADDRESSGOESHERE with the Vertcoin address you are checking. It could take between 10 minutes to one hour for the transaction to be confirmed.
    http://www.blockexplorer.com/address/THEADDRESSGOESHERE

    Unconfirmed transactions can be viewed at: http://blockchain.info/
    You should see the transaction there within 30 seconds.
  8. +
  9. Vertcoins will safely pile up on the block chain. Use the original wallet file you generated in step 1 to spend them.
  10. +
+
+
+
+
+ +
+
+
+ + + + +
+
+ + + + Algorithm: SHA256(passphrase) +
+
+
+
+
+
+
+ Vertcoin Address: + +
+
+
+
+
+ Private Key (Wallet Import Format): + +
+
+
+
+ +
+ +
+
+ Step 1 Public Key: +
+
Copy and paste the above into the Your-Part-Public-Key field in the Vanity Pool Website.
+
+
+ Step 1 Private Key: + +
Copy and paste the above Private Key field into a text file. Ideally save to an encrypted drive. You will need this to retrieve the Vertcoin Private Key once the Pool has found your prefix.
+
+
+ +
+
+ Enter Your Part Private Key (generated in Step 1 above and previously saved): +
[NOTE: this input box can accept a public key or private key] +
+
+
+ Enter Pool Part Private Key (from Vanity Pool): +
[NOTE: this input box can accept a public key or private key] +
+
+
+ + +
+
+
+
+
+ Vanity Vertcoin Address: + +
The above is your new address that should include your required prefix.
+
+ +
+ Vanity Public Key (HEX): + +
The above is the Public Key in hexadecimal format.
+
+ +
+ Vanity Private Key (WIF): + +
The above is the Private Key to load into your wallet.
+
+
+
+ +
+
+ + +
+ + + +
+
+
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+ + +

+ + + + +
+ +
+
+ + +
+
+
+
+ Your Vertcoin Private Key is a unique secret number that only you know. It can be encoded in a number of different formats. Below we show the Vertcoin Address and Public Key that corresponds to your Private Key as well as your Private Key in the most popular encoding formats (WIF, HEX, B64, MINI, BIP38). +

+ Vertcoin v0.6+ stores public keys in compressed format. The client now also supports import and export of private keys with importprivkey/dumpprivkey. The format of the exported private key is determined by whether the address was generated in an old or new wallet. +
+
+
+ Vertcoin Address +
+ +
+
+ Vertcoin Address Compressed +
+ +
+
+

+
+ Public Key (130 characters [0-9A-F]): + +
+
+ Public Key (compressed, 66 characters [0-9A-F]): + +
+
+
+
+ Private Key WIF
51 characters base58, starts with a
'7'
+
+ +
+
+ Private Key WIF Compressed
52 characters base58, starts with a
'W'
+
+ +
+
+

+
+ Private Key Hexadecimal Format (64 characters [0-9A-F]): + +
+
+ Private Key Base64 (44 characters): + +
+ + + +
+
+
+
+ How do I make a wallet using dice? What is B6? +
+
+
An important part of creating a Bitcoin wallet is ensuring the random numbers used to create the wallet are truly random. Physical randomness is better than computer generated pseudo-randomness. The easiest way to generate physical randomness is with dice. To create a Bitcoin private key you only need one six sided die which you roll 99 times. Stopping each time to record the value of the die. When recording the values follow these rules: 1=1, 2=2, 3=3, 4=4, 5=5, 6=0. By doing this you are recording the big random number, your private key, in B6 or base 6 format. You can then enter the 99 character base 6 private key into the text field above and click View Details. You will then see the Bitcoin address associated with your private key. You should also make note of your private key in WIF format since it is more widely used.
+
+
+
+
+ + + +
+ + + + + + + + + + + + + + + diff --git a/package.json b/package.json index f333489..4bb95b8 100755 --- a/package.json +++ b/package.json @@ -1,13 +1,20 @@ { "name": "bitaddress.org", - "version": "2.6.0", + "version": "2.9.8", + "sha1sum": "8eaaf627380ff3c28d9efc31899b8b0102c32ab6", + "sha256sum": "2c5d16dbcde600147162172090d940fd9646981b7d751d9bddfc5ef383f89308", "description": "Open Source JavaScript Client-Side Bitcoin Wallet Generator", "main": "Gruntfile.js", "dependencies": { "grunt": "~0.4.1", - "grunt-combine": "~0.8.3" + "grunt-combine": "~0.8.3", + "grunt-lineending": "~0.2.4" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-combine": "~0.8.3", + "grunt-lineending": "~0.2.4" }, - "devDependencies": {}, "scripts": { "test": "" }, diff --git a/src/biginteger.js b/src/biginteger.js index 5e77c36..4d9c4ef 100755 --- a/src/biginteger.js +++ b/src/biginteger.js @@ -150,7 +150,7 @@ this.t = 1; this.s = (x < 0) ? -1 : 0; if (x > 0) this[0] = x; - else if (x < -1) this[0] = x + DV; + else if (x < -1) this[0] = x + this.DV; else this.t = 0; }; @@ -1162,7 +1162,7 @@ // ****** REDUCTION ******* // // Modular reduction using "classic" algorithm - function Classic(m) { this.m = m; } + var Classic = window.Classic = function Classic(m) { this.m = m; } Classic.prototype.convert = function (x) { if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; @@ -1177,7 +1177,7 @@ // Montgomery reduction - function Montgomery(m) { + var Montgomery = window.Montgomery = function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp & 0x7fff; @@ -1228,7 +1228,7 @@ // A "null" reducer - function NullExp() { } + var NullExp = window.NullExp = function NullExp() { } NullExp.prototype.convert = function (x) { return x; }; NullExp.prototype.revert = function (x) { return x; }; NullExp.prototype.mulTo = function (x, y, r) { x.multiplyTo(y, r); }; @@ -1239,7 +1239,7 @@ // Barrett modular reduction - function Barrett(m) { + var Barrett = window.Barrett = function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); diff --git a/src/bitaddress-ui.html b/src/bitaddress-ui.html index 3ff237d..4b1324f 100755 --- a/src/bitaddress-ui.html +++ b/src/bitaddress-ui.html @@ -2,10 +2,6 @@ - liteaddress.org + bitaddress.org + +