Comments (3)
The fact that ADD, SUB are slow also causes a mismatch about optimization. Many optimization techniques deployed in existing Rust code is around reducing multiplications and encouraging simpler additions and subtractions. The situation with RISC Zero at the moment, with the OP_MULTIPLY sub-syscall being very privileged, is different.
from risc0.
Below is the benchmark result for the examples/src/ecdsa
in 0.20.1
Field operations:
add: 173 cycles
mul: 39 cycles
mul_single: 48 cycles
square: 39 cycles
negate: 31 cycles
invert: 9328 cycles
Scalar operations:
add: 225 cycles
mul: 147 cycles
square: 147 cycles
negate: 123 cycles
invert: 18294 cycles
invert_vartime: 17201 cycles
Group operations:
lincomb: 925349 cycles
from risc0.
Addition (without modular reduction) is about 4x overhead of modular multiplication right now. If it may overflow (this is always the case for secp256k1, but ed25519 offers some delay), another addition to fix the gap is needed, making it 8x.
This leads to a situation as follows: most of the curve formulas become equivalent in terms of performance because they usually have 6-7 adds. There are alternative representations that have even more adds, but does not seem to have any result that goes lower.
Optimization, therefore, would be mainly about NAF representations, endomorphisms, windows etc.
from risc0.
Related Issues (20)
- [BUG] broken links on landing page for docs.rs zkvm crate HOT 5
- [BUG] `examples/digital-signature` fails with `--features=risc0-zkvm/metal` HOT 3
- [BUG] Building the entire workspace fails (missing req.) HOT 12
- Have `risc0-build` produce a Solidity contract output for image IDs
- [BUG] cargo binstall cargo-risczero fails because of openssl-sys error HOT 3
- Error running `cargo` on MacOS with explicit toolchain `channel = 1.73` HOT 4
- Update README on main to point to 0.20 crates
- Test from linear HOT 3
- [Feature] Necessity of quotient bigint syscall HOT 2
- [Feature] update profiler to show cycle counts based on paging HOT 1
- [BUG] clippy does not work on 1.75.0 toolchain HOT 1
- [BUG] 'failed to fill whole buffer' error when using k256 crate HOT 4
- [BUG] HOT 2
- [Feature] Move `ExecutorImpl` out of the `prove` feature (for zkvm) HOT 1
- [Feature] Executor: configure segment storage HOT 1
- Reproducible build workflow and documentation HOT 3
- [BUG] The 'risc0' toolchain could not be found for x86_64-apple-darwin HOT 3
- Add example READMEs to top-level module rust docs to get test coverage HOT 1
- [issues templates] add template to report documentation issues HOT 2
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 risc0.