|
|
@ -22,9 +22,9 @@ Stealth.prototype.fromAddressBuffer = function(buf) { |
|
|
|
var sPubBuf = buf.slice(33, 66); |
|
|
|
|
|
|
|
var payloadPubkey = Pubkey().fromDER(pPubBuf); |
|
|
|
this.payloadKey = Key(undefined, payloadPubkey); |
|
|
|
this.payloadKey = Key({pubkey: payloadPubkey}); |
|
|
|
var scanPubkey = Pubkey().fromDER(sPubBuf); |
|
|
|
this.scanKey = Key(undefined, scanPubkey); |
|
|
|
this.scanKey = Key({pubkey: scanPubkey}); |
|
|
|
|
|
|
|
return this; |
|
|
|
}; |
|
|
@ -78,7 +78,7 @@ Stealth.prototype.getReceivePubkeyAsSender = function(senderKey) { |
|
|
|
Stealth.prototype.getReceiveKey = function(senderPubkey) { |
|
|
|
var sharedKey = this.getSharedKeyAsReceiver(senderPubkey); |
|
|
|
var privkey = Privkey(this.payloadKey.privkey.bn.add(sharedKey.privkey.bn).mod(Point.getN())); |
|
|
|
var key = Key(privkey); |
|
|
|
var key = Key({privkey: privkey}); |
|
|
|
key.privkey2pubkey(); |
|
|
|
|
|
|
|
return key; |
|
|
|