Skip to content

Additional methods, tests for MontyForm#1230

Merged
tarcieri merged 3 commits intoRustCrypto:masterfrom
andrewwhitehead:feat/monty-form-methods
Mar 24, 2026
Merged

Additional methods, tests for MontyForm#1230
tarcieri merged 3 commits intoRustCrypto:masterfrom
andrewwhitehead:feat/monty-form-methods

Conversation

@andrewwhitehead
Copy link
Copy Markdown
Contributor

This adds is_zero and is_one convenience methods for MontyForm, as well as from_montgomery for returning the result of into_montgomery to this representation.

Tests are added to cover the new and existing methods for FixedMontyForm and BoxedMontyForm.

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.00%. Comparing base (2c9849f) to head (e66f519).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1230      +/-   ##
==========================================
+ Coverage   87.99%   89.00%   +1.01%     
==========================================
  Files         184      184              
  Lines       21244    21347     +103     
==========================================
+ Hits        18693    19000     +307     
+ Misses       2551     2347     -204     

☔ 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.

@andrewwhitehead
Copy link
Copy Markdown
Contributor Author

Hm, it seems like I might have found a bug in the WASM backend.

@tarcieri
Copy link
Copy Markdown
Member

@andrewwhitehead WASM-only problems are likely to be a result of Word being 64-bit but usize being 32-bit now thanks to cpubits

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
@andrewwhitehead andrewwhitehead force-pushed the feat/monty-form-methods branch from 147d562 to e66f519 Compare March 24, 2026 14:47
@tarcieri tarcieri merged commit 3c7a21f into RustCrypto:master Mar 24, 2026
31 checks passed
@tarcieri tarcieri mentioned this pull request Mar 25, 2026
tarcieri added a commit that referenced this pull request Mar 25, 2026
## Added
- `#[inline]` attributes for shift and wrapping arithmetic ops (#1229)
- `MontyForm::{is_zero, is_one}` methods (#1230)
- `Gcd` supertrait bound to `Unsigned`/`Signed` traits (#1231)

## Changed
- Define `Uint` division traits generically (#1232)
- Use generic implementation of bit operations for `Wrapping` (#1235)
- Explicitly seal `MontyForm` (#1237)
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.

2 participants