Skip to content

Commit

Permalink
Merge pull request #52 from DECENTfoundation/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dusanDrabik authored Mar 21, 2019
2 parents 91cadc8 + 65d0709 commit 56a2ef1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcorejs-lib",
"version": "1.6.0",
"version": "1.6.1",
"description": "Low level javascript library for Decent blockchain",
"browser": {
"ws": false,
Expand Down Expand Up @@ -36,7 +36,7 @@
"ReconnectingWebSocket": "git+https://github.com/bitshares/reconnecting-websocket.git",
"bigi": "^1.4.1",
"bs58": "^3.1.0",
"bytebuffer": "^5.0.0",
"bytebuffer": "^5.0.1",
"create-hash": "^1.1.2",
"create-hmac": "^1.1.4",
"crypto-js": "^3.1.9-1",
Expand Down
8 changes: 4 additions & 4 deletions src/ecc/src/ecdsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function deterministicGenerateK(curve, hash, d, checkSig, nonce) {
enforceType(BigInteger, d);

if (nonce) {
hash = sha256(Buffer.concat([hash, Buffer.from(nonce)]))
hash = sha256(Buffer.concat([hash, Buffer.from([nonce+''])]))
}

// sanity check
Expand All @@ -29,13 +29,13 @@ function deterministicGenerateK(curve, hash, d, checkSig, nonce) {
k.fill(0);

// Step D
k = HmacSHA256(Buffer.concat([v, Buffer.from([0]), x, hash]), k);
k = HmacSHA256(Buffer.concat([v, Buffer.from([0+'']), x, hash]), k);

// Step E
v = HmacSHA256(v, k);

// Step F
k = HmacSHA256(Buffer.concat([v, Buffer.from([1]), x, hash]), k);
k = HmacSHA256(Buffer.concat([v, Buffer.from([1+'']), x, hash]), k);

// Step G
v = HmacSHA256(v, k);
Expand All @@ -48,7 +48,7 @@ function deterministicGenerateK(curve, hash, d, checkSig, nonce) {

// Step H3, repeat until T is within the interval [1, n - 1]
while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0) || !checkSig(T)) {
k = HmacSHA256(Buffer.concat([v, Buffer.from([0])]), k);
k = HmacSHA256(Buffer.concat([v, Buffer.from([0+''])]), k);
v = HmacSHA256(v, k);

// Step H1/H2a, again, ignored as tlen === qlen (256 bit)
Expand Down
2 changes: 1 addition & 1 deletion src/serializer/src/FastParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FastParser {
let buffer = public_key.toBuffer();
b.append(buffer.toString('binary'), 'binary');
} else {
buffer = FastParser.fixed_data(b, 33);
let buffer = FastParser.fixed_data(b, 33);
return PublicKey.fromBuffer(buffer);
}
}
Expand Down

0 comments on commit 56a2ef1

Please sign in to comment.