Skip to content

BGV scheme multiplication operation triggers a heap-buffer-overflow. #517

@Wowblk

Description

@Wowblk

I found a bug that causes a heap-buffer-overflow 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions