refactor shard to use a simple vector
this MR uses a simpler Vec
of E::ScalarField
to represent a linear combination.
the rest of the crate has been fixed accordingly.
the goal is to let Arkworks do as much work as possible, fixing part of #2 (closed).
-
one_more
removed fromfield::split_data_into_field_elements
in 5531b31a -
one_less
removed fromfield::merge_elements_into_bytes
in 5761b784
examples
let's say we have at most
if a new shard
vec![alpha, beta, gamma]
Note
the right of the vector can be truncated to remove zero elements that are not part of the linear combination and don't add any extra useful information.
the left stays mandatory.
e.g. we create two times a linear combination with a single one set to
let mut linear_combination = Vec::new();
linear_combination.resize(i + 1, E::ScalarField::zero());
linear_combination[i] = E::ScalarField::one();
Merge request reports
Activity
assigned to @a.stevan
mentioned in issue #2 (closed)
requested review from @j.detchart
this MR should supersede !1 (closed)
mentioned in merge request !1 (closed)
mentioned in merge request !13 (merged)
added 14 commits
-
94b544af - 1 commit from branch
main
- 94b544af...04e06dbb - 3 earlier commits
- b4172276 - remove dead code
- ae3c3e17 - use `Vec::resize` instead of `Vec::fill`
- 9122d594 - fix the recoding test and `create_fake_shard`
- d47ebe97 - simplify the computation of `Shard.combine`
- 23cec5d0 - simplify `bytes` in `Shard.combine`
- 056f3b47 - make Clippy happy
- 77801736 - fix the linear_combination construction in `decoding_template`
- 7130cdad - fix
- 62c85c9d - remove `one_more` from `split_data_into_field_elements`
- 8382880a - remove `one_less` from `merge_elements_into_bytes`
Toggle commit list-
94b544af - 1 commit from branch
mentioned in commit ab7c61f2
mentioned in commit 4493022b