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
Rejection sampling means that `random_mod` is inherently variable-time,
and the current name violates the contract in the `README`:
> All functions contained in the crate are designed to execute in
> constant time unless explicitly specified otherwise (via a `*_vartime`
> name suffix).
This renames `random_mod` to `random_mod_vartime`, adding in deprecated
aliases at the old names for backwards-compatibility. It preserves the
`ConstantTimeLess` functionality for good measure and to not needlessly
increase the amount of timing information leaked.
Of course, `random_mod` leaks a pretty small amount of timing
information; by my reckoning, at worst an average 2 bits per call, and
approaching 0 as the modulus approaches `2^n-1`. So this is a bit of an
edge case; but I think the `vartime` naming here reduces surprise.
group.bench_function("random_mod, U1024, tiny high limb", |b| {
106
+
group.bench_function("random_mod_vartime, U1024, tiny high limb", |b| {
107
107
let hex_1024 = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000291A6B42D1C7D2A7184D13E36F65773BBEFB4FA7996101300D49F09962A361F00";
0 commit comments