Skip to content
Snippets Groups Projects
Commit ec33aaca authored by j.detchart's avatar j.detchart
Browse files

Merge remote-tracking branch 'origin/fri' into fri-encode-opt

parents b0085fcb d00c4d35
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ thiserror = "1.0.50"
tracing = "0.1.40"
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 }
fri = { path = "../fri", optional = true}
dragoonfri = { version = "0.1.0", optional = true}
[workspace]
members = [
......@@ -39,13 +39,13 @@ ark-bls12-381 = "0.4.0"
clap = { version = "4.5.17", features = ["derive"] }
itertools = "0.13.0"
rand = "0.8.5"
fri_test_utils = { path = "../fri/test_utils" }
dragoonfri-test-utils = "0.1.0"
hex = "0.4.3"
[features]
kzg = ["dep:ark-poly-commit"]
aplonk = ["dep:ark-poly-commit"]
fri = ["dep:fri"]
fri = ["dep:dragoonfri"]
fs = []
[package.metadata.docs.rs]
......
......@@ -8,9 +8,9 @@ use rs_merkle::Hasher;
use std::time::Instant;
use ark_bls12_381::Fr as F_BLS12_381;
use fri_test_utils::Fq as F_128;
use dragoonfri_test_utils::Fq as F_128;
use fri::{
use dragoonfri::{
algorithms::{Blake3, Sha3_256, Sha3_512},
dynamic_folding_factor,
};
......
......@@ -3,10 +3,11 @@ use ark_poly::DenseUVPolynomial;
use ark_std::ops::Div;
use rs_merkle::algorithms::Sha256;
use rs_merkle::Hasher;
use std::rc::Rc;
use tracing::{debug, info};
use crate::{algebra, error::KomodoError, fec};
use fri::{
use dragoonfri::{
frida::{FridaBuilder, FridaCommitment},
interpolation::interpolate_polynomials,
rng::FriChallenger,
......@@ -21,7 +22,7 @@ use fri::{
pub struct Block<F: PrimeField, H: Hasher> {
pub shard: fec::Shard<F>,
pub proof: MerkleProof<H>,
pub commit: FridaCommitment<F, H>,
pub commit: Rc<FridaCommitment<F, H>>,
position: usize,
}
......@@ -57,7 +58,6 @@ pub fn encode<F: PrimeField>(
let hash = Sha256::hash(bytes).to_vec();
let n = evaluations[0].len();
let w = F::get_root_of_unity(n as u64).unwrap();
let t = transpose(evaluations);
......@@ -92,7 +92,7 @@ where
nb_queries,
);
let commit = FridaCommitment::from(builder.clone());
let commit = Rc::new(FridaCommitment::from(builder.clone()));
Ok(shards
.iter()
......@@ -163,11 +163,11 @@ mod tests {
use rs_merkle::Hasher;
use ark_bls12_381::Fr as F_BLS12_381;
use fri::{
use dragoonfri::{
algorithms::{Blake3, Sha3_256, Sha3_512},
dynamic_folding_factor,
};
use fri_test_utils::Fq as F_128;
use dragoonfri_test_utils::Fq as F_128;
use crate::error::KomodoError;
......@@ -190,10 +190,10 @@ mod tests {
for<'a, 'b> &'a P: Div<&'b P, Output = P>,
<H as rs_merkle::Hasher>::Hash: AsRef<[u8]> + CanonicalSerialize,
{
let evaluations = evaluate::<F>(&bytes, k, n);
let evaluations = evaluate::<F>(bytes, k, n);
let evals = evaluations.clone();
let shards = encode::<F>(&bytes, evals, k);
let shards = encode::<F>(bytes, evals, k);
let blocks = prove::<N, F, H, P>(evaluations, shards, bf, rpo, q).unwrap();
......@@ -216,7 +216,7 @@ mod tests {
#[test]
fn end_to_end() {
for (ff, k, n, bf, rpo, q) in [(2, 4, 8, 2, 1, 50)] {
for (ff, k, n, bf, rpo, q) in [(2, 4, 8, 2, 1, 50), (2, 4, 8, 2, 2, 50)] {
let _ = run!(ff, F_128, Blake3)(&bytes(), k, n, bf, rpo, q);
let _ = run!(ff, F_128, Sha3_256)(&bytes(), k, n, bf, rpo, q);
let _ = run!(ff, F_128, Sha3_512)(&bytes(), k, n, bf, rpo, q);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment