26 lines
528 B
C
Raw Normal View History

2022-10-04 19:45:12 +01:00
#include <inttypes.h>
#include <stdio.h>
2022-10-04 22:40:18 +01:00
#include <stdlib.h>
#include "ckzg.h"
#include "c_kzg_4844.h"
2022-10-04 19:45:12 +01:00
2022-10-20 19:29:36 +01:00
KZGSettings* load_trusted_setup_wrap(const char* file) {
KZGSettings* out = malloc(sizeof(KZGSettings));
2022-10-20 19:29:36 +01:00
if (out == NULL) return NULL;
2022-10-20 19:29:36 +01:00
FILE* f = fopen(file, "r");
2022-10-20 19:29:36 +01:00
if (f == NULL) { free(out); return NULL; }
if (load_trusted_setup_file(out, f) != C_KZG_OK) { free(out); fclose(f); return NULL; }
2022-11-10 19:23:40 +03:00
fclose(f);
return out;
}
2022-10-20 19:29:36 +01:00
void free_trusted_setup_wrap(KZGSettings *s) {
free_trusted_setup(s);
free(s);
}