using System.Numerics.BigInteger;
負の指数で modPowを使用して実行しようとしています。例外に関するドキュメントを読みました。そのため、いくつかのトリックを行いました
//a^(-x) mod n == (a^(-1))^x mod n
BigInteger tmp = BigInteger.ModPow(BigInteger.Divide(BigInteger.One, a),
secretKey, pCommon);
BigInteger resBigInteger = BigInteger.Multiply(b, tmp);
しかし、tmp は 0 です。どうすればその問題を解決できますか?