-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
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 toshl
/shr
methods are inconsistent:std
has them asu32
,Limb
asLimb
, andUint
asusize
. Perhaps we should at least matchLimb
andUint
. - (Bring the overflow behavior in bit shifts in sync with
std
#395) What shouldUint::shl_limb()
,shl_vartime()
, andshl()
(same forshr()
) do onshift
overflow? Currentlyshl_limb()
panics,shl_vartime()
returnsself
, andshl()
returns zero. Should probably do the same thing. See also Diverging from primitive behavior in overflowing shift #121 - (Make
inv_mod2k(_vartime)
return aCtChoice
#416) Shouldinv_mod2k()
returnCtChoice::FALSE
ifself
is even? Shouldinv_odd_mod()
returnCtChoice::FALSE
ifmodulus
is even? - (Normalize the usage of prefixes for method names #417) We need to make the usage of
ct_
andconst_
prefixes uniform. One prefix, eitherconst_
orct_
, should be used forconst fn
when there is a non-constfn
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) Shouldconst fn
division methods take aNonZero
-wrapped modulus? Shoulddiv_rem_limb_with_reciprocal()
take aCtOption
of the reciprocal, or the caller should do the mapping instead?
Metadata
Metadata
Assignees
Labels
No labels