I went down the rabbit hole, 120 ms to sign and as many to verify was too much.
I knew libsecp256k1 was efficient (and, more important, secure) but I wanted to learn how it was as many as a _thousand_ times faster
The journey in the hole brought me to learn and implement:
* Jacobian coordinates
* Pre-caching G multiples
* Specific code for doubling points and mixed add
* Borrowing instead of copying
* Multiplying instead of powering for 2 or 3
* Avoiding any inverse in verify
* NAF non adjacent form to multiply
* Shamir's trick
* Bos-Coster
* Arbitrary precision integer libs
* Benchmarking everything for evidence
Those improvement brought signing time to 270 us and verifying to 1.1 ms which are still slower than libsecp256k1 (about 3 times slower to sign and 11 times slower to verify). However a _lot_ closer!
About the Non Adjacent Form, the choice of w wasn't discounted, so I benchmarked it and went to use w=5, I wonder if libsecp256k1 use the same
About the batch verification, it looks Bos-Coster achieve logarithmic efficiency.
Any suggestions to improve results are welcome!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Riccardo Casatta

Riccardo Casatta Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!