impl ConstantTimeSelect for BoxedMontyForm and BoxedMontyparams#794
impl ConstantTimeSelect for BoxedMontyForm and BoxedMontyparams#794dvdplm wants to merge 2 commits intoRustCrypto:masterfrom
Conversation
| let modulus = BoxedUint::ct_select(a.modulus().as_ref(), b.modulus().as_ref(), choice); | ||
| Self { | ||
| modulus: Odd::new(modulus).expect("both moduli are odd by construction"), |
There was a problem hiding this comment.
Is this working around the absence of a ConstantTimeSelect impl on Odd or something? It would be better to add one in that case IMO
There was a problem hiding this comment.
Fair, I can do that.
There was a problem hiding this comment.
Hmm, it goes a bit deeper than that.
There's a blanket-ish impl like so impl<T: ConditionallySelectable> ConstantTimeSelect for T (I guess as a "bridge" between the two traits?), which conflicts with impl<T: ConstantTimeSelect> ConstantTimeSelect for Odd<T>, so it looks like what this PR does is the least-worst option unless we rethink that blanket impl.
There was a problem hiding this comment.
We can potentially get rid of that blanket impl to make newtypes easier
|
We have migrated to |
As per the title, impl
ConstantTimeSelectforBoxedMontyFormandBoxedMontyParamsto better mirror the features of the stack-based equivalents.