diff --git a/nomos-da/kzgrs/src/common.rs b/nomos-da/kzgrs/src/common.rs index 918102aa..c0ac5623 100644 --- a/nomos-da/kzgrs/src/common.rs +++ b/nomos-da/kzgrs/src/common.rs @@ -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( data: &[u8], domain: GeneralEvaluationDomain, @@ -41,6 +43,10 @@ fn bytes_to_evaluations( ) } +/// 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( data: &[u8], domain: GeneralEvaluationDomain,