3 ms·
> because constant-time exponentiation is theoretically 2x slower For uniform inputs at least they should be quite close to the same speed, in theory, for suff
by nullc 5y ago
> because constant-time exponentiation is theoretically 2x slower
For uniform inputs at least they should be quite close to the same speed, in theory, for sufficiently advanced implementations.
An intuition that helps see why this is so is that all but a vanishingly small fraction of uniform inputs have a size close to the maximum size. E.g. 1/2 are 1 bit smaller, 1/4 are 2 bit smaller... So inputs small enough to even cut off a single word will be rare enough that your benchmark will never even see them.