I need to compute a multiplication of two integers a, b modulo a big prime P. Those integers and the prime fit in a UINT256, but to compute the result of a*b mod P I need to compute a*b which doesn't fit in a UINT256. Would it be possible to add another method perfect_mul (or another name) which gives the UINT512 result in an efficient way or should I use UINT512 everywhere?
Hello,
I need to compute a multiplication of two integers a, b modulo a big prime P. Those integers and the prime fit in a UINT256, but to compute the result of
a*b mod P
I need to computea*b
which doesn't fit in a UINT256. Would it be possible to add another methodperfect_mul
(or another name) which gives the UINT512 result in an efficient way or should I use UINT512 everywhere?Thanks for your work, Thomas