Pos*_*don 5 math bit-shift bigint rust
当尝试对 BigInt 执行 >> 或 >>= 时,出现此错误:
no implementation for `BigInt >> BigInt
使用num_bigint::BigInt
图书馆
编辑:更多上下文:
我正在将这个程序https://www.geeksforgeeks.org/how-to-generate-large-prime-numbers-for-rsa-algorithm/从 python/c++ 重写为 rust 但我将重点关注 python 实现编写用于处理非常大的 1024 位素数。
更新:我已经完成了 Rust 实现https://github.com/dzyphr/Rust_Repo/blob/master/big_prime/src/main.rs
在代码中,我们运行 Miller Rabin Primality 测试,其中包括如果我们发现 EC % 2 == 0,则将 EC: (prime-candidate - 1) 向右移动 1。正如我在 python 实现中提到的,EC 可能是一个令人难以置信的结果。大整数。
能够在 Rust 中使用相同的运算符会很方便,如果不可能,有人可以建议替代方案吗?
归档时间: |
|
查看次数: |
428 次 |
最近记录: |