diff --git a/min-src/c_kzg_4844.c b/min-src/c_kzg_4844.c index 5c40cd5..aebc3d7 100644 --- a/min-src/c_kzg_4844.c +++ b/min-src/c_kzg_4844.c @@ -833,15 +833,14 @@ void bytes_to_bls_field(BLSFieldElement *out, const uint8_t bytes[32]) { /** * Compute linear combinations of a sequence of vectors with some scalars */ -void vector_lincomb(fr_t out[], const fr_t *vectors, const fr_t *scalars, uint64_t n, uint64_t m) { - fr_t (*vectors_ptr)[n][m] = (fr_t (*)[n][m]) vectors; +void vector_lincomb(fr_t out[], const fr_t *vectors[], const fr_t *scalars, uint64_t n, uint64_t m) { fr_t tmp; uint64_t i, j; for (j = 0; j < m; j++) out[j] = fr_zero; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { - fr_mul(&tmp, &scalars[i], &((*vectors_ptr)[i][j])); + fr_mul(&tmp, &scalars[i], &vectors[i][j]); fr_add(&out[j], &out[j], &tmp); } } diff --git a/min-src/c_kzg_4844.h b/min-src/c_kzg_4844.h index 9b4b369..3158aa1 100644 --- a/min-src/c_kzg_4844.h +++ b/min-src/c_kzg_4844.h @@ -106,7 +106,7 @@ void free_trusted_setup(KZGSettings *s); void bytes_to_bls_field(BLSFieldElement *out, const uint8_t bytes[32]); -void vector_lincomb(BLSFieldElement out[], const BLSFieldElement *vectors, const BLSFieldElement *scalars, uint64_t num_vectors, uint64_t vector_len); +void vector_lincomb(BLSFieldElement out[], const BLSFieldElement *vectors[], const BLSFieldElement *scalars, uint64_t num_vectors, uint64_t vector_len); void g1_lincomb(KZGCommitment *out, const KZGCommitment points[], const BLSFieldElement scalars[], uint64_t num_points);