constructing a field from __int128
quwenjie opened this issue · comments
Wenjie commented
Is it possible to construct an Fr from __int128?
I see the function only supports from long long int, which is 64bits.
How can this be achieved? Is it possible?
MITSUNARI Shigeo commented
If your system is a little-endian architecture such as x64, then use setLittleEndianMod
.
__int128 v;
Fr x;
x.setLittleEndianMod((const uint8_t*)&v, sizeof(v));
Remark: v
must not be a negative integer.
Wenjie commented
Solved, thanks.