bitpay/bitcore — pull request #332 by ryanxcharles (2014-05-07 22:45:51+00:00)
Title: WIP: Add and expose SJCL and replace all browser crypto with SJCL

Bitcore exposes very little cryptography, which makes it difficult to develop new advanced features that depend on low-level crypto, especially elliptic curves. After investigating various crypto libraries, the SJCL seems like a very solid library that does everything we need and more. The idea of this PR is to add SJCL, expose it, and then update all the browser crypto to use SJCL instead of vendor-bundle.

Ultimately the idea here is to use SJCL in the browser, and OpenSSL in node, and develop a thorough crypto interface that works the same way in the browser and node along the way. This is the SJCL half of this project.

This is a WIP and all browser crypto has not yet been updated to use SJCL. I've merely added SJCL and exposed it (you can access it with bitcore.sjcl).

SJCL does not consume much filesize. Adding SJCL and then removing all the vendor-bundle files reduces the minified filesize of bitcore by about 20KB. Removing the browser/bignum.js file and using SJCL's bignum library would reduce the filesize even more.