Matias Alejo Garcia
3d828df063
add test to SIN
11 years ago
Matias Alejo Garcia
71f992138b
add check in constructor of Address
11 years ago
Matias Alejo Garcia
19584e1f26
add check in constructor
11 years ago
Matias Alejo Garcia
3dd09129c8
fix tests
11 years ago
Matias Alejo Garcia
85e013c620
fix tests
11 years ago
Matias Alejo Garcia
cad0fcf993
update tests
11 years ago
Matias Alejo Garcia
15c55e560a
support uncompressed pub keys also
11 years ago
Matias Alejo Garcia
14d3165a73
add fromPubKey to SIN
11 years ago
Christopher Jeffrey
f7c247fa12
paypro: alter tests to make sure this pki_data bug does not happen again.
11 years ago
Christopher Jeffrey
017f044b53
paypro: fix browser signatures with KJUR. move pem/der functions to common.
11 years ago
Christopher Jeffrey
604ac04f47
paypro: split up paypro into node/browser/common.
11 years ago
Christopher Jeffrey
2741f7509f
paypro: minor - remove useless text processing.
11 years ago
Christopher Jeffrey
fa1c4b3570
paypro: add DERtoPEM and PEMtoDER tests.
11 years ago
Christopher Jeffrey
14966082ae
paypro: separate tests for x509+sha256 and x509+sha1.
11 years ago
Christopher Jeffrey
02f9ce8dfd
paypro: temporarily fix tests.
11 years ago
Christopher Jeffrey
45ff292ade
paypto: alter tests to improve consistency with signature and verification tests.
11 years ago
Christopher Jeffrey
0db74604db
paypro: update root certs and fix tests.
11 years ago
Christopher Jeffrey
cc7657d843
paypro: treat pki_data as an array.
11 years ago
Christopher Jeffrey
2e422c001e
paypro: fix payment protocol for DER certs.
11 years ago
Christopher Jeffrey
3dc7a4ab84
test: fix x509 tests for PayPro.
11 years ago
Christopher Jeffrey
13553a42d1
x509: try different certs/keys/pems.
11 years ago
Christopher Jeffrey
c209e3172d
paypro: x509 nonsense.
11 years ago
Christopher Jeffrey
1d0f01c133
paypro: first pass at implementing payment protocol for x509.
11 years ago
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.
11 years ago
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.
11 years ago
Ryan X. Charles
49ff6c7b76
add further tests for Key
11 years ago
Ryan X. Charles
57a55d0863
expose signature internal functions
"sign" and "genk" ... and add some signature tests
11 years ago
Ryan X. Charles
2c136d4dcc
remove obsolete Curve class (G and n now accessible from Point)
11 years ago
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.
11 years ago
Ryan X. Charles
95d180c2a3
add ScriptInterpreter example to test
11 years ago
Ryan X. Charles
71f181efee
add tests to EncodedData and fix hex conversion bug
...making sure the new changes to __proto__ are working correctly.
11 years ago
Ryan X. Charles
895bb6bab9
use correct constant & share between Transaction and ScriptInterpreter
Closes https://github.com/bitpay/bitcore/issues/424
11 years ago
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
11 years ago
Ryan X. Charles
92ac073035
run secp256k1 test vectors in Key where they also matter
11 years ago
Ryan X. Charles
572035fdd5
add some test vectors for secp256k1
11 years ago
Ryan X. Charles
0f0a1b1913
add some sanity checks to signature verification
11 years ago
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.
11 years ago
Ryan X. Charles
3f75bea924
add tests for toCompressedPubKey
11 years ago
Ryan X. Charles
992e1cfcfb
uncomment part of TransactionBuilder test
11 years ago
Ryan X. Charles
9c23256a16
add tests to make sure bignum interface works correctly
11 years ago
Ryan X. Charles
32cf5aa941
woops - add bignum back to browser tests
11 years ago
Ryan X. Charles
fb3cc38046
make bignum tests run in node, not just browser
11 years ago
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
11 years ago
Ryan X. Charles
9ca869b95b
add "ECKey" to Key test so grepping is easier
11 years ago
Ryan X. Charles
ac4d3186bf
update sign function to use elliptic
11 years ago
Ryan X. Charles
15d4328b35
use elliptic in Point in the browser instead of cryptojs
11 years ago
Ryan X. Charles
c8fe404402
replace bignumber.js with bn.js
11 years ago
Manuel Araoz
0e2df698cd
fix SIN and add tests
11 years ago
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.
11 years ago
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.
11 years ago