Socket
Socket
Sign inDemoInstall

hdkey

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hdkey - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

6

CHANGELOG.md

@@ -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 @@ ------------------

16

lib/hdkey.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc