Commit Graph

11 Commits

Author SHA1 Message Date
Ryan X. Charles b1f34d4015 iterate array correctly so that random number is actually used in signing 2014-05-01 10:09:33 -04:00
Ryan X. Charles 405ea0bf6f fix bignum issue
In the browser, sometimes the config for bignum wasn't being set up if (somehow
... still not sure how this is possible) you use bitcore without using
require('bitcore'). This would by pass the code that set the config for bignum.
Solution is to put the config for bignum in bignum itself (in the browser).

This fixes, in particular, an issue with base58 where it was depending on
bignum having the proper config.

Also I add the base58 tests to run in the browser which they weren't
previously.

And finally I add a small test for Bignum in the browser that makes sure the
config is set properly.
2014-04-29 17:59:24 -04:00
Ryan X. Charles 7f348ca0bd Move BigNumber to internal
...no longer relies on Manuel's repo hostig a version of "bignum" that actually
contained bignumber.js. This moves bignumber.js internally and removes bignum
from the browser build process. Also adds a bitcore.Bignum that links to the
right thing. In node, browser.Bignum is require('bignum'). And in the browser,
bitcore.Bignum is is now Bignumber.js (same as before ... except bignumber.js
is now inside bitcore).
2014-04-28 18:00:59 -04:00
Ryan X. Charles c7b33eca9a update key signing to use new SecureRandom
...and throw an error if you try to use the old, non-secure random number
generator.
2014-04-25 15:00:51 -03:00
Ryan X. Charles 10d164b292 add require('bignum') in key 2014-04-24 15:33:38 -03:00
Ryan X. Charles 9575929162 Merge branch 'feature/secure-random'
Conflicts:
	lib/browser/Key.js
2014-04-24 09:19:58 -03:00
Matias Alejo Garcia 64b5623d54 removes buffertools dependencies in browsers Key.js 2014-04-23 21:32:25 -03:00
Ryan X. Charles 350f6ae998 Key should make sure new privkey is less than N
...this involves adding a Curve class, and significant refactoring to make this
possible in a clean way.
2014-04-23 21:15:55 -03:00
Ryan X. Charles dbcf270826 use SecureRandom in Key in the browser
...to make sure random numbers are generated securely
2014-04-22 22:43:22 -03:00
Ryan X. Charles ba692aaa20 add new SecureRandom class that does the right thing
Generating random numbers properly depends on the platform. The new
getRandomBuffer method does the right thing on the right platform. It will
sometimes fail due to insufficient entropy. The getPseudoRandomBuffer class is
also provided that will never fail, but it is not cryptographically secure and
should not be used for keys.
2014-04-22 22:18:59 -03:00
Ryan X. Charles f82fa5007a move *.browser and *.node to browser/* and node/*
...this should leave the lib folder a little bit less cluttered.
2014-04-22 19:36:18 -03:00