Skip to content

Commit

Permalink
Move shared secret calculation outside k loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ottosch authored and setavenger committed May 26, 2024
1 parent 52d21e3 commit d4f7368
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ func ReceiverScanTransaction(scanKey [32]byte, receiverSpendPubKey [33]byte, lab
// todo should probably check inputs before computation especially the labels
var foundOutputs []*FoundOutput

sharedSecret, err := CreateSharedSecret(publicComponent, scanKey, inputHash)
if err != nil {
return nil, err
}

var k uint32 = 0
for true {
sharedSecret, err := CreateSharedSecret(publicComponent, scanKey, inputHash)
if err != nil {
return nil, err
}

var outputPubKey [32]byte
var tweak [32]byte
outputPubKey, tweak, err = CreateOutputPubKeyTweak(sharedSecret, receiverSpendPubKey, k)
Expand Down

0 comments on commit d4f7368

Please sign in to comment.