Skip to content

Conversation

@phrwlk
Copy link

@phrwlk phrwlk commented Nov 9, 2025

Description

This change replaces BigInt roundtrips and unwrap_or_default() calls in modular inverse helpers with a BigUint-only path using div_mod_unsigned, aligning with the project’s error-handling policy and avoiding silent failure modes. The previous unwrap_or_default() masked potential conversion issues and diverged from established patterns where conversions either cannot fail or are explicitly propagated via typed errors. The refactor also reduces unnecessary allocations by avoiding BigUint→BigInt→BigUint conversions and brings the 256-bit and 384-bit implementations in line with the 512-bit variant’s style.

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.

1 participant