diff --git a/src/eip7594/cell.h b/src/eip7594/cell.h index 57ae04cc..07ac8df0 100644 --- a/src/eip7594/cell.h +++ b/src/eip7594/cell.h @@ -30,11 +30,8 @@ /** The number of bytes in a single cell. */ #define BYTES_PER_CELL (FIELD_ELEMENTS_PER_CELL * BYTES_PER_FIELD_ELEMENT) -/** The Reed-Solomon erasure coding expansion factor. */ -#define EXPANSION_FACTOR 2 - /** The number of field elements in an extended blob. */ -#define FIELD_ELEMENTS_PER_EXT_BLOB (FIELD_ELEMENTS_PER_BLOB * EXPANSION_FACTOR) +#define FIELD_ELEMENTS_PER_EXT_BLOB (FIELD_ELEMENTS_PER_BLOB * 2) /** The number of cells in a blob. */ #define CELLS_PER_BLOB (FIELD_ELEMENTS_PER_BLOB / FIELD_ELEMENTS_PER_CELL) diff --git a/src/eip7594/eip7594.c b/src/eip7594/eip7594.c index eeffcd7c..33b38222 100644 --- a/src/eip7594/eip7594.c +++ b/src/eip7594/eip7594.c @@ -176,7 +176,7 @@ C_KZG_RET compute_cells_and_kzg_proofs( * @param[in] num_cells The number of available cells provided * @param[in] s The trusted setup * - * @remark At least CELLS_PER_EXT_BLOB/EXPANSION_FACTOR cells must be provided. + * @remark At least 50% of CELLS_PER_EXT_BLOB cells must be provided. * @remark Recovery is faster if there are fewer missing cells. * @remark If recovered_proofs is NULL, they will not be recomputed. */ @@ -199,7 +199,7 @@ C_KZG_RET recover_cells_and_kzg_proofs( } /* Check if it's possible to recover */ - if (num_cells < CELLS_PER_EXT_BLOB / EXPANSION_FACTOR) { + if (num_cells < CELLS_PER_EXT_BLOB / 2) { ret = C_KZG_BADARGS; goto out; } diff --git a/src/eip7594/fk20.c b/src/eip7594/fk20.c index a8027500..15b007ae 100644 --- a/src/eip7594/fk20.c +++ b/src/eip7594/fk20.c @@ -73,7 +73,7 @@ C_KZG_RET compute_fk20_cell_proofs(g1_t *out, const fr_t *p, const KZGSettings * /* Initialize length variables */ k = FIELD_ELEMENTS_PER_BLOB / FIELD_ELEMENTS_PER_CELL; - k2 = k * EXPANSION_FACTOR; + k2 = k * 2; /* Do allocations */ ret = new_fr_array(&toeplitz_coeffs, k2);