I'm trying to implement some math function like My_AddMod, My_SubMod, My_MulMod, and put the result back to vec_long& - type data result.
When I'm calling both function of mine and NTL and using the result of NTL like:
long tmpt_My = My_AddMod(long a, long b, long n); //(a+b)%n
long tmpt_NTL = AddMod(long a, long b, long n); //function from NTL
vec_long& result[i] = tmpt_NTL; //choosing result from NTL_function
It worked good and fast, however, if I use the result of My_function:
long tmpt_My = My_AddMod(long a, long b, long n); //(a+b)%n
long tmpt_NTL = AddMod(long a, long b, long n); //function from NTL
vec_long& result[i] = tmpt_My; //choosing result from My_function
It worked good as well but caused a large latency in the code.
When printing out the value and data-type of tmpt_NTL
and tmpt_My
, they are the same value and data-type long
.
Since both functions are called(so it seems to have nothing to do with My_function execution time) and they generate the same value, what is the reason of causing a large latency or how can I fix it?