Compare commits

...

10 Commits

Author SHA1 Message Date
Matias Alejo Garcia
51c53b16ce Merge pull request #1299 from isocolsky/estimate_fee
Add estimatefee rpc call
2015-07-15 23:17:34 -03:00
Ivan Socolsky
29b11b1896 add estimatefee rpc call 2015-07-15 15:55:53 -03:00
Manuel Aráoz
e20df21449 Merge pull request #1023 from braydonf/bug/bn.js
v0.1.x: Upgrade bn.js and elliptic and limit node version to less than 0.10.36
2015-01-31 11:16:17 -03:00
Braydon Fuller
dc3f653fe2 Upgrade bn.js and elliptic and limit node version to less than 0.10.36 2015-01-30 23:44:35 -05:00
Manuel Aráoz
a868ec0ef4 Merge pull request #957 from eordano/update/bignum
Bump bignum version
2015-01-13 11:55:58 -03:00
Esteban Ordano
e2952b6e3a Bump bignum version 2015-01-13 11:38:59 -03:00
Manuel Aráoz
0d238f1165 Merge pull request #727 from thoatbk/master
enforce low S values on key signing
2014-12-12 13:05:20 -03:00
“thoatbk”
28bb0f4cfc enforce low S values for key signing, check BIP62 for details 2014-12-11 22:38:22 +01:00
“thoatbk”
684c306833 enforce low S values on key signing, read BIP62 for details (reverted from commit 722e2efeae) 2014-12-11 22:31:56 +01:00
“thoatbk”
722e2efeae enforce low S values on key signing, read BIP62 for details 2014-12-11 00:37:46 +01:00
5 changed files with 15 additions and 8 deletions

View File

@ -1 +1 @@
repo_token: lBB0wwrjIH3RkwvTjkv8g5r4aUjcIUreC
repo_token: 92KyB69bPowWlcfgXqc24kE5Qt60cCPba

View File

@ -1,6 +1,6 @@
language: node_js
node_js:
- '0.10'
- '0.10.35'
notifications:
hipchat:
rooms:

View File

@ -34,6 +34,7 @@ var callspec = {
decodeRawTransaction: '',
dumpPrivKey: '',
encryptWallet: '',
estimateFee: 'int',
getAccount: '',
getAccountAddress: 'str',
getAddedNodeInfo: '',

View File

@ -160,6 +160,12 @@ Key.sign = function(hash, priv, k) {
var Q = Point.multiply(G, k);
var r = Q.x.mod(n);
var s = k.invm(n).mul(e.add(d.mul(r))).mod(n);
//enforce low s
//see BIP 62, "low S values in signatures"
var n_half = bignum.fromBuffer(new Buffer("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0", 'hex'), {size: 32});
if (s.cmp(n_half) > 0) {
s = new bignum(n).sub(s);
}
} while (r.cmp(new bignum(0)) <= 0 || s.cmp(new bignum(0)) <= 0);
return {r: r, s: s};

View File

@ -58,16 +58,16 @@
"dependencies": {
"asn1.js": "0.4.1",
"async": "~0.2.10",
"bignum": "=0.6.2",
"bindings": "=1.1.1",
"bignum": "^0.9.0",
"binary": "^0.3.0",
"bn.js": "=0.15.0",
"bindings": "=1.1.1",
"bn.js": "=1.0.0",
"brfs": "=1.0.0",
"browserify-buffertools": "git://github.com/maraoz/browserify-buffertools.git",
"bufferput": "git://github.com/bitpay/node-bufferput.git",
"buffers": "=0.1.1",
"buffertools": "=2.1.2",
"browserify-buffertools": "git://github.com/maraoz/browserify-buffertools.git",
"elliptic": "=0.15.12",
"elliptic": "=1.0.0",
"hash.js": "=0.3.2",
"jsrsasign": "=0.0.3",
"preconditions": "^1.0.7",
@ -100,7 +100,7 @@
},
"license": "MIT",
"engines": {
"node": ">=0.10"
"node": ">=0.10 <0.10.36"
},
"devDependencies": {
"browserify": "=3.40.0",