Comments (2)
👍. I originally did interleaved Montgomery multiplication because it seemed popular in the literature (e.g. here), but that might have been a mistake, since separate mul and reduce methods would make it easier to optimize squaring and skip certain reductions.
Another option (not that we need to study them all) is curve25519-dalek's [u64; 5]
backend. It seems relatively fast, and they also have a SIMD backend.
from plonky.
Oh, I had forgotten about curve25519-dalek, thanks for reminding me! Added to the list. They presumably use the fast reduction for the modulus 2^255-19
, which will be relevant wrt #71.
Generally the interleaved Monty modmul is a bit faster than mult+REDC when you're in the range where 'schoolbook multiplication' is fastest. Definitely not a mistake! If you have bigger numbers, ones where you'd want to use Karatsuba or FFT multiplication (probably not relevant for us), or if you want to take advantage of fast squaring (as we do), then mult/sqr + REDC is the way to go. The question for us will be whether the 'fast squaring' trick is actually faster with the fairly small numbers we're dealing with. [Fast squaring can work with CIOS; see updated comments on #70.]
Also worth noting that fast reduction mod 2^b + c
doesn't (necessary) need Monty representation at all.
from plonky.
Related Issues (16)
- Refactor curve and field tests
- Explicit formulae typo in the blog? HOT 1
- Refactor existing modular arithmetic code HOT 12
- Fast modular squaring HOT 3
- Faster reduction of 2^b + c moduli HOT 1
- Vectorise modular multiplication
- Improved carry-chain management
- Non-reduced representation of base field elements
- Check whether rustc eliminates arithmetic from const zero values HOT 2
- Test suite for finite field arithmetic
- Generate baseline performance measurements for current field arithmetic implementations
- Refactor the underlying representation of the two Tweedle curves
- Benchmarking panics when generating the recursion circuit HOT 2
- I get errors when I run the tests HOT 2
- Add support for Pasta curves HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plonky.