BSD 许可的 Big Integer C lib,具有快速 modpow

发布于 2024-09-08 18:43:27 字数 589 浏览 2 评论 0原文

我正在搜索一个快速(特别是 p^n mod g 操作,应该用蒙哥马利实现)大整数库。我知道有 GMP,但 GMP 是 LGPL,这不符合我的要求。

我尝试了 http://www.acme.com/software/bigint/ 并尝试优化那里的modpow。但由于数据是以 2^32 为基数存储的,因此在 modpow 中进行一些优化并不容易。

我还尝试了 http://www.perfsci.com/free-software.asp 但是这个库的内存管理有些混乱。它经常因一些 malloc/free 问题而崩溃。 也许 OpenSSL 的 bignum 可以满足我的需求?但我不想将整个 OpenSSL 库添加到我的项目中。也许可以从 OpenSSL 中提取 bignum 部分?

有人有什么建议吗?

PS 该库应该在 iPhone/iPad 上运行。

I'm searching a fast (specially the p^n mod g operation, should be implemented with montgomery) big integer library. I know there is GMP but GMP is LGPL which doesn't fit my requirements.

I tried http://www.acme.com/software/bigint/ and tried to optimize the modpow in there. But do to the fact that the data is stored with base 2^32 it is not so easy to do some optimizations in the modpow.

I also tried giantint from http://www.perfsci.com/free-software.asp but this library has some messed up memory management. It constantly crashes with some malloc/free problems.
Maybe the bignum from OpenSSL would do what I'm searching for? But I don't wan't to add the entire OpenSSL lib to my project. Maybe It's possible to extract the bignum part from OpenSSL?

Anyone any suggestions?

P.S. the lib should run on the iPhone/iPad.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

☆獨立☆ 2024-09-15 18:43:27

尝试查看 libtomcrypt。它必须有一些大整数实现,该实现可能小而高效。似乎不再有官方上游,但 dropbear ssh 实现使用它,你可以使用 dropbear 找到源代码。

Try looking in libtomcrypt. It must have some big integer implementation which is probably small and efficient. There seems to be no official upstream anymore but the dropbear ssh implementation uses it and you can find the source with dropbear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文