crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.38k stars 1.62k forks source link

BigInt powmod(b, e, m) or equivalent #7516

Open jzakiya opened 5 years ago

jzakiya commented 5 years ago

This is a followup per the request in https://forum.crystal-lang.org/t/bigint-powmod-b-e-m-or-equivalent/486 to raise this issue here.

Ruby's openssl library has fast arbitrary integer size numerical methods, like mod_exp, which use fast implementations|hooks into the GNU GMP library, https://gmplib.org/.

This is a request to provide the use of these methods in Crystal.

Providing these capabilities will not only make Crystal more compatible|comparable to Ruby (in terms of functionality and speed), but also make it more conducive for use in high level numerical computation fields, e.g. cryptography, number theory, astrophysics, data analysis, etc.

q9f commented 2 years ago

I just came across this again after two years (#8612) - curious if anyone was looking into this yet.