RSA and Wiener's attack
There should be no limits to the exponent size if you're using power_mod.
&quot;Too big&quot; errors in a multiple-precision-capable library likely mean that you're trying to exponentiate-then-modulo; this creates huge numbers. If you use power_mod (cf. Python's pow), it keeps the number pruned within $\{0,\dots,n-1\}$ through the process so it never has to handle &quot;exponentially large&quot; numbers.