We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
有几个人已经提到了 GMP。我只想补充一点,至少在我上次查看时,它很大程度上仅限于与 gcc 一起使用。
如果您想使用其他编译器,您可能会考虑 NTL 和 MIRACL。我已经测试了 MIRACL 一点,它似乎工作得相当好。我使用 NTL 的次数相当多,虽然大整数更多地是它的副业,但它仍然做得很好。它并不声称与 GMP 一样快(事实上,可以使用 GMP 进行基本操作),但是当我在两者之间进行一些最小的基准测试时,我没有发现很多显着差异(尽管那是很久以前的事了,我怀疑它是否还有效)。
A couple of people have already mentioned GMP. I would only add that at least the last time I looked, it was pretty well restricted to working with gcc.
If you want to use other compilers, are couple you might consider are NTL and MIRACL. I've tested MIRACL a bit, and it seems to work reasonably well. I've used NTL quite a bit more, and while large integers are more of a sideline for it, it still does them quite nicely. It doesn't claim to be as fast as GMP (and, in fact, can use GMP to do basic operations), but when I've done some minimal benchmarking between the two I haven't found a lot of significant differences (though that was long enough ago that I doubt it's valid anymore either).
Gnu MP 提供了一个bignum 库。
Gnu MP provides a bignum library.
OpenSSL 库还提供了可靠的 BigNum 实现 (
)。The OpenSSL library also provides a solid BigNum implementation (
<openssl/bn.h>
).我使用 MAPM 这是一个可移植的任意精度(整数和浮点数)点)库。
I use MAPM which is a portable arbitrary precision (integer and floating point) library.
来自 libtomcrypt 的 libtommath 可能是最小、最简单且最快的。 (有趣的是,这 3 个最高级几乎总是在一起......)如果你找不到上游,你可以从 dropbear ssh 源树中获取源代码。
libtommath, from libtomcrypt, is probably the smallest, simplest, and fastest. (Funny how those 3 superlatives almost always come together...) If you can't find an upstream you can get the source from the dropbear ssh source tree.
如果您需要 ANSI 标准 C,请在 Dave Hanson 的 C 接口和实现 中获取代码。非常清晰且设计精良。
如果 gcc 和 gcc 扩展没问题,那么正如其他人指出的那样,Gnu 多精度库 (GMP) 得到了很好的考虑并被广泛使用。
If you want ANSI Standard C, get the code in Dave Hanson's C Interfaces and Implementations. Very clear and well designed.
If gcc and gcc extensions are OK, then as others have pointed out the Gnu Multiprecision Library (GMP) is well thought of and widely used.
Mbed 有一个 bignum 实现,用作加密函数的基础。
它大量用于微控制器。
Mbed has a bignum implementation that serves as basis for the crypto functions.
It is heavily used on microcontrollers.