aun*_*low 1 java biginteger carryflag long-integer
我相信在 64 位 JVM 中,long[] 比 int[] 效率更高,并且可以显着加快 RSA 操作的速度。
进位是 long[] 中的一个问题,但是我们可以使用一些本地方法强制 long 为无符号,例如long z = u64add(x, y, cr),这里cr是 a boolean[],可以替换long z = x + y。
BigInteger支持multiply(),不仅仅是add()。由于multiply()这是更昂贵的操作,因此它的速度对于算法来说也是最重要的。
Multiplying two 64-bit integers gives a 128-bit result. There is no 128-bit integer type in Java, so getting the correct result isn't just "do the operation and shift some bits." You would have to split the two numbers into 4 32-bit pieces, multiply those, and then compose the result. Or add a JVM intrinsic so that a native 128-bit operation could be used. It's not that it can't be done, it's more of a cost-benefit thing.
| 归档时间: |
|
| 查看次数: |
155 次 |
| 最近记录: |