Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Got this issue while testing #5

Closed
fix opened this issue Jan 31, 2017 · 5 comments
Closed

Got this issue while testing #5

fix opened this issue Jan 31, 2017 · 5 comments

Comments

@fix
Copy link
Contributor

fix commented Jan 31, 2017

bitpay/bitcore-lib#47

Maybe wise to pad the private key when generated something like:

this.d=new BigInteger(this.d.toBuffer({size:32}));

But the issue can be that BigInteger ignore leading 0...

Maybe better to fix here:

https://github.com/ArkEcosystem/ark-js/blob/master/lib/ecpair.js#L137

this.d.toBuffer({size:32})

@fix
Copy link
Contributor Author

fix commented Jan 31, 2017

cases in hand to be added to tests:

passhprase iwrj4zyz1cghtz7zxgvi 
private key 2535b7a87019a0461f50a96747e9a0fd5ac7eb69e50fd7ca4d599d77634b71
length 31
passhprase ghpuw96rot6466mq85mi -  
private key d5a63ba2cebcbd0e1d5de0b01d9f34a2f24b230583a3f83023c4b67f2b171e
length 31

private key obtained by:
keypair.d.toBuffer().toString("hex")

fix added a commit that referenced this issue Jan 31, 2017
@fix
Copy link
Contributor Author

fix commented Jan 31, 2017

ok need to add test

@fix
Copy link
Contributor Author

fix commented Jan 31, 2017

don't have time to include it in ark-js, but working on ark-node.

it('using fake passphrases, could raise error with wrong private key', function (done) {
			var transaction, p1, p2;
			p1="iwrj4zyz1cghtz7zxgvi";
			p2="ghpuw96rot6466mq85mi";

			try{
				var transaction = node.ark.transaction.createTransaction('AacRfTLtxAkR3Mind1XdPCddj1uDkHtwzD', 1, null, p1, p2);
			}
			catch(error){
				node.expect(true).to.be.not.ok;
			}
			done();
		});

@Doweig
Copy link
Contributor

Doweig commented Feb 1, 2017

Commit 0bd054e was pushed to master, I think you meant to push to dev @fix

@fix
Copy link
Contributor Author

fix commented Feb 14, 2017

yes :)

@fix fix closed this as completed Feb 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants