integration: return sharedQ too
This commit is contained in:
parent
79db118417
commit
e9762b14c7
1 changed files with 3 additions and 5 deletions
|
@ -24,7 +24,7 @@ describe('bitcoinjs-lib (crypto)', function () {
|
||||||
var Qprime = Q.add(cG)
|
var Qprime = Q.add(cG)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
address: new bitcoin.ECPair(null, Qprime).getAddress(),
|
sharedQ: Qprime,
|
||||||
nonceQ: noncePair.Q
|
nonceQ: noncePair.Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,7 @@ describe('bitcoinjs-lib (crypto)', function () {
|
||||||
var c = bigi.fromBuffer(bitcoin.crypto.sha256(dP.getEncoded()))
|
var c = bigi.fromBuffer(bitcoin.crypto.sha256(dP.getEncoded()))
|
||||||
var derived = new bitcoin.ECPair(d.add(c).mod(n))
|
var derived = new bitcoin.ECPair(d.add(c).mod(n))
|
||||||
|
|
||||||
return {
|
return derived
|
||||||
keyPair: derived
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// receiver private key
|
// receiver private key
|
||||||
|
@ -48,7 +46,7 @@ describe('bitcoinjs-lib (crypto)', function () {
|
||||||
var stealthR = stealthReceive(receiver.d, stealthS.nonceQ) // private, done by receiver
|
var stealthR = stealthReceive(receiver.d, stealthS.nonceQ) // private, done by receiver
|
||||||
|
|
||||||
// and check that we derived both sides correctly
|
// and check that we derived both sides correctly
|
||||||
assert.equal(stealthS.address, stealthR.keyPair.getAddress())
|
assert.equal(stealthS.sharedQ.getAddress(), stealthR.getAddress())
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
Loading…
Reference in a new issue