Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
ae1156f
inital commit
z-tech Apr 30, 2024
1572f8e
chkpt
z-tech May 1, 2024
9338912
chkpt
z-tech May 2, 2024
cd80d87
checkpoint
z-tech May 2, 2024
25fb525
z-tech/tmp
z-tech May 2, 2024
a5d23c9
chkpt
z-tech May 2, 2024
2611be2
chkpt
z-tech May 16, 2024
67d5d96
z-tech: mapped FRI onto traits
z-tech Jun 2, 2024
00b16bb
z-tech: LowDegreeTest impl for FRI
z-tech Jun 2, 2024
2bf52dd
z-tech: LowDegreeTest impl for STIR chkpt
z-tech Jun 2, 2024
f8f56e5
debug stir verifier chkpt
z-tech Jun 2, 2024
9bfaa45
z-tech: stir fixed
z-tech Jun 4, 2024
09bc086
z-tech: chkpt
z-tech Jun 4, 2024
30f0683
z-tech: another chkpt
z-tech Jun 4, 2024
e9275f0
checkpoint
z-tech Jun 5, 2024
de22d2e
chkpt
z-tech Jun 5, 2024
8092528
chkpt
z-tech Jun 5, 2024
8ced8e5
final round proof chkpt
z-tech Jun 5, 2024
528aec2
checkpoint
z-tech Jun 6, 2024
26a92cf
chkpt
z-tech Jun 6, 2024
e7a8c09
chkpt
z-tech Jun 6, 2024
7a47686
rm commitment from verifier
z-tech Jun 6, 2024
8ec3e72
arg trait for directLDT
z-tech Jun 30, 2024
318e9d5
chkpt impl witness
z-tech Jul 1, 2024
51e5a99
impl witness FRI
z-tech Jul 1, 2024
2dab6cc
impl witness STIR
z-tech Jul 1, 2024
498ffa9
larger witness trait
z-tech Jul 2, 2024
ae627f8
chkpt
z-tech Jul 8, 2024
e2e1b78
chkpt 2
z-tech Jul 8, 2024
796e226
SingleWitness for LDTs
z-tech Jul 9, 2024
39293f2
chkpt
z-tech Jul 9, 2024
dede7c7
cleanup chkpt
z-tech Jul 9, 2024
8bfbbce
cleanup chkpt 2
z-tech Jul 9, 2024
0d5f75b
cleanup chkpt 3
z-tech Jul 9, 2024
8305477
rn to witness
z-tech Jul 9, 2024
e2c82f7
cleanup chkpt 4
z-tech Jul 9, 2024
019b35c
cleanup chkpt 5
z-tech Jul 9, 2024
f4db5a9
stopping pt
z-tech Jul 9, 2024
baadc10
chkpt
z-tech Jul 10, 2024
e726a92
simplify stir proof
z-tech Jul 10, 2024
7941a4f
cleanup chkpt 6
z-tech Jul 10, 2024
a51ec29
compute round chkpt
z-tech Jul 10, 2024
fc4672a
cleanup chkpt 7
z-tech Jul 10, 2024
de668ea
cleanup stopping point
z-tech Jul 10, 2024
fd09448
chkpt
z-tech Jul 16, 2024
dd3ff97
chkpt
z-tech Jul 16, 2024
d08e3cb
chkpt 2
z-tech Jul 16, 2024
5089d34
chkpt 3
z-tech Jul 16, 2024
9adf815
chkpt
z-tech Jul 16, 2024
672b00d
chkpt
z-tech Jul 16, 2024
9e30e57
chkpt
z-tech Jul 16, 2024
878d151
checkpoint
z-tech Jul 16, 2024
8d206c9
checkpoint
z-tech Jul 16, 2024
10af760
next_state
z-tech Jul 16, 2024
089bb55
final_round
z-tech Jul 16, 2024
3764943
final_round
z-tech Jul 16, 2024
6d84935
update_commitment
z-tech Jul 16, 2024
0edd97d
checkpoint
z-tech Jul 16, 2024
d531ba3
checkpoint
z-tech Jul 16, 2024
2ccf0c6
checkpoint
z-tech Jul 16, 2024
1a6bba3
ahhh, yes
z-tech Jul 16, 2024
ea0d925
rn round state to round and claim to statement
z-tech Jul 16, 2024
27eae02
stir config
z-tech Jul 16, 2024
892b139
chkpt
z-tech Jul 17, 2024
fce2d2c
chkpt
z-tech Jul 17, 2024
58e178d
chkpt
z-tech Jul 17, 2024
26c902e
chkpt
z-tech Jul 17, 2024
d459c73
chkpt
z-tech Jul 17, 2024
21a912f
chkpt
z-tech Jul 17, 2024
7bcbcab
chkpt
z-tech Jul 17, 2024
3083b8d
verifier_state
z-tech Jul 17, 2024
d96cbf1
chkpt
z-tech Jul 17, 2024
3d541dc
chkpt
z-tech Jul 17, 2024
a564761
chkpt
z-tech Jul 17, 2024
934f189
folded_evaluations
z-tech Jul 17, 2024
c5efbb8
folded_evaluations chkpt
z-tech Jul 17, 2024
fbc8327
move stuff into verifier state
z-tech Jul 17, 2024
c8d6f83
stopping point for the day
z-tech Jul 17, 2024
84afcc4
chkpt
z-tech Jul 18, 2024
9835db5
chkpt 2
z-tech Jul 18, 2024
40dc09d
chkpt
z-tech Jul 18, 2024
e4d6730
chkpt
z-tech Jul 18, 2024
1595d82
chkpt
z-tech Jul 18, 2024
e236979
chkpt
z-tech Jul 18, 2024
9656b33
verify
z-tech Jul 18, 2024
249bedb
cleanup
z-tech Jul 18, 2024
a49393e
chkpt
z-tech Jul 18, 2024
381d3ca
chkpt cleanup
z-tech Jul 18, 2024
da4fdcb
new branch commit
z-tech Jul 18, 2024
6caa96e
more cleanup
z-tech Jul 18, 2024
da351bc
patch crates io
z-tech Jul 23, 2024
3ed1289
multi_proof API
z-tech Jul 23, 2024
40895de
update comment
z-tech Jul 23, 2024
a66df7c
forgot to switch crypto-primitives back to git
z-tech Jul 24, 2024
3ec4311
no_std flag
z-tech Jul 24, 2024
599823c
chkpt
z-tech Jul 24, 2024
39af9e7
chkpt
z-tech Jul 24, 2024
8f556fc
update readme
z-tech Jul 24, 2024
9c3e93a
ds_store
z-tech Jul 24, 2024
7e28a73
ds_store banished
z-tech Jul 24, 2024
49e0224
nuke poseidon paramgen
z-tech Jul 25, 2024
90aaf15
derive clone for configs
z-tech Jul 25, 2024
78c341e
rm lazy_static
z-tech Jul 25, 2024
a4c17b0
no_std
z-tech Jul 25, 2024
39c0756
put no_std behind flags
z-tech Jul 25, 2024
2711204
chkpt
z-tech Jul 25, 2024
be1e41b
std feature
z-tech Jul 25, 2024
775f096
add profiles back
z-tech Jul 25, 2024
4e74c11
dedup challenges, squeeze range eq num of leaves in mt
z-tech Jul 25, 2024
1bcedea
move crypto folder to test_helpers
z-tech Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ jobs:
check_no_std:
name: Check no_std
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

.idea
# Editors
.idea
.vscode/**

# Mac OSX
.DS_Store
81 changes: 37 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,60 +1,53 @@
[package]
name = "ark-ldt"
version = "0.1.0"
version = "1.1.0"
authors = ["arkworks contributors"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
edition = "2021"

[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
ark-r1cs-std = { version = "^0.3.0", default-features = false}
ark-sponge = { version = "^0.3.0", default-features = false }
ark-poly = { version = "0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false, optional = true}
tracing = { version = "0.1", default-features = false, features = [ "attributes" ], optional = true}

[dev-dependencies]
ark-test-curves = { version = "^0.3.0", default-features = false, features = ["bls12_381_scalar_field", "mnt4_753_scalar_field"] }
ark-crypto-primitives = { version = "^0.4.0", default-features = false, features = ["merkle_tree", "sponge"] }
ark-ff = { version = "0.4", default-features = false }
ark-poly = { version = "0.4.2", default-features = false }
ark-std = { version = "^0.4.0", default-features = false }
ark-serialize = { version = "0.4", default-features = false }
ark-test-curves = { version = "0.4", default-features = false, features = ["bls12_381_curve"] }
itertools = { version = "0.13.0", default-features = false }
spin = { version = "0.9.8", default-features = false, features = ["once", "mutex", "spin_mutex"] }
hashbrown = { version = "0.14.5" }

[patch.crates-io]
ark-sponge = {git = "https://github.com/arkworks-rs/sponge"}
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std" }
ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
ark-std = { git = "https://github.com/arkworks-rs/std" }
ark-test-curves = { git = "https://github.com/arkworks-rs/algebra" }

[profile.release]
opt-level = 3
lto = "thin"
incremental = true
panic = 'abort'

[profile.bench]
opt-level = 3
debug = false
rpath = false
lto = "thin"
incremental = true
debug-assertions = false

[profile.dev]
opt-level = 0
panic = 'abort'

[profile.test]
opt-level = 3
lto = "thin"
incremental = true
debug-assertions = true
debug = true

[features]
default = ["std"]
std = ["ark-ff/std", "ark-std/std", "ark-relations/std", "ark-r1cs-std/std", "ark-sponge/std", "ark-poly/std"]
r1cs = ["ark-sponge/r1cs", "tracing", "ark-relations"]
std = [ "ark-crypto-primitives/std", "ark-ff/std", "ark-poly/std", "ark-serialize/std" ]

[profile.release]
opt-level = 3
lto = "thin"
incremental = true
panic = 'abort'

[profile.bench]
opt-level = 3
debug = false
rpath = false
lto = "thin"
incremental = true
debug-assertions = false

[profile.dev]
opt-level = 0
panic = 'abort'

[profile.test]
opt-level = 3
lto = "thin"
incremental = true
debug-assertions = true
debug = true
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This implementation is NOT ready for production use.

## Overview

A (univariate) low-degree test is an IOP that checks that a given function is close to a (univariate) polynomial of low degree. This library provides two LDTs: the **direct low-degree test** and the **FRI Protocol**. The library also comes with R1CS constraints for the LDT verifiers. Enable `r1cs` feature to use those constraints.
A (univariate) low-degree test is an IOP that checks that a given function is close to a (univariate) polynomial of low degree. This library provides three LDTs: **Direct**, **FRI**, and **STIR**.

## Build Guide

Expand Down Expand Up @@ -44,8 +44,11 @@ To use this library, you need to add the following to your `Cargo.toml`. Note th
ark-ldt = {git = "https://github.com/arkworks-rs/ldt", branch="main", default-features = false}

[patch.crates-io]
ark-sponge = {git = "https://github.com/arkworks-rs/sponge"}
ark-r1cs-std = {git = "https://github.com/arkworks-rs/r1cs-std", branch = "master"}
ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
ark-test-curves = { git = "https://github.com/arkworks-rs/algebra" }
```

## License
Expand All @@ -62,10 +65,14 @@ conditions.
## Reference papers

[Fractal: Post-Quantum and Transparent Recursive Proofs from Holography][cos20]<br>
Alessandro Chiesa, Dev Ojha, Nicholas Spooner
Alessandro Chiesa, Dev Ojha, Nicholas Spooner

[Fast Reed-Solomon Interactive Oracle Proofs of Proximity][bbhr17]<br>
[FRI: Fast Reed-Solomon Interactive Oracle Proofs of Proximity][bbhr17]<br>
Eli Ben-Sasson, Iddo Bentov, Ynon Horesh, Michael Riabzev

[STIR: Reed–Solomon Proximity Testing with Fewer Queries][acfy24]<br>
Gal Arnon, Alessandro Chiesa, Giacomo Fenzi, Eylon Yogev

[cos20]: https://eprint.iacr.org/2019/1076
[bbhr17]: https://eccc.weizmann.ac.il/report/2017/134/
[acfy24]: https://eprint.iacr.org/2024/390
31 changes: 31 additions & 0 deletions src/direct/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use ark_crypto_primitives::{
merkle_tree::{Config as MerkleConfig, LeafParam, TwoToOneParam},
sponge::CryptographicSponge,
};

#[derive(Clone)]
pub struct DirectConfig<M: MerkleConfig, S: CryptographicSponge> {
pub degree: usize,
pub num_challenges: usize,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe num_queries?

pub merkle_leaf_hash_param: LeafParam<M>,
pub merkle_two_to_one_param: TwoToOneParam<M>,
pub sponge_config: S::Config,
}

impl<M: MerkleConfig, S: CryptographicSponge> DirectConfig<M, S> {
pub fn new(
degree: usize,
num_challenges: usize,
merkle_leaf_hash_param: LeafParam<M>,
merkle_two_to_one_param: TwoToOneParam<M>,
sponge_config: S::Config,
) -> Self {
DirectConfig {
degree,
num_challenges,
merkle_leaf_hash_param,
merkle_two_to_one_param,
sponge_config,
}
}
}
40 changes: 0 additions & 40 deletions src/direct/constraints.rs

This file was deleted.

50 changes: 50 additions & 0 deletions src/direct/ldt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
use ark_crypto_primitives::{
merkle_tree::{Config as MerkleConfig, MultiPath},
sponge::{Absorb, CryptographicSponge},
};
use ark_ff::FftField;
use ark_std::{marker::PhantomData, vec::Vec};

use crate::{
direct::{config::DirectConfig, prover::DirectProver, verifier::DirectVerifier},
ldt::{LowDegreeTest, Prover, Verifier},
witness::Witness,
};

use super::proof::DirectProof;

pub struct DirectLDT<F: FftField, M: MerkleConfig, S: CryptographicSponge, W: Witness<F, M>> {
_field: PhantomData<F>,
_merkle_config: PhantomData<M>,
_sponge: PhantomData<S>,
_witness: PhantomData<W>,
}
impl<F, M, S, W> LowDegreeTest<F> for DirectLDT<F, M, S, W>
where
F: FftField,
M: MerkleConfig<Leaf = Vec<F>> + Clone,
M::InnerDigest: Absorb,
S: CryptographicSponge,
S::Config: Clone,
W: Witness<
F,
M,
MerkleConfig = M,
ChallengeAnswers = MultiPath<M>,
CommittedValues = Vec<Vec<F>>,
Challenges = Vec<usize>,
> + Clone,
W::ChallengeAnswers: Clone,
{
type LDTConfig = DirectConfig<M, S>;
type Proof = DirectProof<F, M, S>;
type Prover = DirectProver<F, M, S, W>;
type Verifier = DirectVerifier<F, M, S, W>;

fn new(config: Self::LDTConfig) -> (Self::Prover, Self::Verifier) {
(
Self::Prover::new(config.clone()),
Self::Verifier::new(config),
)
}
}
Loading