There currently is a single branch in the ecmul_const
function that is not being exercised by the tests. This branch is unreachable and therefore I’m suggesting to remove it.
For your convenience the paper the wnaf algorithm can be found here (The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar Multiplications Secure against Side Channel Attacks). Similarly, unless I’m missing something important, I don’t see how their algorithm needs to consider sign(u[i-1])
unless d
can be negative - which doesn’t make much sense to me either.