GMP for big integer arithmetic

Now I’m back to my cryptography study after a long rest. My next target is RSA algorithm which requires big integer arithmetics. I decided to use GMP library because it’s been around for a while and seems reliable.

Installation on MacOS was as simple as –

brew install gmp

I need to add the following line to CMakelist.txt.

link_directories("/opt/homebrew/opt/gmp/lib")

And add “gmp” to target_link_libraries. These changes are quite the same as I did for OpenSSL.

Also, to make IntelliSense detect the library header files, I needed right-click the error squiggle on #include <gmp.h>, select “Quick Fix” and then select fix IncludePath setting. This is the fastest way because VS code has tons of settings and I don’t know how they are organized, yet.

Leave a Reply

Your email address will not be published. Required fields are marked *