git://git.novaco.in
/
electrum-nvc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
c9d7989
)
Bugfix: Allow signing messages over 252 characters
author
Fredrick
<copypaste@wizardchan.org>
Tue, 10 Sep 2013 21:31:01 +0000 (17:31 -0400)
committer
Fredrick
<copypaste@wizardchan.org>
Tue, 10 Sep 2013 21:31:01 +0000 (17:31 -0400)
lib/bitcoin.py
patch
|
blob
|
history
diff --git
a/lib/bitcoin.py
b/lib/bitcoin.py
index
a4c30fe
..
6a16ec5
100644
(file)
--- a/
lib/bitcoin.py
+++ b/
lib/bitcoin.py
@@
-286,7
+286,10
@@
SECP256k1 = ecdsa.curves.Curve("SECP256k1", curve_secp256k1, generator_secp256k1
from ecdsa.util import string_to_number, number_to_string
def msg_magic(message):
- return "\x18Bitcoin Signed Message:\n" + chr( len(message) ) + message
+ varint = var_int(len(message))
+ encoded_varint = "".join([chr(int(varint[i:i+2], 16)) for i in xrange(0, len(varint), 2)])
+
+ return "\x18Bitcoin Signed Message:\n" + encoded_varint + message
class EC_KEY(object):