I'm programming using C++ and ntl library but using profile the code below is slow when the galois field $GF(2^q)$
have q>= 8
.
How I will be able to accelerate this code without use parallel programming.
void modKeyGenPrs(list<mat_GF2E>& Prs, list<mat_GF2E> Lst, mat_GF2E L1, mat_GF2E L2)
{
mat_GF2E L1_trans = transpose(L1);
for (int i=0; i<m; i++)
{
mat_GF2E sum;
sum.SetDims(n, n);
list<mat_GF2E>::const_iterator i_lst;
int j=0;
for( i_lst = Lst.begin(); i_lst != Lst.end(); i_lst++)
{
sum = sum + (L2[i][j]*(L1_trans*(*i_lst)*L1));
j = j + 1;
}
Prs.push_back(sum);
}
}