Introducing intops—a Nim library with arithmetic primitives for big integers

Hi!

I’d like to share this new Nim library with the community called intops:

intops provides optimized implementations or arithmetic operations for integers. So, basically, addition, subtraction, multiplication, division, and a bunch of other operations for 64- and 32-bit signed and unsigned integers implemented in Nim, C, and ASM. When you import an operation, intops picks the best (performance-wise) implementation for your CPU, OS, and C compiler, but you have the freedom to import specific implementations. Each operations is available in multiple flavors (overflowing, saturating, etc.). Complete list of available operations is available in the API index.

intops is already being used in Stint, BNcurve, and Nimbus (eth1 and eth2) but it’s designed to be used anywhere reliable bigint operations are required (primarily but not limited to crypto libraries).

To use intops in your library, follow the Quickstart guide: Quickstart - intops

A quick video about intops will follow shortly.

Here’s an intro from the Townhall meeting on February 20th:

And the slides: intops - Google Presentaties