add FRI (dragoon/komodo!175)
FRI protocol from [`dragoon/fri`](https://gitlab.isae-supaero.fr/dragoon/fri) ## changelog - add binary assets to be used as inputs - add `fri` and `fri_test_utils` as local dependencies until [`dragoon/fri`](https://gitlab.isae-supaero.fr/dragoon/fri) becomes public - add `fri` feature and module (see section below for the public definitions) - fix bug in 32bd6566 - bump Rust in e7a2c244 - add a versatile example - add Nushell pipeline to run benchmarks and plot results - add some tests ## `fri` module API ```rust struct Block<F: PrimeField, H: Hasher> ``` ```rust fn evaluate<F: PrimeField>(bytes: &[u8], k: usize, n: usize) -> Vec<Vec<F>> ``` ```rust fn encode<F: PrimeField>( bytes: &[u8], evaluations: Vec<Vec<F>>, k: usize, ) -> Vec<fec::Shard<F>> ``` ```rust fn prove<const N: usize, F: PrimeField, H: Hasher, P>( evaluations: Vec<Vec<F>>, shards: Vec<fec::Shard<F>>, blowup_factor: usize, remainder_plus_one: usize, nb_queries: usize, ) -> Result<Vec<Block<F, H>>, KomodoError> where P: DenseUVPolynomial<F>, for<'a, 'b> &'a P: Div<&'b P, Output = P>, <H as rs_merkle::Hasher>::Hash: AsRef<[u8]>, ``` ```rust fn verify<const N: usize, F: PrimeField, H: Hasher, P>( block: Block<F, H>, domain_size: usize, nb_queries: usize, ) -> Result<(), KomodoError> where P: DenseUVPolynomial<F>, for<'a, 'b> &'a P: Div<&'b P, Output = P>, <H as rs_merkle::Hasher>::Hash: AsRef<[u8]>, ``` ```rust fn decode<F: PrimeField, H: Hasher>(blocks: Vec<Block<F, H>>, n: usize) -> Vec<u8> ``` ## results ### times      ### sizes    
Showing
- .gitignore 1 addition, 0 deletions.gitignore
- Cargo.toml 9 additions, 0 deletionsCargo.toml
- assets/128_4096_3.bin 0 additions, 0 deletionsassets/128_4096_3.bin
- assets/128_4_3.bin 0 additions, 0 deletionsassets/128_4_3.bin
- benchmarks/README.md 50 additions, 0 deletionsbenchmarks/README.md
- benchmarks/mod.nu 1 addition, 0 deletionsbenchmarks/mod.nu
- benchmarks/nu-lib/fri/mod.nu 2 additions, 0 deletionsbenchmarks/nu-lib/fri/mod.nu
- benchmarks/nu-lib/fri/plot.nu 106 additions, 0 deletionsbenchmarks/nu-lib/fri/plot.nu
- benchmarks/nu-lib/fri/run.nu 78 additions, 0 deletionsbenchmarks/nu-lib/fri/run.nu
- benchmarks/nu-lib/utils/plot.nu 1 addition, 0 deletionsbenchmarks/nu-lib/utils/plot.nu
- benchmarks/params/fri.nu 16 additions, 0 deletionsbenchmarks/params/fri.nu
- examples/fri.rs 214 additions, 0 deletionsexamples/fri.rs
- rust-toolchain.toml 1 addition, 1 deletionrust-toolchain.toml
- src/algebra/mod.rs 1 addition, 1 deletionsrc/algebra/mod.rs
- src/fri.rs 228 additions, 0 deletionssrc/fri.rs
- src/lib.rs 2 additions, 0 deletionssrc/lib.rs
... | @@ -25,6 +25,7 @@ thiserror = "1.0.50" | ... | @@ -25,6 +25,7 @@ thiserror = "1.0.50" |
tracing = "0.1.40" | tracing = "0.1.40" | ||
tracing-subscriber = "0.3.17" | tracing-subscriber = "0.3.17" | ||
ark-poly-commit = { git = "https://gitlab.isae-supaero.fr/a.stevan/poly-commit", version = "0.4.0", rev = "19fc0d4", optional = true } | ark-poly-commit = { git = "https://gitlab.isae-supaero.fr/a.stevan/poly-commit", version = "0.4.0", rev = "19fc0d4", optional = true } | ||
dragoonfri = { version = "0.1.0", optional = true} | |||
[workspace] | [workspace] | ||
members = [ | members = [ | ||
... | @@ -35,12 +36,16 @@ members = [ | ... | @@ -35,12 +36,16 @@ members = [ |
[dev-dependencies] | [dev-dependencies] | ||
ark-bls12-381 = "0.4.0" | ark-bls12-381 = "0.4.0" | ||
clap = { version = "4.5.17", features = ["derive"] } | |||
itertools = "0.13.0" | itertools = "0.13.0" | ||
rand = "0.8.5" | rand = "0.8.5" | ||
dragoonfri-test-utils = "0.1.0" | |||
hex = "0.4.3" | |||
[features] | [features] | ||
kzg = ["dep:ark-poly-commit"] | kzg = ["dep:ark-poly-commit"] | ||
aplonk = ["dep:ark-poly-commit"] | aplonk = ["dep:ark-poly-commit"] | ||
fri = ["dep:dragoonfri"] | |||
fs = [] | fs = [] | ||
[package.metadata.docs.rs] | [package.metadata.docs.rs] | ||
... | @@ -53,3 +58,7 @@ required-features = ["kzg"] | ... | @@ -53,3 +58,7 @@ required-features = ["kzg"] |
[[example]] | [[example]] | ||
name = "aplonk" | name = "aplonk" | ||
required-features = ["aplonk"] | required-features = ["aplonk"] | ||
[[example]] | |||
name = "fri" | |||
required-features = ["fri"] |
assets/128_4096_3.bin
0 → 100644
File added
assets/128_4_3.bin
0 → 100644
File added
benchmarks/nu-lib/fri/mod.nu
0 → 100644
benchmarks/nu-lib/fri/plot.nu
0 → 100644
benchmarks/nu-lib/fri/run.nu
0 → 100644
benchmarks/params/fri.nu
0 → 100644
examples/fri.rs
0 → 100644
src/fri.rs
0 → 100644