小编qwe*_*rty的帖子

Android BigInteger ArithmeticException

我正在尝试在Android应用程序中实现RSA算法.我正在使用java.math.BigInteger.modPow()en// decryption函数,它适用于我的计算机(Windows和Xubuntu)和我的Raspberry Pi(也是Debian).当我的手机(Android 4.4.4)上执行相同的代码时,在第二次调用时会抛出以下异常modPow():

java.jang.ArithmeticException: error:0306B06B:bignum routines:BN_div:not initialized
    at java.math.NativeBN.BN_mod_exp(NativeMethod)
    at java.math.BigInt.modExp(BigInt.java:327)
    at java.math.BigInteger.modPow(BigInteger.java:997)
    at "where I call java.math.BigInteger.modPow()"
Run Code Online (Sandbox Code Playgroud)

我检查了指数和模数:两者都是正数,因此文档并没有真正帮助.减小密钥的大小(指数和模数)也没有改变任何东西.不幸的是,我找不到本机功能的来源,并且没有想法可能会发生什么.

你知道为什么会抛出这个异常或错误代码应该是什么意思吗?

java android rsa biginteger arithmeticexception

12
推荐指数
1
解决办法
875
查看次数

标签 统计

android ×1

arithmeticexception ×1

biginteger ×1

java ×1

rsa ×1