Add test of load_trusted_setup_test

not working yet: segfaults after the test runs
This commit is contained in:
Ramana Kumar 2022-09-20 23:43:38 +01:00
parent 2958210f67
commit 7e1dc4ddef
No known key found for this signature in database
GPG Key ID: ED471C788B900433
2 changed files with 22 additions and 1 deletions

View File

@ -1,5 +1,5 @@
TESTS = bls12_381_test das_extension_test c_kzg_alloc_test fft_common_test fft_fr_test fft_g1_test \
fk20_proofs_test kzg_proofs_test poly_test recover_test utility_test zero_poly_test
fk20_proofs_test kzg_proofs_test poly_test recover_test utility_test zero_poly_test c_kzg_4844_test
BENCH = fft_fr_bench fft_g1_bench recover_bench zero_poly_bench kzg_proofs_bench poly_bench poly_barycentric_bench compute_proof_lagrange_bench
TUNE = poly_mul_tune poly_div_tune
LIB_SRC = bls12_381.c c_kzg_alloc.c das_extension.c fft_common.c fft_fr.c fft_g1.c fk20_proofs.c kzg_proofs.c poly.c recover.c utility.c zero_poly.c

View File

@ -92,3 +92,24 @@ C_KZG_RET compute_kzg_proof(KZGProof *out, const PolynomialEvalForm *polynomial,
TRY(evaluate_polynomial_in_evaluation_form(&value, polynomial, z, s));
return compute_proof_single_l(out, polynomial, z, &value, s);
}
#ifdef KZGTEST
#include "../inc/acutest.h"
#include "test_util.h"
void load_trusted_setup_test(void) {
FILE *in = fopen("trusted_setup.txt", "r");
KZGSettings ks;
TEST_CHECK(C_KZG_OK == load_trusted_setup(&ks, in));
fclose(in);
free_kzg_settings(&ks);
}
TEST_LIST = {
{"C_KZG_4844_TEST", title},
{"load_trusted_setup_test", load_trusted_setup_test},
{NULL, NULL} /* zero record marks the end of the list */
};
#endif // KZGTEST