1
0
mirror of synced 2025-01-12 08:44:21 +00:00

Add comments

This commit is contained in:
Daniel Sanchez Quiros 2024-04-01 18:26:00 +02:00
parent ff52bd67ee
commit 769c1d40ed

View File

@ -21,6 +21,8 @@ pub enum KzgRsError {
ChunkSizeTooBig(usize),
}
/// Transform chunks of bytes (of size `CHUNK_SIZE`) into `Fr` which are considered evaluations of a
/// polynomial.
fn bytes_to_evaluations<const CHUNK_SIZE: usize>(
data: &[u8],
domain: GeneralEvaluationDomain<Fr>,
@ -41,6 +43,10 @@ fn bytes_to_evaluations<const CHUNK_SIZE: usize>(
)
}
/// Transform chunks of bytes (of size `CHUNK_SIZE`) into `Fr` which are considered evaluations of a
/// polynomial. Then use FFT to transform that polynomial into coefficient form.
/// `CHUNK_SIZE` needs to be 31 (bytes) or less, otherwise it cannot be encoded.
/// The input data need to be padded, so it fits in a len modulus of `CHUNK_SIZE`.
pub fn bytes_to_polynomial<const CHUNK_SIZE: usize>(
data: &[u8],
domain: GeneralEvaluationDomain<Fr>,