intops

intops is a Nim library with ready-to-use core primitives for CPU-sized integers. It is intended to be used as a foundation for other libraries that rely on manipulations with big integers, e.g. cryptography libraries.

intops offers a clean high-level API that hides the implementation details of an operation behind a dispatcher which tries to offer the best implementation for the given environment. However, you can override the dispatcher's choice and call any implementation manually.

intops aims to satisfy the following requirements:

  1. Offer a complete set of arithmetic primitives on signed and unsigned integers necessary to build bignum and cryptography-focuced libraries: addition, subtraction, multiplication, division, and composite operations.
  2. Support 64- and 32-bit integers.
  3. Support 64- and 32-bit CPUs.
  4. Support Windows, Linux, and macOS.
  5. Support GCC-compatible and MSVC compilers.
  6. Support runtime and compile time usage.
  7. Offer the best implementaion for each combination of CPU, OS, C compiler, and usage time.
  8. Allow the user to pick the implementation manually.