Commit Graph

2 Commits

Author SHA1 Message Date
Ryan X. Charles 46271de06e add some basic sanity tests for signatures and key generation
Signing a message with ECDSA involves using a random number, and this means
that two signatures should never be the same. This commit adds some basic tests
to Key.signSync and Message.sign to make sure this is the case. Also, a new
bitcore.Key should never have the same private key twice. This commit also adds
a basic test to make sure that is the case.
2014-05-01 12:27:55 -04:00
Ryan X. Charles 659dc10f96 add support for signing/verifying messages
This adds a new Message class with static methods for signing and verifying a
message the same way as bitcoind. (In a nutshell, messages a prepended with
"Bitcoin Signed Message:" before being hashed and signed).

There is one important piece missing ... verifying a signature with an address,
and not a public key. I have not yet implemented this because the cryptography
interface of bitcore does not allow me to derive the public key from a
signature. This will need to be added before verifying from an address is
possible.
2014-04-19 11:28:19 -03:00