Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak caused by key generation.(Bug) #518

Open
Wowblk opened this issue Jan 15, 2025 · 0 comments
Open

Memory leak caused by key generation.(Bug) #518

Wowblk opened this issue Jan 15, 2025 · 0 comments

Comments

@Wowblk
Copy link

Wowblk commented Jan 15, 2025

I found a bug that causes a memory leak in BGV mode. The MWE is as follows:

#include <iostream>
#include <helib/helib.h>
#include <helib/binaryArith.h>
#include <helib/intraSlot.h>
int main(int argc, char* argv[])
{
 long p = 2;
 long m = 4095;
 long r = 1;
 long bits = 500;
 long c = 2;
 std::vector<long> mvec = {7, 5, 9, 13};
 std::vector<long> gens = {2341, 3277, 911};
 std::vector<long> ords = {6, 4, 6};
 helib::Context context = helib::ContextBuilder<helib::BGV>()
 .m(m)
.p(p)
.r(r)
.gens(gens)
.ords(ords)
 .bits(bits)
 .c(c)
.bootstrappable(true)
.mvec(mvec)
.build();
 context.printout();
 std::cout << std::endl;
 std::cout << "Security: " << context.securityLevel() << std::endl;
 helib::SecKey secret_key(context);
 secret_key.GenSecKey();
 return 0;
}

image

Thank you for taking the time to look into this issue. Please let us know if any further details or clarification would be helpful!
Best regards,
wowblk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant