-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'starkware-libs:dev' into dev
- Loading branch information
Showing
59 changed files
with
4,587 additions
and
975 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,62 @@ | ||
<div align="center"> | ||
|
||
![STWO](resources/img/logo.png) | ||
|
||
<a href="https://github.com/starkware-libs/stwo/actions/workflows/ci.yaml"><img alt="GitHub Workflow Status (with event)" src="https://img.shields.io/github/actions/workflow/status/starkware-libs/stwo/ci.yaml?style=for-the-badge" height=30></a> | ||
<a href="https://codecov.io/gh/starkware-libs/stwo" > | ||
<img src="https://img.shields.io/codecov/c/github/starkware-libs/stwo?style=for-the-badge&logo=codecov" height=30/> | ||
</a> | ||
<a href="https://github.com/starkware-libs/stwo/blob/main/LICENSE"><img src="https://img.shields.io/github/license/starkware-libs/stwo.svg?style=for-the-badge" alt="Project license" height="30"></a> | ||
<a href="https://starkware.co/"><img src="https://img.shields.io/badge/By StarkWare-29296E.svg?&style=for-the-badge&logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEgMTgxIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE3Ni43Niw4OC4xOGwtMzYtMzcuNDNjLTEuMzMtMS40OC0zLjQxLTIuMDQtNS4zMS0xLjQybC0xMC42MiwyLjk4LTEyLjk1LDMuNjNoLjc4YzUuMTQtNC41Nyw5LjktOS41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S0xNC4xMmMtLjY0LS40NS0xLjE0LTEuMDgtMS40Mi0xLjgxbDE5LjA0LDUuMTgsMi41OSwuNzhjMi4wNCwuNzYsNC4zMywuMTQsNS43LTEuNTVsMTIuOTUtMTQuMzhzLjc4LTEuMDQsMS42OC0xLjE3Yy0xLjgxLDYuNi0yLjk4LDE0LjEyLTUuNDQsMjAuNDYtMS4wOCwyLjk2LS4wOCw2LjI4LDIuNDYsOC4xNiw0LjI3LDQuMTQsOC4yOSw4LjU1LDEyLjk1LDEyLjk1LDAsMCwxLjMsLjkxLDEuNDIsMi4wN2wtMTMuMzQtMy42M1oiLz48L3N2Zz4=" alt="StarkWare" height="30"></a> | ||
</div> | ||
|
||
<div align="center"> | ||
<h3> | ||
<a href="https://eprint.iacr.org/2024/278"> | ||
Paper | ||
</a> | ||
<span> | </span> | ||
<a href="https://github.com/starkware-libs/stwo"> | ||
Documentation | ||
</a> | ||
<span> | </span> | ||
<a href="https://starkware-libs.github.io/stwo/dev/bench/index.html"> | ||
Benchmarks | ||
</a> | ||
</h3> | ||
</div> | ||
|
||
# Stwo | ||
|
||
## About | ||
## 🌟 About | ||
|
||
Stwo is a next generation implementation of a [CSTARK](https://eprint.iacr.org/2024/278) prover and verifier, written in Rust 🦀. | ||
|
||
> **Stwo is a work in progress.** | ||
> | ||
> It is not recommended to use it in a production setting yet. | ||
Stwo is a Rust implementation of a [CSTARK](https://eprint.iacr.org/2024/278) prover and verifier. | ||
## 🚀 Key Features | ||
|
||
## Disclaimer | ||
- **Circle STARKs:** Based on the latest cryptographic research and innovations in the ZK field. | ||
- **High performance:** Stwo is designed to be extremely fast and efficient. | ||
- **Flexible:** Adaptable for various validity proof applications. | ||
|
||
Stwo is a work in progress. | ||
## 📊 Benchmarks | ||
|
||
## License | ||
Run `poseidon_benchmark.sh` to run a single-threaded poseidon2 hash proof benchmark. | ||
|
||
Further benchmarks can be run using `cargo bench`. | ||
|
||
Visual representation of benchmarks can be found [here](https://starkware-libs.github.io/stwo/dev/bench/index.html). | ||
|
||
## 📜 License | ||
|
||
This project is licensed under the **Apache 2.0 license**. | ||
|
||
See [LICENSE](LICENSE) for more information. | ||
|
||
<!-- markdownlint-restore --> | ||
<!-- prettier-ignore-end --> | ||
|
||
<!-- ALL-CONTRIBUTORS-LIST:END --> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion, Throughput}; | ||
use stwo_prover::core::backend::simd::SimdBackend; | ||
use stwo_prover::core::channel::{Blake2sChannel, Channel}; | ||
use stwo_prover::core::fields::m31::BaseField; | ||
use stwo_prover::core::fields::IntoSlice; | ||
use stwo_prover::core::prover::prove; | ||
use stwo_prover::core::vcs::blake2_hash::Blake2sHasher; | ||
use stwo_prover::core::vcs::hasher::Hasher; | ||
use stwo_prover::examples::poseidon::{gen_trace, PoseidonAir, PoseidonComponent}; | ||
|
||
pub fn simd_poseidon(c: &mut Criterion) { | ||
const LOG_N_ROWS: u32 = 15; | ||
let mut group = c.benchmark_group("poseidon2"); | ||
group.throughput(Throughput::Elements(1u64 << (LOG_N_ROWS + 3))); | ||
group.bench_function(format!("poseidon2 2^{} instances", LOG_N_ROWS + 3), |b| { | ||
b.iter(|| { | ||
let component = PoseidonComponent { | ||
log_n_instances: LOG_N_ROWS, | ||
}; | ||
let trace = gen_trace(component.log_column_size()); | ||
let channel = &mut Blake2sChannel::new(Blake2sHasher::hash(BaseField::into_slice(&[]))); | ||
let air = PoseidonAir { component }; | ||
prove::<SimdBackend>(&air, channel, trace).unwrap() | ||
}); | ||
}); | ||
} | ||
|
||
criterion_group!( | ||
name = bit_rev; | ||
config = Criterion::default().sample_size(10); | ||
targets = simd_poseidon); | ||
criterion_main!(bit_rev); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.