Currently every time we need an integer in Montgomery form, we use UintModLike::new passing it the modulus, effectively instantiating DynResidueParams every time. This is slow, in many cases we would be able to reuse them. To do that, it has to be an associated type in UintModLike, which means we will need a trait for it as well.
Currently every time we need an integer in Montgomery form, we use
UintModLike::new
passing it the modulus, effectively instantiatingDynResidueParams
every time. This is slow, in many cases we would be able to reuse them. To do that, it has to be an associated type inUintModLike
, which means we will need a trait for it as well.