lightning-onion icon indicating copy to clipboard operation
lightning-onion copied to clipboard

Simplify onion routing shared secret calculation loop and adjust term…

Open arik-so opened this issue 6 years ago • 1 comments

The loop can be started from 0 rather than from 1, and the cached blinding factor was actually the cached ephemeral private key, so I renamed the variable.

arik-so avatar Nov 14 '19 19:11 arik-so

I don't think this actually simplifies things. The loop starts from 1 as we've unrolled the first iteration to live outside the main loop. The variable re-name doesn't seem correct either, as it is the running cached blinding factor. I'd recommend reading the comments again, and possibly going back in the commit history to check out what the loop looked like when we had to re-compute the blinding factor for a hop from scratch each time.

Roasbeef avatar Nov 22 '19 00:11 Roasbeef