libff
libff copied to clipboard
Change fp_model's mulreduce to not check limbsize in run-time
The multiplication function in a finite field currently checks in runtime what the limb size is, when its instead known at compile time as its a template parameter.
Line where we check this: https://github.com/scipr-lab/libff/blob/52d77c3ee213b0f1fb49402374f1cf099bb972dd/libff/algebra/fields/fp.tcc#L27
I don't know if this is optimized out by the compiler on all platforms, but if it isn't this is potentially quite bad for the instruction cache (in addition to slight overhead due to the branch-predicted conditional)