Skip to content

Commit

Permalink
Merge pull request ethereum#27 from zama-ai/louis/add-cgo-destructors
Browse files Browse the repository at this point in the history
fix: added cgo destructors
  • Loading branch information
tremblaythibaultl authored Jan 23, 2023
2 parents 36ac51d + 99e81c5 commit 9223a49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ void encrypt_integer(BufferView cks_buff_view, uint64_t val, Buffer* ct_buf)
int ser_ok = shortint_serialize_ciphertext(ct, ct_buf);
assert(ser_ok == 0);
destroy_shortint_ciphertext(ct);
destroy_shortint_client_key(cks);
}
uint64_t decrypt_integer(BufferView cks_buf_view, BufferView ct_buf_view)
Expand All @@ -137,6 +140,9 @@ uint64_t decrypt_integer(BufferView cks_buf_view, BufferView ct_buf_view)
int ct_decrypt = shortint_bc_client_key_decrypt(cks, ct, &res);
assert(ct_decrypt == 0);
destroy_shortint_ciphertext(ct);
destroy_shortint_client_key(cks);
return res;
}
Expand Down

0 comments on commit 9223a49

Please sign in to comment.