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

fix example

parent deb147b4
No related branches found
No related tags found
No related merge requests found
use ark_bls12_381::Fr;
use ark_ff::PrimeField;
use ark_poly::univariate::DensePolynomial;
use ark_poly::DenseUVPolynomial;
......@@ -6,6 +5,7 @@ use ark_std::ops::Div;
use rs_merkle::Hasher;
use fri::algorithms::Blake3;
use fri_test_utils::Fq;
use komodo::error::KomodoError;
fn run<const N: usize, F: PrimeField, H: Hasher, P>(
......@@ -21,8 +21,9 @@ where
for<'a, 'b> &'a P: Div<&'b P, Output = P>,
<H as rs_merkle::Hasher>::Hash: AsRef<[u8]>,
{
let shards = komodo::fri::encode::<F>(&bytes, k, n);
let blocks = komodo::fri::prove::<N, F, H, P>(shards, bf, rpo, q).unwrap();
let evaluations = komodo::fri::evaluate::<F>(&bytes, k, n);
let shards = komodo::fri::encode::<F>(&bytes, evaluations.clone(), k, n);
let blocks = komodo::fri::prove::<N, F, H, P>(evaluations, shards, bf, rpo, q).unwrap();
for block in blocks {
komodo::fri::verify::<N, F, H, P>(block, n, q).unwrap();
......@@ -32,8 +33,8 @@ where
}
fn main() {
let bytes = include_bytes!("../assets/dragoon_133x133.png").to_vec();
let bytes = include_bytes!("../assets/128_4096_3.bin").to_vec();
eprintln!("loaded {} bytes of data", bytes.len());
run::<2, Fr, Blake3, DensePolynomial<Fr>>(&bytes, 4, 16, 1, 1, 50).unwrap();
run::<2, Fq, Blake3, DensePolynomial<Fq>>(&bytes, 4096, 4096 * 2, 2, 1, 32).unwrap();
}
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