Make FIELD_ELEMENTS_PER_BLOB compile-time configurable

This commit is contained in:
Ramana Kumar 2022-11-29 19:09:41 +00:00
parent 63451ea6eb
commit c9274d8f43
No known key found for this signature in database
GPG Key ID: ED471C788B900433
2 changed files with 3 additions and 2 deletions

View File

@ -8,11 +8,13 @@ endif
CLANG_EXECUTABLE=clang CLANG_EXECUTABLE=clang
BLST_BUILD_SCRIPT=./build.sh BLST_BUILD_SCRIPT=./build.sh
FIELD_ELEMENTS_PER_BLOB?=4096
all: c_kzg_4844.o lib all: c_kzg_4844.o lib
# If you change FIELD_ELEMENTS_PER_BLOB, remember to rm c_kzg_4844.o and make again
c_kzg_4844.o: c_kzg_4844.c Makefile c_kzg_4844.o: c_kzg_4844.c Makefile
${CLANG_EXECUTABLE} -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -c $< ${CLANG_EXECUTABLE} -Wall -I$(INCLUDE_DIRS) -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) $(CFLAGS) -c $<
# Will fail with "patch does not apply" if it has already been patched. # Will fail with "patch does not apply" if it has already been patched.
# Safe to ignore. # Safe to ignore.

View File

@ -36,7 +36,6 @@ extern "C" {
#define BYTES_PER_COMMITMENT 48 #define BYTES_PER_COMMITMENT 48
#define BYTES_PER_PROOF 48 #define BYTES_PER_PROOF 48
#define FIELD_ELEMENTS_PER_BLOB 4096
#define BYTES_PER_FIELD_ELEMENT 32 #define BYTES_PER_FIELD_ELEMENT 32
#define BYTES_PER_BLOB FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT #define BYTES_PER_BLOB FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT
static const uint8_t FIAT_SHAMIR_PROTOCOL_DOMAIN[] = {70, 83, 66, 76, 79, 66, 86, 69, 82, 73, 70, 89, 95, 86, 49, 95}; // "FSBLOBVERIFY_V1_" static const uint8_t FIAT_SHAMIR_PROTOCOL_DOMAIN[] = {70, 83, 66, 76, 79, 66, 86, 69, 82, 73, 70, 89, 95, 86, 49, 95}; // "FSBLOBVERIFY_V1_"