Comparing version 0.0.41 to 0.0.42
@@ -26,2 +26,3 @@ import * as constants from "./lib/constants" | ||
import createDoichainEntry from "./lib/createDoichainEntry" | ||
import getPrivateKeyFromWif from "./lib/getPrivateKeyFromWif" | ||
@@ -53,3 +54,4 @@ export { | ||
decryptStandardECIES, | ||
createDoichainEntry | ||
createDoichainEntry, | ||
getPrivateKeyFromWif | ||
} |
{ | ||
"name": "doichain", | ||
"version": "0.0.41", | ||
"version": "0.0.42", | ||
"description": "A js-Doichain library. The goal is to fully cover the Doichain protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,2 +34,3 @@ import chai from 'chai' | ||
import encryptStandardECIES from "../lib/encryptStandardECIES" | ||
import getPrivateKeyFromWif from "../lib/getPrivateKeyFromWif" | ||
@@ -258,3 +259,10 @@ | ||
function rng () { | ||
changeNetwork('regtest') | ||
const wif = "cP3EigkzsWuyKEmxk8cC6qXYb4ZjwUo5vzvZpAPmDQ83RCgXQruj" | ||
var keyPair = bitcoin.ECPair.fromWIF(wif,DOICHAIN_REGTEST) | ||
var publicKey = keyPair.publicKey.toString('hex') | ||
const privateKeyOfBob2 = getPrivateKeyFromWif(wif,DOICHAIN_REGTEST) | ||
/* function rng () { | ||
return Buffer.from('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz') | ||
@@ -265,7 +273,8 @@ } // get a much more secure random | ||
const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey }) | ||
//console.log("address " + address) // 17wqX8P6kz6DrDRQfdJ9KeqUTRmgh1NzSk | ||
var publicKey = keyPair.publicKey.toString('hex') | ||
//console.log("address " + address) // 17wqX8P6kz6DrDRQfdJ9KeqUTRmgh1NzSk*/ | ||
// var publicKey = keyPair.publicKey.toString('hex') | ||
//console.log("public key " + publicKey) // 0279bf075bae171835513be1056f224f94f3915f9999a3faea1194d97b54397219 | ||
var wif = keyPair.toWIF() | ||
//console.log("private key WIF " + wif) // 200424e3612358db9078760d4f652a105049187c29f2d03d7d65bc9e27a007d0 | ||
@@ -275,3 +284,3 @@ | ||
const publicKeyOfBob2 = publicKey | ||
const privateKeyOfBob2 = keyPair.privateKey.toString('hex') | ||
const encryptedMessage2 = encryptStandardECIES(publicKeyOfBob2,message2) | ||
@@ -278,0 +287,0 @@ const decryptedMessage2 = decryptStandardECIES(privateKeyOfBob2,encryptedMessage2) |
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
194504
44
1163