Skip to main content

Module arithmetic

Module arithmetic 

Source
Expand description

Basic modular arithmetic helpers.

Functionsยง

mod_add
Computes (a + b) mod modulus and returns the normalized residue.
mod_mul
Computes (a * b) mod modulus and returns the normalized residue.
mod_normalize
Normalizes value into the residue class 0..modulus.
mod_sub
Computes (a - b) mod modulus and returns the normalized residue.