Skip to content
Snippets Groups Projects
Commit a0fa2f6e authored by HEME Clement's avatar HEME Clement
Browse files

format

parent 64fa85a6
Branches main
No related tags found
No related merge requests found
......@@ -61,7 +61,6 @@ impl<F: PrimeField> Shard<F> {
size: self.size,
}
}
}
/// compute the linear combination between an arbitrary number of [`Shard`]s
......@@ -105,7 +104,10 @@ pub fn recode_with_coeffs<F: PrimeField>(shards: &[Shard<F>], coeffs: &[F]) -> O
/// > **Note**
/// >
/// > this is a wrapper around [`recode_with_coeffs`].
pub fn recode_random<F: PrimeField>(shards: &[Shard<F>], rng: &mut impl RngCore) -> Result<Option<Shard<F>>, KomodoError> {
pub fn recode_random<F: PrimeField>(
shards: &[Shard<F>],
rng: &mut impl RngCore,
) -> Result<Option<Shard<F>>, KomodoError> {
for (i, (s1, s2)) in shards.iter().zip(shards.iter().skip(1)).enumerate() {
if s1.k != s2.k {
return Err(KomodoError::IncompatibleShards(format!(
......@@ -142,7 +144,10 @@ pub fn recode_random<F: PrimeField>(shards: &[Shard<F>], rng: &mut impl RngCore)
/// matrix. (see [`algebra::split_data_into_field_elements`])
///
/// This is the inverse of [`decode`].
pub fn encode<F: PrimeField>(data: &[u8], encoding_mat: &Matrix<F>) -> Result<Vec<Shard<F>>, KomodoError> {
pub fn encode<F: PrimeField>(
data: &[u8],
encoding_mat: &Matrix<F>,
) -> Result<Vec<Shard<F>>, KomodoError> {
let hash = Sha256::hash(data).to_vec();
let k = encoding_mat.height;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment