Skip to content
Snippets Groups Projects
Verified Commit 7aca99fa authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

WIP: make it compile

parent 27ce308c
No related branches found
No related tags found
No related merge requests found
use ark_ff::PrimeField;
use ark_poly::DenseUVPolynomial;
use ark_std::{
ops::Div,
rand::{thread_rng, Rng},
};
use ark_std::ops::Div;
use rs_merkle::Hasher;
use tracing::{debug, info};
use crate::{algebra, error::KomodoError, fec};
use fri::{
frida::{FridaBuilder, FridaCommitment},
frida::{nth_evaluations, FridaBuilder, FridaCommitment},
rng::FriChallenger,
utils::{to_evaluations, HasherExt, MerkleProof},
};
......@@ -67,17 +64,22 @@ where
Ok(shards
.iter()
.map(|s| Block {
shard: s.clone(),
proof: builder.prove_shards(&[s
.map(|s| {
// TODO: compute true position
let position = 0;
let _pos = s
.linear_combination
.iter()
.filter(|x| !x.is_zero())
.cloned()
.collect::<Vec<F>>()
.first()
.unwrap()
.into()]),
commit: commit.clone(),
.unwrap();
Block {
shard: s.clone(),
proof: builder.prove_shards(&[position]),
commit: commit.clone(),
}
})
.collect())
}
......@@ -86,8 +88,6 @@ pub fn verify<const N: usize, F: PrimeField, H: Hasher, P>(
block: Block<F, H>,
k: usize,
domain_size: usize,
blowup_factor: usize,
remainder_plus_one: usize,
nb_queries: usize,
) -> Result<(), KomodoError>
where
......@@ -97,14 +97,14 @@ where
{
block
.commit
.verify::<N, _>(
FriChallenger::<H>::default(),
nb_queries,
nb_coeffs,
domain_size,
)
.verify::<N, _>(FriChallenger::<H>::default(), nb_queries, k, domain_size)
.unwrap();
// TODO: compute true position
let position = 0;
// TODO: compute true evaluations
let evaluations: Vec<Vec<F>> = vec![];
assert!(block.proof.verify(
block.commit.tree_root(),
&[position],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment