Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Jan 21, 2026

I find myself personally never using MontyForm (though I guess I might if we try no_alloc in rsa), and it's kind of bothered me that it has such a choice name while things I am using like Monty and GenericMontyParams seem to have somewhat suboptimal names.

This commit renames MontyForm to FixedMontyForm which gives it more of an equal position to the other two and unlocks the names MontyForm and MontyParams for functionality which is common to all of the different implementations.

It also renames the following:

  • MontyParams => FixedMontyParams: this follows from above, these are the params that go with FixedMontyForm (NOTE: they're also used by ConstMontyForm, so not sure if this rename will make that more confusing or not)
  • GenericMontyParams => MontyParams: this is the one generic type for Montgomery params. It's definitely quite helpful when writing generic code.
  • Monty => MontyForm: we named it the former because MontyForm was previously taken, but the name is otherwise ambiguous: is it a trait for MontyForm or MontyParams? This rename makes it clear that this is the trait for *MontyForm types.

Closes #1141

@tarcieri tarcieri requested a review from fjarri January 21, 2026 22:53
@tarcieri
Copy link
Member Author

FYI @andrewwhitehead @fjarri this would be a breaking change

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 73.91304% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.69%. Comparing base (5626eac) to head (c5462ba).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/modular/fixed_monty_form.rs 53.84% 6 Missing ⚠️
src/modular/boxed_monty_form/from.rs 0.00% 5 Missing ⚠️
src/modular/fixed_monty_form/mul.rs 54.54% 5 Missing ⚠️
src/modular/fixed_monty_form/neg.rs 0.00% 3 Missing ⚠️
src/modular/fixed_monty_form/add.rs 77.77% 2 Missing ⚠️
src/modular/fixed_monty_form/sub.rs 77.77% 2 Missing ⚠️
src/modular/monty_params.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1145   +/-   ##
=======================================
  Coverage   80.68%   80.69%           
=======================================
  Files         178      178           
  Lines       18946    18954    +8     
=======================================
+ Hits        15287    15295    +8     
  Misses       3659     3659           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tarcieri tarcieri force-pushed the rename-fixed-monty-form branch 2 times, most recently from f6cd57c to ada2c70 Compare January 24, 2026 16:18
I find myself personally never using `MontyForm` (though I guess I might
if we try `no_alloc` in `rsa`), and it's kind of bothered me that it has
such a choice name while things I am using like `Monty` and
`GenericMontyParams` seem to have somewhat suboptimal names.

This commit renames `FixedMontyParams` which gives it more of an equal
position to the other two and unlocks the names `MontyForm` and
`MontyParams` for functionality which is common to all of the different
implementations.

It also renames the following:

- `MontyParams` => `FixedMontyParams`: this follows from above, these
  are the params that go with `FixedMontyForm` (NOTE: they're also used
  by `ConstMontyForm`, so not sure if this rename will make that more
  confusing or not)
- `GenericMontyParams` => `MontyParams`: this is the one generic type
  for Montgomery params. It's definitely quite helpful when writing
  generic code.
- `Monty` => `MontyForm`: we named it the former because `MontyForm` was
  previously taken, but the name is otherwise ambiguous: is it a trait
  for `MontyForm` or `MontyParams`? This rename makes it clear that this
  is the trait for `*MontyForm` types.

Closes #1141
@tarcieri tarcieri force-pushed the rename-fixed-monty-form branch from ada2c70 to c5462ba Compare January 24, 2026 16:33
@tarcieri tarcieri merged commit 6ebafdc into master Jan 24, 2026
28 checks passed
@tarcieri tarcieri deleted the rename-fixed-monty-form branch January 24, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename MontyForm to FixedMontyForm?

2 participants