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
In RsaPrivateKey::from_components(), precompute() errors are ignored because it is claimed that the previous call to validate() guarantees it succeeds.
First of all, this is not the case - there can be bugs in precompute itself. I bumped into it while working on #506. In
let q_mod_p = BoxedMontyForm::new(q_mod_p, p_params.clone());
where I accidentally typed q_params instead of p_params, so the subsequent inversion failed.
Second, what are we even achieving by ignoring the errors there? Are there valid keys for which the values cannot be precomputed? from_components() already returns a Result, we might as well just forward the precompute() error to it.
The text was updated successfully, but these errors were encountered:
In
RsaPrivateKey::from_components()
,precompute()
errors are ignored because it is claimed that the previous call tovalidate()
guarantees it succeeds.First of all, this is not the case - there can be bugs in
precompute
itself. I bumped into it while working on #506. Inwhere I accidentally typed
q_params
instead ofp_params
, so the subsequent inversion failed.Second, what are we even achieving by ignoring the errors there? Are there valid keys for which the values cannot be precomputed?
from_components()
already returns aResult
, we might as well just forward theprecompute()
error to it.The text was updated successfully, but these errors were encountered: