Skip to content

fix typos and improve algebra/semi_avid tests

STEVAN Antoine requested to merge pass into main

mainly fixes a few typos and improves algebra and semi_avid tests

changelog

  • fix some typos and notes in the documentation
  • test more cases for algebra::split_data_into_field_elements and algebra::merge_elements_into_bytes, more data lengths and more modulus respectively
  • remove a useless ::<Vec<_>> on a collect in fec
  • semi_avid::tests
    • refactor bls12-381 into a constant
    • write an "attack" function to alter a particular block, attack<F, G>(block: Block<F, G>, c: usize, base: u128, pow: u64) -> Block<F, G>
    • pass a list of attacks, i.e. attacks: Vec<(usize, usize, u128, u64)>, to verify_with_errors_template, use the same as the previous hardcoded one
    • pass a list of "recodings", i.e. recodings: Vec<Vec<usize>>, to verify_recoding_template and assert the number of blocks, e.g. vec![vec![2, 3], vec![3, 5]] means that recoding 2 and 3 together should verify, and same with 3 and 5, and also that there must be at least 6 blocks
    • pass a list of "recodings", i.e. recodings: Vec<(Vec<Vec<usize>>, bool)>, to end_to_end_with_recoding_template and assert the number of blocks and the number of source shards, e.g. vec![(vec![vec![0, 1], vec![2], vec![3]], true)] means that trying to decode with blocks 2, 3 and a recoded block from 0 and 1 should work, and also that there must be at least 4 blocks and at most 3 source shards
    • pass k and n to run_template
Edited by STEVAN Antoine

Merge request reports