update the API
changelog
- rename the
encode
function toprove
and have it take shards instead of an encoding matrix: this is to isolate the "encoding" process inside thefec
module and leave the mainkomodo::prove
only compute the "proof", i.e. the commits of the data
from
fn encode<F, G, P>(
bytes: &[u8],
encoding_mat: &Matrix<F>,
powers: &Powers<F, G>,
) -> Result<Vec<Block<F, G>>, KomodoError>
to
fn prove<F, G, P>(
bytes: &[u8],
powers: &Powers<F, G>,
k: usize,
) -> Result<Vec<Commitment<F, G>>, KomodoError>
- rename
fec::Shard.combine
tofec::Shard.recode_with
to get rid of "combine" - rename
fec::recode
tofec::recode_with_coeffs
to show that this version takes a list of coefficients - rename
Block.commit
toBlock.proof
: "commit" should be "commits" and it's usually refered to as "proof" - split
prove
further intoprove
andbuild
:prove
now outputs aVec<Commitment<F>>
,build
simply takes aVec<Shard<F>>
and aVec<Commitment<F>>
and outputs aVec<Block<F>>
- add
fec::recode_random
that does the "shard" part ofrecode
to wrap aroundfec::recode_with_coeffs
- remove
R: RngCore
from the signature ofzk::setup
, to avoid having to pass a generic_
annotation everywherezk::setup
is used, same change has been applied torecode
and thegenerate_random_powers
inmain.rs
from
fn setup<R: RngCore, F: PrimeField, G: CurveGroup<ScalarField = F>>(
max_degree: usize,
rng: &mut R,
) -> Result<Powers<F, G>, KomodoError> {
to
fn setup<F: PrimeField, G: CurveGroup<ScalarField = F>>(
max_degree: usize,
rng: &mut impl RngCore,
) -> Result<Powers<F, G>, KomodoError> {
some extra minor changes
- remove some useles generic type annotations, e.g.
prove::<F, G, P>
can become a simplerprove
most of the time, i.e. when there is at least one generic annotation somewhere in the scope
Edited by STEVAN Antoine
Merge request reports
Activity
Filter activity
Please register or sign in to reply