Rust implementations of finite-field arithmetic based on big integers with configurable limb sizes

Overview

multiprecision

TODO:

  • rewrite readme
  • implement CIOS for 16-bit limbs

All operations are in little-endian form (where the digit in memory at the smallest memory address is the least signficant digit).

Implementations of cryptographic protocols that rely on large integer values (i.e. beyond 32 or 64 bits) must represent them using multiprecision-arithmetic. Specifically, such big integers (bigints) are represented as an array of $n$ -bit limbs or digits.

The multiprecision Rust library implements big integer and finite field arithmetic algorithms. The key difference between this library and others (such as num_bigint) is that this library internally represents the limbs of bigints as arrays of limbs whose size is defined by the programmer, rather than some default. The purpose of doing so, despite poorer performance, is to offer reference code for developers who need to build GPU shaders which handle bigint arithmetic.

It is necessary that the limb size be programmer-defined because smaller limb sizes, coupled with an iterative algorithm, allows for more efficient Montgomery multiplications, as smaller limb sizes eliminates some carry operations, if not all. Please refer to Gregor Mitscha-Baude's montgomery repository for a detailed description of this algorithm.

Since most GPUs are limited to 32-bit unsigned integers, we only implement algorithms that support limb sizes of 12 to 16 bits, inclusive.

You might also like...
A rust-based benchmark for BlueField SmartNICs.

Smartbench Smart-bench is a rust-based benchmarking tool for BlueField-series SmartNICs. The purpose is to enable easy testing of BlueField-series Sma

Rust based magic-string with source map chains support

enhanced-magic-string Rust implementation of https://www.npmjs.com/package/magic-string with original sourcemap chain support. license. This project i

Rust-based toolset and library for Halo: Combat Evolved

Ringhopper Ringhopper is a pure-Rust library used for creating and manipulating tag data for Halo: Combat Evolved. It also contains the Invader toolse

The non-opinionated Rust-based commit message linter.
The non-opinionated Rust-based commit message linter.

Documentation | Website git-sumi The non-opinionated Rust-based commit message linter Transform your commit practices with flexible linting for consis

TodoX is a sophisticated Rust-based application designed to facilitate seamless todo management.

Rust Todo List App is a command-line tool written in Rust that allows users to manage their tasks efficiently. Whether you need to add, mark as done, edit, or clear tasks from your todo list, this app provides essential functionalities to streamline your task management process. Additionally, I have integrated sqlite3 using the rusqlite crate. The database stores the data and will persist indefinitely until you manually delete it.

Rust-based linux reverse shell listener.
Rust-based linux reverse shell listener.

Catch Rust-based linux reverse shell listener. Installation TODO: fix this installation guide, but this kinda works: mkdir /opt/catch/ cd /opt/catch/

An MVP stack based bytecode VM

TinyVM An MVP stack-based bytecode VM This VM runs a simplistic, Turing complete instruction set. In ~250 LOC with extensive comments, it's meant to b

An expression based data notation, aimed at transpiling itself to any cascaded data notation.

Lala An expression oriented data notation, aimed at transpiling itself to any cascaded data notation. Lala is separated into three components: Nana, L

A stack based interpreted programming language.

Nightmare Nightmare is a dynamically-typed, procedural programming language that aims to be fast & simple. let user = input() as Int; print("You were

Owner
Geometry
Geometry
Rust library of custom number malarkey, including variable-bit-width integers

Numberwang The Numberwang crate is a library of custom number types and functionality, including variable-bit-width integers. It is named after the fi

Dan Williams 3 Nov 12, 2024
fanum tax 64-bit integers with LEB128

rizz64 Fanum* tax 64-bit integers. * Fanum is a popular streamer who taxes his friends by taking bites of their food. This crate provides an efficient

Matthew Kim 11 May 22, 2024
Highly experimental, pure-Rust big integer library

grou-num (Pronounced "groo", from the Chiac meaning "big") This package is a highly experimental, unstable big integer library. I would not recommend

Patrick Poitras 1 Dec 18, 2021
The Computer Language Benchmarks Game: Rust implementations

The Computer Language Benchmarks Game: Rust implementations This is the version I propose to the The Computer Language Benchmarks Game. For regex-dna,

Guillaume P. 69 Jul 11, 2022
Idiomatic Rust implementations for various Windows string types (like UNICODE_STRING)

nt-string by Colin Finck <[email protected]> Provides idiomatic Rust implementations for various Windows string types: NtUnicodeString (with NtUnicode

Colin Finck 5 Jun 4, 2023
A Rust no-std (de)compressor based on PAQ

MASHI まし A 100% no-std compatible Rust implementation of a PAQ style arithmetic coding, context mixing compressor. Its intended use case is compressin

null 7 Dec 14, 2022
A stack based, virtual machine language written in Rust

Stackyy A stack based, virtual machine language written in Rust Description: Stackyy is a stack based, virtual machine language inspired by Forth and

FlawlessCode 2 May 2, 2022
Tools to feature more lenient Polonius-based borrow-checker patterns in stable Rust

Though this be madness, yet there is method in 't. More context Hamlet: For yourself, sir, shall grow old as I am – if, like a crab, you could go back

Daniel Henry-Mantilla 52 Dec 26, 2022
Rust crate implementing short & stable ids based on timestamps

Lexicoid Short & stable IDs based on timestamps. Heavily inspired by Short, friendly base32 slugs from timestamps by @brandur. Install Install with ca

Luciano Mammino 6 Jan 29, 2023