Closed dsernst closed 2 years ago
What do you need it for?
Modular division, trying to keep dependencies down
I understand, but could you clarify what protocol you're developing or which part of it requires inversion.
I don't want to expose unneeded internals in case these can be replaced by simple helper functions, like we've did with isTorsionFree()
— there was no need in exposing multiplyUnsafe
.
It's for siv.org. We use them in a number of places, in particular for calculating Lagrangians in a secret sharing ceremony, and some ZK proofs.
No worries if you'd rather keep this library more focused though, we can work off a fork instead. There are a number of other changes we've made - like exposing Ristretto.multiplyUnsafe()
for speeding up proof verifications, and adding .toString()
as an alias of .toHex()
so it automatically stringifies better for debugging, .join()
, etc.
It would be great if you could open a pull request for all these changes. I'm sure i'd like to merge improvements that make writing new protocols easier.
Done:
Export the existing
invert()
function inutils
https://github.com/paulmillr/noble-ed25519/blob/a08955c9b15648f3f7ff5beaecbb0b0156bb5a65/index.ts#L672
And adds it to the README docs