dongxie9448 2013-04-27 19:16
浏览 104
已采纳

gmp_pow()不接受指数的GMP编号

I am playing around in PHP with RSA and big numbers. I need to be able to take numbers to the power of an exponent that has ~256 to ~512 bytes using gmp_pow(). Does anyone have any suggestions?

  • 写回答

1条回答 默认 最新

  • dscs63759 2013-04-27 22:43
    关注

    You should use gmp_powm() which automatically reduces the intermediate values to be less than the modulus value. This exactly what you want for RSA.

    gmp_pow() doesn't accept an exponent large than a long since the intermediate values will be larger than the addressable memory in your computer.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?