cryptobiu / libscapi

Comprehensive Open Source Library for Secure Multiparty Computation
MIT License
180 stars 66 forks source link

memory leaks when running the dlog sample #48

Closed nitincic closed 5 years ago

nitincic commented 6 years ago

I am using the DamgardJurik encryption scheme and I seemed to have noticed garbage values in the output now and then. I ended up checking for memory leaks and it seemed like there were quite a few of them. Eventually, I ended up running the samples and there were a number of memory leaks in the dlog and sha1 samples, which makes me wonder if there's something broken in the original codebase or is it my implementation which is problematic.

Could someone please verify this?

P.S. I had used Valgrind for checking errors

liorko87 commented 5 years ago

@nitincic can you please share your valgrind output? When I'm running the dlog example at my machine, I'm getting clean output:

genrator value is:              242025984687038065699139962787762627594
exponentiate value is:          101761581662270382936288038735490048497
exponentiation result is:       302429943863322102313597447213229600003
random element chosen is:       206953412756268268138815042415875107641
element multplied by expresult: 152008820652308866739117560032816578275
moriyaw commented 5 years ago

Hi, I fixed the dlog leakage. However, it seems like the leakage in the sha example is an Openssl's problem.