Commit Graph

313 Commits

Author SHA1 Message Date
Christopher Jeffrey 2e422c001e paypro: fix payment protocol for DER certs. 2014-07-21 14:55:10 -07:00
Christopher Jeffrey 3dc7a4ab84 test: fix x509 tests for PayPro. 2014-07-21 14:54:03 -07:00
Christopher Jeffrey 13553a42d1 x509: try different certs/keys/pems. 2014-07-21 14:54:03 -07:00
Christopher Jeffrey c209e3172d paypro: x509 nonsense. 2014-07-21 14:54:03 -07:00
Christopher Jeffrey 1d0f01c133 paypro: first pass at implementing payment protocol for x509. 2014-07-21 14:54:03 -07:00
Ryan X. Charles 098c613cb0 SIN should call EncodedData constructor
Creating SINs was broken due to not calling the parent constructor, shich sets
"converts" and "_encoding". I've fixed the problem and added tests that reveal
the error.
2014-07-18 09:24:57 -07:00
Ryan X. Charles 0c8f7d4d21 move bitcore-dev.js -> bundle.js
To make it easier to test the master branch of bitcore with other apps,
especially Copay.
2014-07-17 16:30:47 -07:00
Ryan X. Charles 49ff6c7b76 add further tests for Key 2014-07-17 15:44:28 -07:00
Ryan X. Charles 57a55d0863 expose signature internal functions
"sign" and "genk" ... and add some signature tests
2014-07-17 15:24:19 -07:00
Ryan X. Charles 2c136d4dcc remove obsolete Curve class (G and n now accessible from Point) 2014-07-17 13:14:49 -07:00
Ryan X. Charles 5f6d02f5de add proper DER signature support to Key
both creating DER signature from the r and s values, and parsing a DER
signature into the r, s, and other properties.
2014-07-17 13:09:35 -07:00
Ryan X. Charles e485d0e331 Merge pull request #432 from ryanxcharles/feature/proto
Correct deprecated setting of __proto__
2014-07-16 16:24:22 -07:00
Ryan X. Charles c4e22bf5fd Merge pull request #431 from ryanxcharles/bug/SIGHASH_ANYONECANPAY
use correct constant & share between Transaction and ScriptInterpreter
2014-07-16 16:24:14 -07:00
Ryan X. Charles fc7b5b11c7 Merge pull request #429 from ryanxcharles/feature/update-bn.js
update bn.js to latest version
2014-07-16 16:23:53 -07:00
Ryan X. Charles 95d180c2a3 add ScriptInterpreter example to test 2014-07-16 11:39:12 -07:00
Ryan X. Charles 71f181efee add tests to EncodedData and fix hex conversion bug
...making sure the new changes to __proto__ are working correctly.
2014-07-15 18:21:38 -07:00
Ryan X. Charles 895bb6bab9 use correct constant & share between Transaction and ScriptInterpreter
Closes https://github.com/bitpay/bitcore/issues/424
2014-07-15 11:59:56 -07:00
Ryan X. Charles 0251d467c4 update bn.js to latest version
...and correspondingly get rid of Number->String conversion

See: https://github.com/indutny/bn.js/issues/17
2014-07-15 11:25:18 -07:00
Ryan X. Charles 92ac073035 run secp256k1 test vectors in Key where they also matter 2014-07-11 15:05:38 -07:00
Ryan X. Charles 572035fdd5 add some test vectors for secp256k1 2014-07-11 14:47:48 -07:00
Ryan X. Charles 0f0a1b1913 add some sanity checks to signature verification 2014-07-11 12:04:34 -07:00
Ryan X. Charles 8a199e26f3 allow Point to multiply things other than buffers
...i.e., bignums, numbers, and strings. Also, ensure that if you try to
multiply a buffer, it should be exactly 32 bytes. Eventually this "multiply"
function will be replaced with a more conventional "mul" function, but not yet.
2014-07-11 11:52:05 -07:00
Ryan X. Charles 3f75bea924 add tests for toCompressedPubKey 2014-07-10 19:03:40 -07:00
Ryan X. Charles 992e1cfcfb uncomment part of TransactionBuilder test 2014-07-10 18:56:43 -07:00
Ryan X. Charles 9c23256a16 add tests to make sure bignum interface works correctly 2014-07-10 18:45:09 -07:00
Ryan X. Charles 32cf5aa941 woops - add bignum back to browser tests 2014-07-10 18:27:02 -07:00
Ryan X. Charles fb3cc38046 make bignum tests run in node, not just browser 2014-07-10 18:17:11 -07:00
Ryan X. Charles af1d754bd8 make bignum interface backwards compatible
- fix cmp, mul, div, add, mod, sub functions to take numbers and strings
- fix Point class to use common folder correctly
2014-07-10 18:14:13 -07:00
Ryan X. Charles 9ca869b95b add "ECKey" to Key test so grepping is easier 2014-07-10 16:22:42 -07:00
Ryan X. Charles ac4d3186bf update sign function to use elliptic 2014-07-10 16:22:42 -07:00
Ryan X. Charles 15d4328b35 use elliptic in Point in the browser instead of cryptojs 2014-07-10 16:21:08 -07:00
Ryan X. Charles c8fe404402 replace bignumber.js with bn.js 2014-07-10 16:20:13 -07:00
Manuel Araoz 0e2df698cd fix SIN and add tests 2014-07-10 17:17:24 -03:00
Ryan X. Charles 65ab3a663a fix string/buffer sjcl issue
...by using sjcl.mode.cbc.encrypt/decrypt rather than sjcl.encrypt/decrypt. The
difference is that the sjcl.encrypt/decrypt functions are really convenience
methods designed to encrypt and decrypt strings, but don't play nice with
binary data, as revealed in the tests in this commit and the previous commit.
Basically, if you use them to encrypt and decrypt binary data as a string, it
will return the wrong result or an error.

The solution is to use the block cipher directly, in this case sjcl.mode.cbc.
This also has the advantage of fewer format conversions - no converting to
base64 and JSON strings. This makes things faster. Also, it is actually correct
unlike the previous method.
2014-07-09 16:25:48 -07:00
Ryan X. Charles dfc129b766 test vector that passes in node, but fails in browser/sjcl
There is some kind of problem either in bitcore or sjcl involving the
decodeURIComponent function. I discovered this issue while working on the
network protocol for Copay.  Decrypting binary data in sjcl produces problems
due to the way sjcl is interpreting data as strings. I will have to investigate
further tomorrow. For now I am producing this test vector to demonstrate the
issue.
2014-07-09 01:05:16 -07:00
Ryan X. Charles 153cb7ad50 add "real" 0.1.24 and 0.1.25, and...
In this commit I have added the 'official' versions 0.1.24 and 0.1.25 to the
repo, and also created a new bitcore-dev.js that is not included in the repo.
bitcoin-dev.js is what we will use for development. When we define a new
version, we create a new bitcore-x.x.x.js file, and point bitcore-latest.js to
that. Note that the bitcore-x.x.x.js files should always be the "main" bundle,
which does not include BIP39 or BIP70, or other large packages.
2014-07-07 19:50:57 -07:00
Ryan X. Charles 4e3b258f07 Merge remote-tracking branch 'maraoz/feature/bundle-name'
Conflicts:
	browser/bitcore-0.1.24.js
2014-07-07 19:00:26 -07:00
Ryan X. Charles 5cdc160dea Merge branch 'feature/bip70-signing' 2014-07-07 16:58:07 -07:00
Ryan X. Charles f3f94fc9d5 Merge remote-tracking branch 'devrandom/bip39a' 2014-07-07 16:51:46 -07:00
Manuel Araoz fcde4e84ad add new bundles and symbolic link 2014-07-04 15:15:35 -03:00
Ryan X. Charles e48561302b Merge pull request #401 from ryanxcharles/feature/bip70-protobuf
add BIP70 protobuf features in new PayPro lib file
2014-07-03 15:35:41 -07:00
Ryan X. Charles 39889476fb add sign/verify with pki_type SIN
...which is much easier to implement than X.509 certificates.
2014-07-03 15:35:32 -07:00
Ryan X. Charles e69d71924d add test for setObj 2014-07-03 15:35:32 -07:00
Ryan X. Charles 71e226b782 serialize payment request for signature 2014-07-03 15:35:32 -07:00
Ryan X. Charles 76804bef45 Fix checksum comparison error. Closes #402 2014-07-03 09:17:54 -07:00
Ryan X. Charles 0bea06f785 add BIP70 protobuf features in new PayPro lib file
...and add to the "main" bundle, but not the "all" bundle, since it adds
hundreds of kilobytes to the bundle.
2014-07-02 11:39:21 -07:00
Devrandom efb62b08b7 add check function for BIP39
fixes #393
2014-07-01 14:00:08 -07:00
Ryan X. Charles 15d0d1a333 add tests that confirm Message works with buffers 2014-06-25 14:30:28 -07:00
Ryan X. Charles ad5e83f9ff Merge branch 'bip39'
Conflicts:
	browser/bundle.js
2014-06-20 19:35:24 -07:00
Ryan X. Charles 266759ff60 Merge remote-tracking branch 'devrandom/bip39'
Conflicts:
	test/index.html
2014-06-20 19:34:21 -07:00