Fix free_trusted_setup

This commit is contained in:
Ramana Kumar 2022-10-05 21:33:16 +01:00
parent ba44d9e35c
commit 534533061a
No known key found for this signature in database
GPG Key ID: ED471C788B900433
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,11 @@ KZGSettings* load_trusted_setup_wrap(const char* file) {
return out; return out;
} }
void free_trusted_setup_wrap(KZGSettings* s) {
free_trusted_setup(s);
free(s);
}
BLSFieldElement* bytes_to_bls_field_wrap(const uint8_t bytes[]) { BLSFieldElement* bytes_to_bls_field_wrap(const uint8_t bytes[]) {
BLSFieldElement* out = (BLSFieldElement*)malloc(sizeof(BLSFieldElement)); BLSFieldElement* out = (BLSFieldElement*)malloc(sizeof(BLSFieldElement));
bytes_to_bls_field(out, bytes); bytes_to_bls_field(out, bytes);

View File

@ -13,7 +13,7 @@ class ckzg {
[DllImport("ckzg.dll", EntryPoint="load_trusted_setup_wrap")] [DllImport("ckzg.dll", EntryPoint="load_trusted_setup_wrap")]
public static extern IntPtr load_trusted_setup(string filename); public static extern IntPtr load_trusted_setup(string filename);
[DllImport("ckzg.dll", EntryPoint="free_trusted_setup")] [DllImport("ckzg.dll", EntryPoint="free_trusted_setup_wrap")]
public static extern void free_trusted_setup(IntPtr ts); public static extern void free_trusted_setup(IntPtr ts);
[DllImport("ckzg.dll", EntryPoint="free")] [DllImport("ckzg.dll", EntryPoint="free")]