Closed lukechampine closed 3 years ago
This doesn't need to be in the library, and I tried to leave cofactor issues out of scope.
Instead, you can implement it as
// [8](u - v) == 0
p := (&Point{}).Sub(u, v) // p = u - v
p.Double(p).Double(p).Double(p) // p = [8]p
p.Equal(NewIdentityPoint()) // p == 0
This is needed for
ed25519consensus
. Implementation is directly ported from there. (src)I don't know how to write tests for this, sorry :/