conseiljs-softsigner
Advanced tools
Comparing version 5.0.4-beta.0 to 5.0.4-beta.1
@@ -21,2 +21,3 @@ "use strict"; | ||
const secp256k1 = __importStar(require("secp256k1")); | ||
const Ed25519 = __importStar(require("ed25519-hd-key")); | ||
const conseiljs_1 = require("conseiljs"); | ||
@@ -57,4 +58,12 @@ const conseiljs_2 = require("conseiljs"); | ||
} | ||
const seed = (yield bip39.mnemonicToSeed(mnemonic, password)).slice(0, 32); | ||
const keys = yield generateKeys(seed); | ||
let keys; | ||
const seed = yield bip39.mnemonicToSeed(mnemonic, password); | ||
if (derivationPath !== undefined) { | ||
const sk = (Ed25519.derivePath(derivationPath, seed.toString("hex"))).key; | ||
const p = Ed25519.derivePath(derivationPath, seed.toString("hex")); | ||
keys = yield recoverKeys(Buffer.concat([p.key, p.chainCode])); | ||
} | ||
else { | ||
keys = yield generateKeys(seed.slice(0, 32)); | ||
} | ||
const secretKey = conseiljs_2.TezosMessageUtils.readKeyWithHint(keys.secretKey, 'edsk'); | ||
@@ -61,0 +70,0 @@ const publicKey = conseiljs_2.TezosMessageUtils.readKeyWithHint(keys.publicKey, 'edpk'); |
@@ -26,6 +26,11 @@ /** | ||
const seed_keypair = async (seed) => { | ||
await sodiumsumo.ready; | ||
return sodiumsumo.crypto_sign_seed_keypair(seed); | ||
} | ||
const publicKey = async (sk) => { | ||
await sodiumsumo.ready; | ||
const seed = sodiumsumo.crypto_sign_ed25519_sk_to_seed(sk) | ||
return sodiumsumo.crypto_sign_seed_keypair(seed, ''); | ||
return sodiumsumo.crypto_sign_seed_keypair(seed); | ||
} | ||
@@ -62,2 +67,2 @@ | ||
module.exports = {salt, nonce, keys, publicKey, pwhash, close, open, sign, checkSignature}; | ||
module.exports = {salt, nonce, keys, seed_keypair, publicKey, pwhash, close, open, sign, checkSignature}; |
{ | ||
"name": "conseiljs-softsigner", | ||
"version": "5.0.4-beta.0", | ||
"version": "5.0.4-beta.1", | ||
"description": "ConseilJS software signer plugin for ConseilJS-core. Supports the ED25519 curve via libsodium for tz1-address operations.", | ||
@@ -68,2 +68,3 @@ "browser": "dist/index.js", | ||
"conseiljs": "5.0.5", | ||
"ed25519-hd-key": "1.1.2", | ||
"generate-password": "1.5.1", | ||
@@ -70,0 +71,0 @@ "libsodium-wrappers-sumo": "0.7.8", |
@@ -51,3 +51,3 @@ # ConseilJS-softsigner | ||
<script src="https://cdn.jsdelivr.net/gh/cryptonomic/conseiljs-softsigner/dist-web/conseiljs-softsigner.min.js" | ||
integrity="sha384-sv6LkGbuz78mVckOK+Fhy/wJXzO/5Bmo/SDp+l+/yrjlgasQ+3rOKZxXGvIDQsKN" | ||
integrity="sha384-CQKOqv+EzdQn751Q3h+QC6RjW4euhK6HyntuKRHQe6aQl3/0bAeQVcyKZzsywE4D" | ||
crossorigin="anonymous"></script> | ||
@@ -54,0 +54,0 @@ <script> |
Sorry, the diff of this file is not supported yet
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
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
47471
424
6
+ Addeded25519-hd-key@1.1.2
+ Addeded25519-hd-key@1.1.2(transitive)
+ Addedtweetnacl@1.0.3(transitive)