Closed qingshi163 closed 1 year ago
Thanks for your comment. All of the mod_ functions assume that their input is already reduced, so the modulus should never be smaller than x. This is mentioned in the documentation for each function, but I will consider adding a runtime check (which wouldn't take too much time).
Sorry did not see that, maybe a debug_assert will be great!
the match arm inside mod_pow function (x, naturalone!(), ) will return x.clone() but is not correct if the modulus smaller than x. it should return the modulus - 1 instead x.