diff --git a/Makefile b/Makefile index 00716ac..786bd65 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,13 @@ default: website/miniLockLib.js website/tests.js website/index.js website/annotated_code.js website/annotated_code .window_tests_address # Create a standalone copy of miniLockLib.js in the website folder for use in web agent windows. -website/miniLockLib.js: library/%.coffee library.compiled/scrypt-async.js +website/miniLockLib.js: library/%.coffee browserify library.compiled/index.js --standalone miniLockLib > website/miniLockLib.js # Compile CoffeeScript library files to the library.compiled folder. library/%.coffee: coffee --compile --output library.compiled library/*.coffee -# Download scrypt-async.js and save it in the library.compiled folder. -library.compiled/scrypt-async.js: - curl -s https://raw.githubusercontent.com/dchest/scrypt-async-js/master/scrypt-async.js \ - > library.compiled/scrypt-async.js - # # Tests # Compile CoffeeScript tests to the tests.compiled folder. diff --git a/README.md b/README.md index 2b30c50..9509e09 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,17 @@ Pass `data` and `keys` when you `decrypt` a file: __Digging In__ +You will need [GNU Make](https://www.gnu.org/software/make/) and [Node.js](https://nodejs.org/en/) on your computer to compile, run and test the code in this project. If you can run `make --version` and `node --version` without errors on the command line then you should be all set. If you don’t already have a copy Node.js, we recommend you [download the installer for your operating system](https://nodejs.org/en/download/) from the official website. + `git clone https://github.com/45678/miniLockLib.git` to get the source code. +`cd miniLockLib` + +`npm install` to download the dependencies defined in `package.json`. + `make` to compile [CoffeeScript](http://www.coffeescript.org/) files into [ECMAScript](http://www.ecmascript.org/) files in the `library.compiled`, `tests.compiled` and `website` folders. -`make clean` to start over. +`make clean` to remove all generated files and start over. `npm start` to automatically re-compile source files as you make changes. diff --git a/library.compiled/KeyPairOperation.js b/library.compiled/KeyPairOperation.js index c078878..cc63155 100644 --- a/library.compiled/KeyPairOperation.js +++ b/library.compiled/KeyPairOperation.js @@ -9,7 +9,7 @@ NaCl = require("tweetnacl"); - scrypt = require("./scrypt-async"); + scrypt = require("scrypt-async"); EmailAddress = require("./EmailAddress"); diff --git a/library.compiled/index.js b/library.compiled/index.js index 14853ed..8d8c763 100644 --- a/library.compiled/index.js +++ b/library.compiled/index.js @@ -47,6 +47,6 @@ miniLockLib.NaCl.stream = require("nacl-stream").stream; - miniLockLib.scrypt = require("./scrypt-async"); + miniLockLib.scrypt = require("scrypt-async"); }).call(this); diff --git a/library/KeyPairOperation.coffee b/library/KeyPairOperation.coffee index aeb52e3..7d00398 100644 --- a/library/KeyPairOperation.coffee +++ b/library/KeyPairOperation.coffee @@ -1,7 +1,7 @@ module.exports = class KeyPairOperation BLAKE2s = require "./BLAKE2s" NaCl = require "tweetnacl" - scrypt = require "./scrypt-async" + scrypt = require "scrypt-async" EmailAddress = require "./EmailAddress" SecretPhrase = require "./SecretPhrase" diff --git a/library/index.coffee b/library/index.coffee index 8836d62..ec8b7e0 100644 --- a/library/index.coffee +++ b/library/index.coffee @@ -34,4 +34,4 @@ miniLockLib.BLAKE2s = require "./BLAKE2s" miniLockLib.Entropizer = require "entropizer" miniLockLib.NaCl = require "tweetnacl" miniLockLib.NaCl.stream = require("nacl-stream").stream -miniLockLib.scrypt = require "./scrypt-async" +miniLockLib.scrypt = require "scrypt-async" diff --git a/package.json b/package.json index d535ba0..9fd2dd4 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,17 @@ "repository": "git+https://github.com/45678/miniLockLib.git", "dependencies": { "base-58": "0.0.x", - "blake2s-js": "1.0.3", - "entropizer": "^0.1.3", - "nacl-stream": "0.3.3", - "tweetnacl": "0.12.x" + "blake2s-js": "1.0.x", + "entropizer": "0.1.x", + "nacl-stream": "0.3.x", + "scrypt-async": "1.2.x", + "tweetnacl": "0.13.x" }, "devDependencies": { - "browserify": "5.9.x", - "coffee-script": "1.8.x", + "browserify": "13.0.x", + "coffee-script": "1.10.x", + "docco": "^0.7.0", + "tape": "4.4.x", "http-server": "^0.9.0", "tape": "2.14.x", "wr": "1.3.x"