We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8acdef2 commit 391f0baCopy full SHA for 391f0ba
ff-macros/src/small_fp/mod.rs
@@ -22,7 +22,15 @@ pub(crate) fn small_fp_config_helper(
22
23
let backend_impl = match backend.as_str() {
24
"standard" => standard_backend::backend_impl(&ty, modulus, generator),
25
- "montgomery" => montgomery_backend::backend_impl(&ty, modulus, generator),
+ "montgomery" => {
26
+ if modulus >= 1u128 << 127 {
27
+ panic!(
28
+ "SmallFpConfig montgomery backend supports only moduli < 2^127. Use MontConfig with BigInt instead of SmallFp."
29
+ )
30
+ }
31
+ montgomery_backend::backend_impl(&ty, modulus, generator)
32
+ },
33
+
34
_ => panic!("Unknown backend type: {}", backend),
35
};
36
0 commit comments