Commit e9eb5df6 authored by Maxim Onciul's avatar Maxim Onciul
Browse files

instead of cutting off values, pad zeros

parent 9136b16f
......@@ -351,9 +351,12 @@ Coding::foldToBytes(vector<uint8_t>* input, unsigned int output_length)
cout << endl;
throw new runtime_error("Input size doesn't match.");
}
if( input->size() % 4 != 0)
if( input->size() % 8 != 0)
{
input->resize(input->size() - input->size() % 4);
for(uint8_t i = 0; i < input->size() % 8; i++)
{
input->push_back(0);
}
}
gf* output = (gf*) malloc(output_length * sizeof(gf));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment