Skip to content
Snippets Groups Projects

Draft: Doc joss

Closed PERENNOU Tanguy requested to merge doc-joss into main
2 files
+ 8
8
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 7
7
@@ -68,7 +68,7 @@ impl<F: PrimeField> Shard<F> {
///
/// // recode shards #3 and #4: 3 * s3 + 5 * s4
/// let recoded_34 = shards[3].recode_with(alpha, &shards[4], beta);
///
///
/// assert_eq!(recoded_34.k, 3);
/// assert_eq!(
/// recoded_34.linear_combination,
@@ -134,9 +134,9 @@ impl<F: PrimeField> Shard<F> {
/// // recode with shards #0, #3 and #4: 3 * s0 + 5 * s3 + 7 * s4
/// let shards_subset = [shards[0].clone(), shards[3].clone(), shards[4].clone()];
/// let coeffs = [Fr::from(3), Fr::from(5), Fr::from(7)];
///
///
/// let recoded_034 = recode_with_coeffs(&shards_subset, &coeffs).unwrap();
///
///
/// assert_eq!(recoded_034.k, 3);
/// assert_eq!(
/// recoded_034.linear_combination,
@@ -170,7 +170,7 @@ pub fn recode_with_coeffs<F: PrimeField>(shards: &[Shard<F>], coeffs: &[F]) -> O
/// > **Note**: this is a wrapper around [`recode_with_coeffs`].
///
/// # Example
///
///
/// ```rust
/// use ark_bls12_381::Fr;
/// use komodo::fec::{encode, recode_random};
@@ -182,14 +182,14 @@ pub fn recode_with_coeffs<F: PrimeField>(shards: &[Shard<F>], coeffs: &[F]) -> O
/// let encoding_mat = Matrix::vandermonde(&points, 3).unwrap();
/// let shards = encode::<Fr>(data, &encoding_mat).unwrap();
/// let rng = &mut ark_std::test_rng();
///
///
/// // recode with random coefficients
/// let recoded = recode_random::<Fr>(&shards, rng).unwrap().unwrap();
///
///
/// assert_eq!(recoded.k, 3);
/// assert_eq!(recoded.hash, shards[0].hash);
/// ```
///
///
/// # Errors
/// - if the shards do not have the same `k`, `hash` or `size`: [`KomodoError::IncompatibleShards`]
pub fn recode_random<F: PrimeField>(
Loading