Open andrewwhitehead opened 2 weeks ago
It looks like Uint::mul_mod
would also be 90% faster using this update and split_mut
/rem_wide_vartime
, and could accept an even modulus. The current implementation uses MontyParams::new_vartime
so it seems like it is vartime for the modulus, but maybe that should be renamed mul_mod_vartime
anyway? Accepting a &NonZero<Uint>
for the modulus would also simplify things.
Implements faster vartime division (vartime with the divisor only) for Uint based on Knuth's TAOCP volume 2, as outlined at https://janmr.com/blog/2014/04/basic-multiple-precision-long-division/
This does not address vartime division for BoxedUint or the other TODOs in https://github.com/RustCrypto/crypto-bigint/pull/511
Relevant benchmarks: