Comparing version 1.1.2 to 2.0.0
@@ -0,1 +1,7 @@ | ||
2.0.0 / 2020-05-29 | ||
------------------ | ||
- **BREAKING:** Require Node.js v10+ ([#38](https://github.com/cryptocoinjs/hdkey/pull/38)) | ||
- Upgrade `secp256k1` dependency; to use N-API ([#32](https://github.com/cryptocoinjs/hdkey/pull/32)) | ||
1.1.2 / 2020-04-16 | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -38,3 +38,3 @@ var assert = require('assert') | ||
this._privateKey = value | ||
this._publicKey = secp256k1.publicKeyCreate(value, true) | ||
this._publicKey = Buffer.from(secp256k1.publicKeyCreate(value, true)) | ||
this._identifier = hash160(this.publicKey) | ||
@@ -53,3 +53,3 @@ this._fingerprint = this._identifier.slice(0, 4).readUInt32BE(0) | ||
this._publicKey = secp256k1.publicKeyConvert(value, true) // force compressed point | ||
this._publicKey = Buffer.from(secp256k1.publicKeyConvert(value, true)) // force compressed point | ||
this._identifier = hash160(this.publicKey) | ||
@@ -130,3 +130,3 @@ this._fingerprint = this._identifier.slice(0, 4).readUInt32BE(0) | ||
try { | ||
hd.privateKey = secp256k1.privateKeyTweakAdd(this.privateKey, IL) | ||
hd.privateKey = Buffer.from(secp256k1.privateKeyTweakAdd(this.privateKey, IL)) | ||
// throw if IL >= n || (privateKey + IL) === 0 | ||
@@ -142,3 +142,3 @@ } catch (err) { | ||
try { | ||
hd.publicKey = secp256k1.publicKeyTweakAdd(this.publicKey, IL, true) | ||
hd.publicKey = Buffer.from(secp256k1.publicKeyTweakAdd(this.publicKey, IL, true)) | ||
// throw if IL >= n || (g**IL + publicKey) is infinity | ||
@@ -160,7 +160,11 @@ } catch (err) { | ||
HDKey.prototype.sign = function (hash) { | ||
return secp256k1.sign(hash, this.privateKey).signature | ||
return Buffer.from(secp256k1.ecdsaSign(hash, this.privateKey).signature) | ||
} | ||
HDKey.prototype.verify = function (hash, signature) { | ||
return secp256k1.verify(hash, signature, this.publicKey) | ||
return secp256k1.ecdsaVerify( | ||
Uint8Array.from(signature), | ||
Uint8Array.from(hash), | ||
Uint8Array.from(this.publicKey) | ||
) | ||
} | ||
@@ -167,0 +171,0 @@ |
{ | ||
"name": "hdkey", | ||
"version": "1.1.2", | ||
"version": "2.0.0", | ||
"description": "Bitcoin BIP32 hierarchical deterministic keys", | ||
@@ -39,3 +39,3 @@ "main": "lib/hdkey.js", | ||
"safe-buffer": "^5.1.1", | ||
"secp256k1": "^3.0.1" | ||
"secp256k1": "^4.0.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18504
200
1
+ Addednode-addon-api@2.0.2(transitive)
+ Addednode-gyp-build@4.8.2(transitive)
+ Addedsecp256k1@4.0.3(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbip66@1.1.5(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removeddrbg.js@1.0.1(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removednan@2.20.0(transitive)
- Removedsecp256k1@3.8.0(transitive)
Updatedsecp256k1@^4.0.0