Skip to content
Snippets Groups Projects

add "long full recoding" test

Merged STEVAN Antoine requested to merge tests into main
1 file
+ 30
0
Compare changes
  • Side-by-side
  • Inline
+ 30
0
@@ -441,6 +441,36 @@ mod tests {
}
}
fn long_full_end_to_end_with_recoding_template<F: PrimeField>(
data: &[u8],
k: usize,
n: usize,
nb_steps: usize,
) {
let mut rng = ark_std::test_rng();
let test_case = format!("TEST | data: {} bytes, k: {}, n: {}", data.len(), k, n,);
let mut shards = encode::<F>(data, &Matrix::random(k, n, &mut rng))
.unwrap_or_else(|_| panic!("could not encode {test_case}"));
for _ in 0..nb_steps {
shards.push(recode_random(&shards, &mut rng).unwrap().unwrap());
}
try_all_decoding_combinations(data, &shards, k, n, &test_case, Some(100), vec![]);
}
#[test]
fn long_full_end_to_end_with_recoding() {
let bytes = bytes();
for (k, n) in [(3, 5), (5, 5), (8, 10)] {
for nb_steps in [10, 20, 100] {
long_full_end_to_end_with_recoding_template::<Fr>(&bytes, k, n, nb_steps);
}
}
}
fn create_fake_shard<F: PrimeField>(linear_combination: &[F], bytes: &[u8]) -> Shard<F> {
Shard {
k: 2,
Loading