You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a lot of small stuff so I decided to put them in one issue:
(Make bit ops use u32 for shifts #373) The types of the arguments to shl/shr methods are inconsistent: std has them as u32, Limb as Limb, and Uint as usize. Perhaps we should at least match Limb and Uint.
(Normalize the usage of prefixes for method names #417) We need to make the usage of ct_ and const_ prefixes uniform. One prefix, either const_ or ct_, should be used for const fn when there is a non-const fn with the same functionality (otherwise no prefix needed); ct_ meaning "constant-time" really shouldn't be used at all because that's the default. uint/div.rs is especially bad in this respect.
(Make division methods take NonZero-wrapped divisors #419) Should const fn division methods take a NonZero-wrapped modulus? Should div_rem_limb_with_reciprocal() take a CtOption of the reciprocal, or the caller should do the mapping instead?
There's a lot of small stuff so I decided to put them in one issue:
u32for shifts #373) The types of the arguments toshl/shrmethods are inconsistent:stdhas them asu32,LimbasLimb, andUintasusize. Perhaps we should at least matchLimbandUint.std#395) What shouldUint::shl_limb(),shl_vartime(), andshl()(same forshr()) do onshiftoverflow? Currentlyshl_limb()panics,shl_vartime()returnsself, andshl()returns zero. Should probably do the same thing. See also Diverging from primitive behavior in overflowing shift #121inv_mod2k(_vartime)return aCtChoice#416) Shouldinv_mod2k()returnCtChoice::FALSEifselfis even? Shouldinv_odd_mod()returnCtChoice::FALSEifmodulusis even?ct_andconst_prefixes uniform. One prefix, eitherconst_orct_, should be used forconst fnwhen there is a non-constfnwith the same functionality (otherwise no prefix needed);ct_meaning "constant-time" really shouldn't be used at all because that's the default.uint/div.rsis especially bad in this respect.NonZero-wrapped divisors #419) Shouldconst fndivision methods take aNonZero-wrapped modulus? Shoulddiv_rem_limb_with_reciprocal()take aCtOptionof the reciprocal, or the caller should do the mapping instead?