Skip to content

Commit 49b54aa

Browse files
authored
Add "vartime" suffix to Monty::new_params() (#525)
1 parent 42ea8e6 commit 49b54aa

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/modular/boxed_monty_form.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ impl Monty for BoxedMontyForm {
240240
type Integer = BoxedUint;
241241
type Params = BoxedMontyParams;
242242

243-
fn new_params(modulus: Odd<Self::Integer>) -> Self::Params {
244-
BoxedMontyParams::new(modulus)
243+
fn new_params_vartime(modulus: Odd<Self::Integer>) -> Self::Params {
244+
BoxedMontyParams::new_vartime(modulus)
245245
}
246246

247247
fn new(value: Self::Integer, params: Self::Params) -> Self {

src/modular/monty_form.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<const LIMBS: usize> Monty for MontyForm<LIMBS> {
234234
type Integer = Uint<LIMBS>;
235235
type Params = MontyParams<LIMBS>;
236236

237-
fn new_params(modulus: Odd<Self::Integer>) -> Self::Params {
237+
fn new_params_vartime(modulus: Odd<Self::Integer>) -> Self::Params {
238238
MontyParams::new_vartime(modulus)
239239
}
240240

src/traits.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,9 @@ pub trait Monty:
778778
/// The precomputed data needed for this representation.
779779
type Params: 'static + Clone + Debug + Eq + Sized + Send + Sync;
780780

781-
/// Create the precomputed data for Montgomery representation of integers modulo `modulus`.
782-
fn new_params(modulus: Odd<Self::Integer>) -> Self::Params;
781+
/// Create the precomputed data for Montgomery representation of integers modulo `modulus`,
782+
/// variable time in `modulus`.
783+
fn new_params_vartime(modulus: Odd<Self::Integer>) -> Self::Params;
783784

784785
/// Convert the value into the representation using precomputed data.
785786
fn new(value: Self::Integer, params: Self::Params) -> Self;

0 commit comments

Comments
 (0)