Comparing version 2.0.1 to 2.0.3
{ | ||
"name": "hivecrypt", | ||
"version": "2.0.1", | ||
"version": "2.0.3", | ||
"description": "A small JavaScript module for Hive memo encryption and decryption", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -137,2 +137,3 @@ /** | ||
} | ||
static fromBuffer(key) { | ||
@@ -142,2 +143,3 @@ assert(secp256k1.publicKeyVerify(key), "invalid buffer as public key"); | ||
} | ||
/** | ||
@@ -184,15 +186,3 @@ * Create a new instance from a WIF-encoded key. | ||
} | ||
/** | ||
* HMAC based key derivation function | ||
* @param pub recipient publickey | ||
*/ | ||
encapsulate(pub) { | ||
const master = Buffer.concat([ | ||
pub.uncompressed, | ||
this.multiply(pub), | ||
]); | ||
return hkdf(master, 64, { | ||
hash: "SHA-512", | ||
}); | ||
} | ||
multiply(pub) { | ||
@@ -199,0 +189,0 @@ return Buffer.from(secp256k1.publicKeyTweakMul(pub.key, this.secret, false)); |
Sorry, the diff of this file is too big to display
629252
593